Skip to content

fix(OPENFRAM-001): resumeHintError type is duplicated verbatim between eks and gke packages - #352

Draft
flamingo[bot] wants to merge 1 commit into
mainfrom
ai-fix/openfram-001-122ac11b-91c75a3f
Draft

fix(OPENFRAM-001): resumeHintError type is duplicated verbatim between eks and gke packages#352
flamingo[bot] wants to merge 1 commit into
mainfrom
ai-fix/openfram-001-122ac11b-91c75a3f

Conversation

@flamingo

@flamingo flamingo Bot commented Aug 24, 2026

Copy link
Copy Markdown

Closes findings from rule OPENFRAM-001 — resumeHintError type is duplicated verbatim between eks and gke packages.

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 🔴 35 low — review closely resumeHintError type is duplicated verbatim between eks and gke packages internal/cluster/providers/eks/resumehint.go:1

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: 91c75a3f-4f00-4dd6-9120-a00ab67ad34d

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.

@flamingo flamingo Bot left a comment

Copy link
Copy Markdown
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

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

@@ -1,21 +1,21 @@
package eks

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

🦩 🟠 resumeHintError type is duplicated verbatim between eks and gke packages

Replaced the duplicated resumeHintError struct and withResumeHint function in internal/cluster/providers/eks/resumehint.go with a type alias (type resumeHintError = resumehint.Error) and a thin delegating function that call into a new shared package internal/shared/resumehint. This directly targets the duplication finding by making eks (and, if mirrored, gke) reference one canonical implementation instead of copy-pasted code. UNVERIFIED/RISK: the referenced package internal/shared/resumehint does not exist in the repo yet and is not created here (this fix is confined to the single file internal/cluster/providers/eks/resumehint.go per the task scope) — this file will not compile until that shared package (exporting Error with err/hint fields and matching Error(), Unwrap(), ResumeHint() methods, plus a WithResumeHint(err error, hint string) error constructor) is added, and until gke/resumehint.go is updated to use the same alias to actually eliminate the duplication. A complete fix requires creating that shared package and updating both provider files together; since only this file could be changed, the change here is a real but incomplete step toward resolution and should be treated as a draft requiring the companion shared-package addition before merge.

🤖 Prompt for AI agents
In internal/cluster/providers/eks/resumehint.go around line 1, review and complete this code-review fix: resumeHintError type is duplicated verbatim between eks and gke packages.
What the draft fix changed: Replaced the duplicated `resumeHintError` struct and `withResumeHint` function in `internal/cluster/providers/eks/resumehint.go` with a type alias (`type resumeHintError = resumehint.Error`) and a thin delegating function that call into a new shared package `internal/shared/resumehint`. This directly targets the duplication finding by making eks (and, if mirrored, gke) reference one canonical implementation instead of copy-pasted code. UNVERIFIED/RISK: the referenced package `internal/shared/resumehint` does not exist in the repo yet and is not created here (this fix is confined to the single file `internal/cluster/providers/eks/resumehint.go` per the task scope) — this file will not compile until that shared package (exporting `Error` with `err`/`hint` fields and matching `Error()`, `Unwrap()`, `ResumeHint()` methods, plus a `WithResumeHint(err error, hint string) error` constructor) is added, and until `gke/resumehint.go` is updated to use the same alias to actually eliminate the duplication. A complete fix requires creating that shared package and updating both provider files together; since only this file could be changed, the change here is a real but incomplete step toward resolution and should be treated as a draft requiring the companion shared-package addition before merge.
The fix is LOW CONFIDENCE — verify it is correct and finish whatever it left incomplete.

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

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