Repository navigation
fix!: keep CLI features out of Zarf tools - #1525
Conversation
|
@greptileai review |
|
@codex review |
|
@copilot review |
The changes look correct and well-scoped. Here's a brief review:
No issues found. The fix is minimal and correct. |
ebf8010 to
b02e306
Compare
|
@greptileai review |
|
@copilot review |
|
@codex review |
Greptile SummaryThe PR prevents normalized CLI feature values from being passed to recognized Zarf vendor-tool callbacks and expands alias/root-flag handling.
Confidence Score: 5/5The PR appears safe to merge because no eligible blocking failure remains. No blocking failure remains. Important Files Changed
Reviews (3): Last reviewed commit: "fix: keep CLI features out of Zarf tools" | Re-trigger Greptile |
No code changes since the previous review. The fix remains correct and minimal — no issues found. |
There was a problem hiding this comment.
Pull request overview
This PR fixes an argument/feature-handling edge case in the mode/feature bootstrap layer so that normalized CLI_FEATURES values are not re-added as --features=... when invoking uds zarf tools ... (which can cause Zarf’s vendored tool execution callbacks to reject the unexpected root flag).
Changes:
- Skip re-inserting
--features=...when the resolved command iszarf tools(including whenzarfroot flags appear betweenzarfandtools). - Extend Zarf command detection to recognize the
zalias consistently. - Add unit and legacy e2e coverage to ensure
uds zarf tools kubectl ...works withCLI_FEATURESset (including withNextModeenabled).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/legacy/e2e/zarf_test.go | Adds an e2e regression test ensuring CLI_FEATURES does not break uds zarf tools kubectl .... |
| internal/mode/mode.go | Prevents re-inserting --features for zarf tools and improves detection across flags/aliases. |
| internal/mode/mode_test.go | Adds unit test cases covering zarf tools feature-skipping behavior (including flags and alias). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b02e3062a3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
b02e306 to
4cb947d
Compare
Signed-off-by: Sebastian Łaskawiec <sebastian.laskawiec@defenseunicorns.com>
4cb947d to
259353b
Compare
|
@copilot review |
|
@codex review |
|
@greptileai review |
Reviewed commit 259353b. The implementation is correct and well-scoped:
No issues found. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 259353ba17
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: Sebastian Łaskawiec <sebastian.laskawiec@defenseunicorns.com>
There was a problem hiding this comment.
In testing this does appear to fix the kubectl regression I experienced. I still think there's a broader concern though that is worth addressing or clearly deferring/opening a new issue for... --features / CLI_FEATURES still mixes UDS-owned features (for example, NextMode) with Zarf-owned features (for example, values) in one set. I'm not sure if there's any particular issues with this today but this could potentially cause problems in the future if:
- CLI or Zarf perform any validation around feature flags (that the selected flag actually exists)
- CLI/Zarf have overlapping feature flags (same name - this might be okay if they are meant to do the same thing)
Even putting these potential issues aside, I think it could be a bit confusing that feature flags meant for the CLI get passed to Zarf and vice-versa?
Edit: also (as I know you flagged) there's some clunkiness around the way this PR filters out features from the tool commands. I wonder whether this could be cleaner if the distinction between Zarf and CLI features was more explicitly designed/accounted for?
After seeing this I wish we would have taken the approach of separating the features. Like using Created a ticket here: https://linear.app/defense-unicorns/issue/CLI-323/separate-ownership-of-uds-cli-and-zarf-feature-flags |
…i-317 Signed-off-by: Sebastian Łaskawiec <sebastian.laskawiec@defenseunicorns.com>
Signed-off-by: Sebastian Łaskawiec <sebastian.laskawiec@defenseunicorns.com>
|
Implemented position-sensitive ownership in mode.go: root |
Signed-off-by: Sebastian Łaskawiec <sebastian.laskawiec@defenseunicorns.com>
Signed-off-by: Sebastian Łaskawiec <sebastian.laskawiec@defenseunicorns.com>
…i-317 Signed-off-by: Sebastian Łaskawiec <sebastian.laskawiec@defenseunicorns.com>
Signed-off-by: Sebastian Łaskawiec <sebastian.laskawiec@defenseunicorns.com>
…i-317 Signed-off-by: Sebastian Łaskawiec <sebastian.laskawiec@defenseunicorns.com>
Signed-off-by: Sebastian Łaskawiec <sebastian.laskawiec@defenseunicorns.com>
joelmccoy
left a comment
There was a problem hiding this comment.
LGTM - converted this to a breaking change in the pr title, but I think this small change is worth while
Description
Prevent normalized
CLI_FEATURESvalues from being reinserted intozarf toolscallback arguments. This fixes Zarf action callbacks such asuds zarf tools kubectl ..., which reject the root--featuresflag.Related Issue
Fixes CLI-317
Type of change
Checklist before merging