fix(OPENFRAM-004): CU-86akbhhau 3 review findings across 2 files - #357
fix(OPENFRAM-004): CU-86akbhhau 3 review findings across 2 files#357flamingo[bot] wants to merge 2 commits into
Conversation
| // 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 { |
There was a problem hiding this comment.
🦩 🔴 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
| // 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) |
There was a problem hiding this comment.
🦩 🔴 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
| @@ -49,10 +49,10 @@ func runStatusCommand(cmd *cobra.Command, _ []string) error { | |||
| return sharedErrors.HandleGlobalError(err, verbose) | |||
| } | |||
| if (watch || interactive) && format != "text" { | |||
There was a problem hiding this comment.
🦩 🔴 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
Closes 3 review findings across 2 files.
Draft — this is a starting point, not a finished change. The fix required judgment, so read it before trusting it.
cmd/app/upgrade.go:72cmd/app/upgrade.go:61cmd/app/status.go:51What changed — and what was deliberately left — is explained per finding as inline review comments on the lines each finding touched.
Run: https://product-hub.flamingo.so/admin/code-review
Run id:
c6ee3ca1-56e8-4fc7-aad4-bc3bb708e69dMerging this PR is recorded as acceptance of the rule that produced it;
closing it unmerged is recorded as rejection. Both feed rule health, so
closing a wrong suggestion is useful rather than merely tidy.
ClickUp task: CU-86akbhhau OpenFrame CLI code duplication and manager fixes (6 PRs)