Repository navigation
Add -m/--message to record a note on the commits ec makes - #267
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Warning Review limit reachedThis review ran on the open-source allowance, not this organization's plan, because the pull request author doesn't have an assigned seat. Waiting won't change this — ask an organization admin to assign them a seat, or add seats in Billing if every seat is already assigned, then retry. Next included review available in 17 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (9)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (9)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe CLI adds an optional ChangesCommit message option
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant CLI
participant ArgoCommands
participant Git
CLI->>ArgoCommands: invoke deploy with message
ArgoCommands->>Git: pass message to set_values
Git->>Git: create commit with message and generated summary
Suggested reviewers: Merge Risk: ⚪ Minimal · up to The commit-message option appears ready to merge after normal checks. No concrete issue requiring a pre-merge fix remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 21.54% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 65 functions across 8 files. (1 skipped: 1 unsupported.) ✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
🛠️ Fix failing CI checks 💡
Comment |
ec's git commits carry only a generated summary ("Set
services.foo.enabled=false in values.yaml"), which says what changed but
never why. -m/--message lets the operator record the reason at the point
of change.
The note becomes the commit subject, since that is what a log listing
shows, and the generated summary is kept as the body so the
machine-readable Set/Remove line stays greppable.
The option is only meaningful where ec commits, which is the Argo CD
backend, so:
- K8sCommands and DemoCommands opt out of it via params_opt_out, the
same mechanism K8sCommands already uses to drop --commit from
start/stop. The option is absent from the CLI on those backends rather
than accepted and ignored.
- On start/stop, --message requires --commit. Without it the change is
patched onto the live Argo CD application and never reaches git, so
there is no commit to annotate and ec refuses instead of silently
discarding the note.
Fixes two defects found while wiring this up:
- drop_options popped from the list it was enumerating, so the indices
shifted and the second of two dropped params for one command survived.
Nothing hit this before because no backend dropped more than one param
from a single command; K8sCommands now drops both commit and message
from start/stop, which does.
- drop_options raised KeyError for a command drop_methods had already
removed, which is every command the backend does not implement.
The nested confirm_callback in deploy and set-desc used a local named
`message` for the prompt string, which now shadows the new parameter;
renamed to `prompt`.
Closes #217
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014GsvY8MPA1WdKubZ76YVcd
K8sCommands.delete kept an unused `commit` parameter in the position the base class now gives to `message`, an incompatible override. The tests built a click.Context where drop_options takes a typer.Context, and _params' return type left out that a click param name may be None. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013HgLeGnwBSg3Xx1VgxEpt8
23580cc to
0cbff92
Compare
Adds
-m/--messageso an operator can record why a change was made, on the commitecwrites.Today those commits carry only a generated summary —
Set services.foo.enabled=false in values.yaml— which says what changed but never why.Shape
The note becomes the commit subject, because that is what shows up in a log listing, and the generated summary is kept as the body so the machine-readable
Set .../Remove ...line stays greppable:Offered on the five commands that mutate state:
delete,deploy,set-desc,start,stop.Backends that never commit
--messageonly means anything whereeccommits, which is the Argo CD backend. OnK8SandDEMOthe option is dropped from the CLI viaparams_opt_out— the same mechanismK8sCommandsalready uses to drop--commitfromstart/stop— rather than accepted and ignored. A note the operator believes was recorded but was not is worse than no option at all.DEMOopts out only ofset-desc/start/stop: it does not implementdeleteordeploy, sodrop_methodshas already removed those commands.--messagerequires--commiton start/stopWithout
--commit,start/stoppatch the live Argo CD application and write nothing to git, so there is no commit for the note to land on.ecrefuses with a message saying so instead of discarding it.Two defects fixed along the way
Both in
drop_options, and both surfaced by this change rather than invented by it:K8sCommandsnow drops bothcommitandmessagefromstart/stop, which does. Verified against the old implementation: given[service_name, commit, message]it leftmessagein place.KeyErrorfor a commanddrop_methodshad already removed, i.e. every command the backend does not implement.Also renamed the local
messagein the nestedconfirm_callbacks ofdeployandset-desctoprompt, since it now shadows the new parameter.Testing
104 passed(uv run pytest), ruff clean. 14 new tests intests/test_git.pyandtests/test_message_option.pycovering: the note's placement in the commit, shell-quoting of a hostile note (reusing the existingMALICIOUSfixture — a note is free text straight from the command line), the per-backend opt-outs, bothdrop_optionsregressions, and the--commitguard.Docs updated in
docs/reference/cli.md.Closes #217
🤖 Generated with Claude Code
https://claude.ai/code/session_014GsvY8MPA1WdKubZ76YVcd
Summary by CodeRabbit
-m/--messageoption to supported CLI commands. On Argo CD, the note becomes the commit subject, with the generated summary retained in the commit body.startandstop, providing a message requires--commit.