Remove non-functional hidden alias flags from bundle generate#5591
Open
janniklasrose wants to merge 2 commits into
Open
Remove non-functional hidden alias flags from bundle generate#5591janniklasrose wants to merge 2 commits into
janniklasrose wants to merge 2 commits into
Conversation
The hidden --existing-dashboard-id, --existing-dashboard-path, --existing-alert-id, and --existing-genie-space-id flags aliased the canonical --existing-id/--existing-path flags by binding the same variable, but were never included in the cobra requirement wiring (MarkFlagsOneRequired / MarkFlagRequired). Cobra validates those groups on the named flags' Changed state, so alias-only invocations always failed flag validation. The aliases never worked in any release; with this change an alias invocation gets cobra's honest 'unknown flag' error instead of a misleading requirement-group error. Co-authored-by: Isaac
Co-authored-by: Isaac
Contributor
Approval status: pending
|
Collaborator
Integration test reportCommit: ee2d333
28 interesting tests: 15 SKIP, 7 KNOWN, 6 flaky
Top 26 slowest tests (at least 2 minutes):
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Remove the hidden
--existing-dashboard-id,--existing-dashboard-path,--existing-alert-id, and--existing-genie-space-idalias flags frombundle generate dashboard|alert|genie-space. These aliased the canonical--existing-id/--existing-pathflags by registering a second flag bound to the same variable ("included for symmetry with the other generate commands"), but they were never wired into the cobra requirement groups (MarkFlagsOneRequired/MarkFlagRequired). Cobra validates those groups on the named flags'Changedstate, so an alias-only invocation always failed flag validation before reaching the command:The aliases were broken from the commit that introduced each of them (#1847 for dashboard, #4108 for alert, #5282 for genie-space), are hidden from help output, and are referenced nowhere in docs, examples, or tests — no working invocation ever depended on them. With this change, passing one yields cobra's
unknown flagerror plus usage listing the canonical flags, instead of the misleading requirement-group error.The canonical long-form flags of the other generate commands (
--existing-job-id,--existing-pipeline-id,--existing-app-name) are unaffected.Tests
unknown flag; canonical--existing-id/--existing-pathinvocations still pass flag validation.go test ./cmd/bundle/generate/...andgo test ./acceptance -run TestAccept/bundle/generatepass with no golden output changes (hidden flags never appeared in help output).This pull request and its description were written by Isaac, an AI coding agent.