Description
pkg/cli/flags.go exists specifically to centralize flag registration, yet the --no-security-scanner/--disable-security-scanner deprecated-alias pattern was copy-pasted independently into 5 command files (add_command.go, add_wizard_command.go, deploy_command.go, trial_command.go, update_command.go) — ~20 lines of near-identical registration/deprecation/fallback logic plus 5 near-duplicate unit tests. A smaller-scale duplicate exists for --force-delete-host-repo-before to --delete-host-repo-before and --disable-release-bump to --no-release-bump. One test (update_command_test.go's HasDisableSecurityScannerFlag) has already drifted from the naming convention used by the other four (DeprecatesDisableSecurityScannerFlag), showing the duplication is already causing inconsistency.
Expected Impact
Add addSecurityScannerFlag(cmd) and a generic resolveDeprecatedBoolFlag(cmd, newName, oldName string) bool to pkg/cli/flags.go, then migrate all 5 commands to use them. Consolidates ~20 lines of duplicated logic and tests into one authoritative implementation, preventing future drift when the alias/help text changes.
Suggested Agent
Code Quality agent (or the repository-quality workflow that originally surfaced this).
Estimated Effort
Medium (1-4 hours)
Data Source
DeepReport Intelligence Briefing analysis, 2026-07-28. Source: Repository Quality Improvement Report #48629 (07-28).
Generated by 🔬 Deep Report · age00 · 176.7 AIC · ⌖ 13.2 AIC · ⊞ 10.5K · ◷
Description
pkg/cli/flags.goexists specifically to centralize flag registration, yet the--no-security-scanner/--disable-security-scannerdeprecated-alias pattern was copy-pasted independently into 5 command files (add_command.go,add_wizard_command.go,deploy_command.go,trial_command.go,update_command.go) — ~20 lines of near-identical registration/deprecation/fallback logic plus 5 near-duplicate unit tests. A smaller-scale duplicate exists for--force-delete-host-repo-beforeto--delete-host-repo-beforeand--disable-release-bumpto--no-release-bump. One test (update_command_test.go's HasDisableSecurityScannerFlag) has already drifted from the naming convention used by the other four (DeprecatesDisableSecurityScannerFlag), showing the duplication is already causing inconsistency.Expected Impact
Add
addSecurityScannerFlag(cmd)and a genericresolveDeprecatedBoolFlag(cmd, newName, oldName string) booltopkg/cli/flags.go, then migrate all 5 commands to use them. Consolidates ~20 lines of duplicated logic and tests into one authoritative implementation, preventing future drift when the alias/help text changes.Suggested Agent
Code Quality agent (or the repository-quality workflow that originally surfaced this).
Estimated Effort
Medium (1-4 hours)
Data Source
DeepReport Intelligence Briefing analysis, 2026-07-28. Source: Repository Quality Improvement Report #48629 (07-28).