fix(docs): show deprecated flags in the generated reference tables - #1063
Conversation
pflag's MarkDeprecated sets both Deprecated and Hidden, and CommandsInTable returned early on Hidden. Deprecated-but-working flags were therefore absent from every generated reference page, along with the migration advice their messages already carry -- the only signal was a stderr warning. The (DEPRECATED: ...) rendering further down the same function had never executed. Skip a flag only when it is hidden without being deprecated, so MarkHidden's intent is preserved for internal aliases (--yes on the delete commands, --flow/--attestations on evaluate input, --attachments on attest override) while MarkDeprecated's flags are documented. The flags table is alphabetical, so deprecated rows land next to their replacements: --cluster above --clusters, --function-name above --function-names, --service-name above --services. Scope is the published reference only. pflag has its own Hidden check in FlagUsagesWrapped, so `kosli <cmd> --help` still omits these flags. 28 of 94 generated pages now carry a deprecated row. The two docs golden files gain one row each for --registry-provider, which comes from the shared addFingerprintFlags helper. Closes #1060
|
Claude finished @mbevc1's task in 1m 47s —— View job PR Review — show deprecated flags in generated reference tables
Verdict: LGTM. Small, well-scoped fix with a clear root cause and matching tests. I'd merge this. What the change does
Correctness ✅I verified the two hiding mechanisms are correctly distinguished:
Static analysis
Tests ✅Nice touch pairing Minor notes (non-blocking)
|
pflag's MarkDeprecated sets both Deprecated and Hidden, and CommandsInTable returned early on Hidden. Deprecated-but-working flags were therefore absent from every generated reference page, along with the migration advice their messages already carry -- the only signal was a stderr warning. The (DEPRECATED: ...) rendering further down the same function had never executed.
Skip a flag only when it is hidden without being deprecated, so MarkHidden's intent is preserved for internal aliases (--yes on the delete commands, --flow/--attestations on evaluate input, --attachments on attest override) while MarkDeprecated's flags are documented.
The flags table is alphabetical, so deprecated rows land next to their replacements: --cluster above --clusters, --function-name above --function-names, --service-name above --services.
Scope is the published reference only. pflag has its own Hidden check in FlagUsagesWrapped, so
kosli <cmd> --helpstill omits these flags.28 of 94 generated pages now carry a deprecated row. The two docs golden files gain one row each for --registry-provider, which comes from the shared addFingerprintFlags helper.
Closes #1060
Checklist
charts/k8s-reporter/) updated, if needed. Note: these changes live in a separate PR