You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Repo Assist] refactor(envutil): move ExpandEnvArgs from config to envutil (#3217)
🤖 *This is an automated pull request from Repo Assist.*
## Summary
Moves `ExpandEnvArgs` from `internal/config/docker_helpers.go` to a new
`internal/envutil/expand_env_args.go`, co-locating it with the other
env-var utilities (`GetEnvString`, `GetEnvInt`, `GetEnvDuration`,
`GetEnvBool`).
## Root Cause / Motivation
`ExpandEnvArgs` is a generic utility that expands Docker `-e VAR_NAME`
flags by reading from the process environment. Despite living in the
`config` package, it:
- Is **not Docker-specific** or config-specific in behaviour
- Has its **only non-test caller** in `internal/mcp/connection.go`,
creating an `mcp → config` import dependency purely for this one
function
- Is semantically identical in purpose to `GetEnvString` / `GetEnvBool`
already in `envutil`
This is the "quick win" refactoring identified in issue #3211 (Semantic
Function Clustering analysis).
## Changes
| File | Change |
|------|--------|
| `internal/envutil/expand_env_args.go` | New — contains `ExpandEnvArgs`
with `logExpand` logger (`envutil:expand`) |
| `internal/envutil/expand_env_args_test.go` | New — tests moved from
`config` package |
| `internal/config/docker_helpers.go` | Removed `ExpandEnvArgs` function
(30 lines) |
| `internal/config/docker_helpers_and_env_test.go` | Removed
`TestExpandEnvArgs*` tests (144 lines) |
| `internal/mcp/connection.go` | Import `envutil` instead of `config` |
| `internal/mcp/connection_test.go` | Use `envutil.ExpandEnvArgs`
instead of `config.ExpandEnvArgs` |
## Test Status
**Note**: The sandboxed CI environment during Repo Assist runs does not
have network access to download Go module dependencies, so a full `make
build` could not be completed locally. However:
- `gofmt -e` confirms all changed files parse correctly (no syntax
errors)
- The logic is an exact copy of the existing function — no behavioural
changes
- All test cases were migrated intact
- The package boundary change is the only substantive modification
GitHub Actions CI will run the full build and test suite.
Closes nothing directly; addresses #3211 quick-win checklist item.
> Generated by [Repo
Assist](https://github.com/github/gh-aw-mcpg/actions/runs/24001493148/agentic_workflow)
·
[◷](https://github.com/search?q=repo%3Agithub%2Fgh-aw-mcpg+%22gh-aw-workflow-id%3A+repo-assist%22&type=pullrequests)
>
> To install this [agentic
workflow](https://github.com/githubnext/agentics/blob/851905c06e905bf362a9f6cc54f912e3df747d55/workflows/repo-assist.md),
run
> ```
> gh aw add
githubnext/agentics@851905c
> ```
<!-- gh-aw-agentic-workflow: Repo Assist, engine: copilot, model: auto,
id: 24001493148, workflow_id: repo-assist, run:
https://github.com/github/gh-aw-mcpg/actions/runs/24001493148 -->
<!-- gh-aw-workflow-id: repo-assist -->
0 commit comments