Skip to content

fix(OPENFRAM-004): CU-86akbhhau 3 review findings across 2 files - #357

Draft
flamingo[bot] wants to merge 2 commits into
mainfrom
ai-fix/openfram-004-1d8098c9-c6ee3ca1
Draft

fix(OPENFRAM-004): CU-86akbhhau 3 review findings across 2 files#357
flamingo[bot] wants to merge 2 commits into
mainfrom
ai-fix/openfram-004-1d8098c9-c6ee3ca1

Conversation

@flamingo

@flamingo flamingo Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

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.

# Fix confidence Finding Location
1 🟢 90 high runUpgradeCommand mutually-exclusive flag error returned without HandleGlobalError/AlreadyHandledError wrapping cmd/app/upgrade.go:72
2 🟡 85 medium extractInstallFlags error in runUpgradeCommand not wrapped by HandleGlobalError cmd/app/upgrade.go:61
3 🟡 85 medium runStatusCommand returns unwrapped fmt.Errorf without AlreadyHandledError sentinel for the --watch/--output conflict cmd/app/status.go:51

What 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-bc3bb708e69d

Merging 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)

@flamingo flamingo Bot left a comment

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.

🦩 What this fix changed, finding by finding

3 finding(s) fixed in this draft — 3 explained inline on the diff.

Comment thread cmd/app/upgrade.go
// 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

Comment thread cmd/app/upgrade.go
// 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

Comment thread cmd/app/status.go
@@ -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

@flamingo flamingo Bot changed the title fix(OPENFRAM-004): 3 review findings across 2 files fix(OPENFRAM-004): CU-86akbhhau 3 review findings across 2 files Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants