fix(OPENFRAM-001): resumeHintError type is duplicated verbatim between eks and gke packages - #352
fix(OPENFRAM-001): resumeHintError type is duplicated verbatim between eks and gke packages#352flamingo[bot] wants to merge 1 commit into
Conversation
…n eks and gke packages
| @@ -1,21 +1,21 @@ | |||
| package eks | |||
There was a problem hiding this comment.
🦩 🟠 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
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.
internal/cluster/providers/eks/resumehint.go:1What 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-a00ab67ad34dMerging 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.