Repository navigation
Conversation
After flag update, flag enable or flag disable succeeds, print the command
that puts the flag back, on stderr under the confirmation:
✓ Set max_items to 30 in environment Production (…)
Undo: flagsmith flag update max_items --value 25
It is worked out from the state read before the write. A new segment override
is undone with flag delete --segment. An explicit --project or --environment
is repeated so the command works from anywhere. No hint is printed when the
previous state can't be restated as a command (an unset value, re-weighted
variants) or when nothing changed.
Part of Flagsmith#65.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Reply to a comment to ask cubic a question or push back. It learns from your replies.
Re-trigger cubic
- Repeat an explicit --api-url and --organisation in the undo command. - Print no hint when --value sets the value it already had. - Print undo hints for --identifier updates: a new override is undone by deleting it, an existing one by restoring its state. - Assert the hint is on stderr, after the confirmation lines. - Add Given/When/Then sections to TestUndoValueArgs.
There was a problem hiding this comment.
0 issues found across 3 files (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: Auto-approval skipped because this PR is from an external contributor.
Re-trigger cubic
Part of #65: hint an undo command after a successful mutation.
After
flag update,flag enableorflag disablesucceeds, the CLI prints the command that puts the flag back, on stderr under the confirmation:--segment <id>; a newly created override is undone withflagsmith flag delete <feature> --segment <id>.--project/--environmentis repeated, so the command works from any directory. Values are shell-quoted, and a string that would be inferred as another type gets--type string.Not in this PR: the first half of #65 (showing a diff when confirming). That needs a decision on the format, so I left it for a follow-up.
Verified
TestFlagUpdateUndoHint(9 cases, including a failed update and the no-hint cases) andTestUndoValueArgs. The hint cases fail without the change.go vet ./...andgo test -race ./...pass.This contribution was prepared with AI coding assistance.