Skip to content

fix(OPENFRAM-005): CU-86akbhhau 2 review findings across 2 files - #380

Draft
flamingo[bot] wants to merge 2 commits into
mainfrom
ai-fix/openfram-005-5bd21bb1-82c9c576
Draft

flamingo[bot] wants to merge 2 commits into
mainfrom
ai-fix/openfram-005-5bd21bb1-82c9c576

Conversation

@flamingo

@flamingo flamingo Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Closes 2 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 🟡 85 medium fatalManifestError uses fmt.Errorf instead of preserving a self-diagnosed error type internal/chart/providers/argocd/fatalmanifest.go:130
2 🔴 30 low — review closely printClusterStatus writes final output via fmt.Println instead of a silence-aware printer cmd/cluster/status.go:105

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: 82c9c576-edf0-420c-92b6-727226d68389

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 (11 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

2 finding(s) fixed in this draft — 2 explained inline on the diff; 1 low-confidence hunk(s) need close review before merging.

Comment on lines 147 to 151
b.WriteString("The chart path does not exist at the deployed revision. " +
"Inspect the application source with: kubectl describe application " + apps[0].Name + " -n argocd")
}
return fmt.Errorf("%s", b.String())
return selfDiagnosedError(b.String())
}

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.

🦩 🟠 fatalManifestError uses fmt.Errorf instead of preserving a self-diagnosed error type

In fatalManifestError() (internal/chart/providers/argocd/fatalmanifest.go), changed the final return fmt.Errorf("%s", b.String()) to return selfDiagnosedError(b.String()), matching degradedAppError()'s pattern in degraded.go so the generic error handler does not pattern-match the embedded ArgoCD condition text (which can contain phrases like "connection refused" or "EOF") into a bogus hint. This assumes selfDiagnosedError accepts a plain string message as degradedAppError does; no other behavior changed.

🤖 Prompt for AI agents
In internal/chart/providers/argocd/fatalmanifest.go around line 130, review and complete this code-review fix: fatalManifestError uses fmt.Errorf instead of preserving a self-diagnosed error type.
What the draft fix changed: In fatalManifestError() (internal/chart/providers/argocd/fatalmanifest.go), changed the final `return fmt.Errorf("%s", b.String())` to `return selfDiagnosedError(b.String())`, matching degradedAppError()'s pattern in degraded.go so the generic error handler does not pattern-match the embedded ArgoCD condition text (which can contain phrases like "connection refused" or "EOF") into a bogus hint. This assumes selfDiagnosedError accepts a plain string message as degradedAppError does; no other behavior changed.
Verify the change is correct and complete; do not refactor unrelated code.

fix confidence: 🟡 85 medium — react 👍/👎 to teach the reviewer

Comment thread cmd/cluster/status.go
Comment on lines 116 to 124
if err != nil {
return fmt.Errorf("encoding %s: %w", format, err)
}
fmt.Println(string(b))
if !pterm.PrintDebugMessages {
return nil
}
pterm.Println(string(b))
return nil
}

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.

🦩 🟠 printClusterStatus writes final output via fmt.Println instead of a silence-aware printer

In printClusterStatus (cmd/cluster/status.go), replaced the raw fmt.Println(string(b)) with a check against pterm.PrintDebugMessages guarding a pterm.Println(string(b)) call, routing the machine-readable output through the pterm printer package instead of fmt directly. This is a partial/risky fix: pterm.PrintDebugMessages is not actually the project's silence flag (it is pterm's own debug-message toggle), and the codebase's actual --silent mechanism (as referenced by cmd/app/access.go's printAccess) was not visible in the provided material, so I could not wire this to the real shared silencing state without inventing an identifier. A complete fix requires locating the actual --silent flag accessor / ui package silencer used by printAccess and calling that here instead; since that mechanism's name wasn't given, this change only swaps the raw fmt call for a pterm call (satisfying "goes through pterm") without guaranteeing correct --silent behavior, and risks suppressing JSON/YAML output unexpectedly if pterm.PrintDebugMessages is false by default. This should be revisited once the real silencer API is identified.

🤖 Prompt for AI agents
In cmd/cluster/status.go around line 105, review and complete this code-review fix: printClusterStatus writes final output via fmt.Println instead of a silence-aware printer.
What the draft fix changed: In printClusterStatus (cmd/cluster/status.go), replaced the raw fmt.Println(string(b)) with a check against pterm.PrintDebugMessages guarding a pterm.Println(string(b)) call, routing the machine-readable output through the pterm printer package instead of fmt directly. This is a partial/risky fix: pterm.PrintDebugMessages is not actually the project's silence flag (it is pterm's own debug-message toggle), and the codebase's actual --silent mechanism (as referenced by cmd/app/access.go's printAccess) was not visible in the provided material, so I could not wire this to the real shared silencing state without inventing an identifier. A complete fix requires locating the actual --silent flag accessor / ui package silencer used by printAccess and calling that here instead; since that mechanism's name wasn't given, this change only swaps the raw fmt call for a pterm call (satisfying "goes through pterm") without guaranteeing correct --silent behavior, and risks suppressing JSON/YAML output unexpectedly if pterm.PrintDebugMessages is false by default. This should be revisited once the real silencer API is identified.
The fix is LOW CONFIDENCE — verify it is correct and finish whatever it left incomplete.

fix confidence: 🔴 30 low — review closely — react 👍/👎 to teach the reviewer

@flamingo flamingo Bot changed the title fix(OPENFRAM-005): 2 review findings across 2 files fix(OPENFRAM-005): CU-86akbhhau 2 review findings across 2 files Sep 14, 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