Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmd/app/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ func runStatusCommand(cmd *cobra.Command, _ []string) error {
return sharedErrors.HandleGlobalError(err, verbose)
}
if (watch || interactive) && format != "text" {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🦩 πŸ”΄ runStatusCommand returns unwrapped fmt.Errorf without AlreadyHandledError sentinel for the --watch/--output conflict

In runStatusCommand (cmd/app/status.go), both the --watch/--output conflict error and the adjacent --watch/--interactive need an interactive terminal error are now routed through sharedErrors.HandleGlobalError(..., verbose) instead of being returned as raw fmt.Errorf values, matching the pattern used by every other error path in the function so main's double-print suppression via the AlreadyHandledError sentinel works consistently. I also fixed the second (previously unmentioned but identically-shaped) terminal-interactivity error for consistency, since leaving it unwrapped would reintroduce the same bug the finding describes.

πŸ€– Prompt for AI agents
In cmd/app/status.go around line 51, review and complete this code-review fix: runStatusCommand returns unwrapped fmt.Errorf without AlreadyHandledError sentinel for the --watch/--output conflict.
What the draft fix changed: In `runStatusCommand` (cmd/app/status.go), both the `--watch/--output` conflict error and the adjacent `--watch/--interactive need an interactive terminal` error are now routed through `sharedErrors.HandleGlobalError(..., verbose)` instead of being returned as raw `fmt.Errorf` values, matching the pattern used by every other error path in the function so main's double-print suppression via the AlreadyHandledError sentinel works consistently. I also fixed the second (previously unmentioned but identically-shaped) terminal-interactivity error for consistency, since leaving it unwrapped would reintroduce the same bug the finding describes.
Verify the change is correct and complete; do not refactor unrelated code.

fix confidence: 🟑 85 medium β€” react πŸ‘/πŸ‘Ž to teach the reviewer

return fmt.Errorf("--watch/--interactive are live terminal views and cannot combine with --output %s", format)
return sharedErrors.HandleGlobalError(fmt.Errorf("--watch/--interactive are live terminal views and cannot combine with --output %s", format), verbose)
}
if (watch || interactive) && (!ui.IsTerminal() || ui.IsPlain()) {
return fmt.Errorf("--watch/--interactive need an interactive terminal (and cannot combine with --plain)")
return sharedErrors.HandleGlobalError(fmt.Errorf("--watch/--interactive need an interactive terminal (and cannot combine with --plain)"), verbose)
}

cfg, err := resolveRestConfig(contextName)
Expand Down
6 changes: 3 additions & 3 deletions cmd/app/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,19 @@ Examples:

// runUpgradeCommand dispatches to change-ref (Mode 1) or force-sync (Mode 2).
func runUpgradeCommand(cmd *cobra.Command, args []string) error {
verbose := getVerboseFlag(cmd)
flags, err := extractInstallFlags(cmd)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🦩 πŸ”΄ extractInstallFlags error in runUpgradeCommand not wrapped by HandleGlobalError

In runUpgradeCommand, the extractInstallFlags(cmd) error path now returns sharedErrors.HandleGlobalError(err, verbose) instead of the raw err. To make verbose available at that point, the verbose := getVerboseFlag(cmd) line was moved above the extractInstallFlags call (previously it was declared after); this is a minimal reordering of two existing lines, not a behavioral change, since getVerboseFlag(cmd) does not depend on flags.

πŸ€– Prompt for AI agents
In cmd/app/upgrade.go around line 61, review and complete this code-review fix: extractInstallFlags error in runUpgradeCommand not wrapped by HandleGlobalError.
What the draft fix changed: In `runUpgradeCommand`, the `extractInstallFlags(cmd)` error path now returns `sharedErrors.HandleGlobalError(err, verbose)` instead of the raw `err`. To make `verbose` available at that point, the `verbose := getVerboseFlag(cmd)` line was moved above the `extractInstallFlags` call (previously it was declared after); this is a minimal reordering of two existing lines, not a behavioral change, since `getVerboseFlag(cmd)` does not depend on `flags`.
Verify the change is correct and complete; do not refactor unrelated code.

fix confidence: 🟑 85 medium β€” react πŸ‘/πŸ‘Ž to teach the reviewer

if err != nil {
return err
return sharedErrors.HandleGlobalError(err, verbose)
}
verbose := getVerboseFlag(cmd)
sync, _ := cmd.Flags().GetBool("sync")
refChanged := cmd.Flags().Changed("ref")

// The modes are mutually exclusive. Silently preferring --sync used to
// force-sync the CURRENT ref and discard an explicit --ref β€” the user
// believed they had deployed the new version (audit F5/T1-9).
if refChanged && sync {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🦩 πŸ”΄ runUpgradeCommand mutually-exclusive flag error returned without HandleGlobalError/AlreadyHandledError wrapping

In runUpgradeCommand, the mutually-exclusive --ref/--sync error now returns sharedErrors.HandleGlobalError(fmt.Errorf(...), verbose) instead of a plain fmt.Errorf(...), matching the suggested fix exactly. verbose is now computed before this check (moved up) so it's available at this point.

πŸ€– Prompt for AI agents
In cmd/app/upgrade.go around line 72, review and complete this code-review fix: runUpgradeCommand mutually-exclusive flag error returned without HandleGlobalError/AlreadyHandledError wrapping.
What the draft fix changed: In `runUpgradeCommand`, the mutually-exclusive `--ref`/`--sync` error now returns `sharedErrors.HandleGlobalError(fmt.Errorf(...), verbose)` instead of a plain `fmt.Errorf(...)`, matching the suggested fix exactly. `verbose` is now computed before this check (moved up) so it's available at this point.
Verify the change is correct and complete; do not refactor unrelated code.

fix confidence: 🟒 90 high β€” react πŸ‘/πŸ‘Ž to teach the reviewer

return fmt.Errorf("--ref and --sync are mutually exclusive: --ref deploys a new ref (Mode 1), --sync re-syncs the current ref (Mode 2); drop one of them")
return sharedErrors.HandleGlobalError(fmt.Errorf("--ref and --sync are mutually exclusive: --ref deploys a new ref (Mode 1), --sync re-syncs the current ref (Mode 2); drop one of them"), verbose)
}

if upgradeIsChangeRef(refChanged, sync) {
Expand Down
Loading