Keep commas in env values and accept bare KEY=VALUE args in env set - #1197
Conversation
The flag library split every repeatable string flag on commas, so `miren env set -e KEY=a,b,c` arrived as three entries: KEY=a, b, and c. mflags now has a split:"false" struct tag that keeps each occurrence whole. This bumps to that version and applies the tag to the -e and -s flags of env set and deploy, and to --org on auth provider add github, whose documented name:team1,team2 form was being split the same way. env set also accepts bare KEY=VALUE arguments with no flag, treated the same as -e. Fixes MIR-1168.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (7)
Included review availability: 4 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 6 reviews per hour. 📝 WalkthroughWalkthroughThe CLI now preserves comma-containing environment, sensitive, deployment, and GitHub organization arguments as single values. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to This change stops the CLI from incorrectly splitting comma-containing environment values and GitHub team lists, and adds support for bare KEY=VALUE arguments in env set. The behavior is covered by new tests and documentation, and no unresolved correctness or stability concerns were found in the reviewed parsing paths. Comment |
There was a problem hiding this comment.
🍪 biscuit: ✅ ready to merge — auto-review, non-blocking
I read through this change carefully. It does two concrete things: adds split:"false" to every []string flag that was being silently comma-split (fixing the root bug), and adds a rest:"true" positional-args field to EnvSet so users can write miren env set KEY=VALUE KEY=VALUE without -e. Both changes are wired correctly and consistently through the three affected commands (env set, deploy, auth provider add github).
What I checked:
- The
split:"false"fix is applied to all four[]stringflags that needed it (Env,Sensitivein bothenv.goanddeploy.go, andOrgsinauth_provider_github.go). I didn't find any other[]stringflag that handles comma-sensitive values that was left un-fixed. - The merge in
EnvSetof bare args intoenvviaslices.Concat(opts.Env, opts.Args)is correct. TheenvSetReferencepath, the "nothing specified" guard, andParseEnvVarSpecsall consistently use the merged slice. - A bare positional arg without
=(e.g.miren env set MYVAR) flows intoparseEnvVarSpec, which already treats any arg without=as a "prompt for value" case — that's existing behavior, not a regression from this PR. - The three new tests in
env_set_flags_test.goare well-targeted: they exercise comma preservation in flag values, interleaved bare args and flag args being routed to the right fields, and the GitHub org team-list round-trip throughbuildGitHubConfigJSON. TheTestAuthProviderGitHubOrgTeamsSurviveParsingtest is especially useful because it validates the semantic impact of the split fix, not just the parsed slice. - The mflags dependency bump (
go.mod/go.sum) is what actually delivers thesplit:"false"feature; the hashes look consistent and there are no other unexpected dependency changes. - Documentation (
commands.go,docs/docs/command/env-set.md) accurately describes both features.
The change is clean and self-contained. I'm comfortable approving it.
🍪 full review note · comment /biscuit review to run biscuit again.
phinze
left a comment
There was a problem hiding this comment.
Approved upstream so you can repin to the merged commit
Fixes MIR-1168.
miren env set -e KEY=a,b,cwas setting three variables (KEY=a,b, andc) because the flag library splits every repeatable string flag on commas. Once split, the pieces cannot be told apart from three separate-eflags, so the fix lives in mflags: asplit:"false"struct tag that keeps each flag occurrence whole (mirendev/mflags#16, merged).This PR:
split:"false"to the-eand-sflags ofenv setanddeploy, and to--orgonauth provider add github, whose documentedname:team1,team2form was being split the same way.env setaccept bareKEY=VALUEarguments with no flag, treated the same as-e. Docs and an example cover this.Tests go through the real flag set for all three commands. The command docs were regenerated and show no drift beyond the
env setchanges.