NO-JIRA: skip duplicate Analysis stage in approve & upgrade flow#12
Conversation
|
Thanks for catching this @jrangelramos 🏆 the bug is real and the fix is correct for the However, there's a second unguarded caller of Rather than adding the same guard at every call site, could we move the dedup check into const existingStages = currentApproval.spec?.stages ?? [];
if (existingStages.some((s) => s.type === stageType)) return true; // already approvedThis makes |
b48613f to
c87396b
Compare
|
LGTM 👍 the idempotent guard in the hook looks great, thanks for moving it there @jrangelramos One small nit.... |
c87396b to
190d4b9
Compare
|
just dropped that! thanks |
|
@jhadvig could you PTAL? thanks |
190d4b9 to
d62271d
Compare
|
/hold |
|
wait for #15 to get merged |
Prevents adding a duplicate Analysis stage entry when one already exists in the AgenticRunApproval spec, avoiding a 409 conflict error. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
d62271d to
5cb010d
Compare
|
/title NO-JIRA: skip duplicate Analysis stage in approve & upgrade flow |
jhadvig
left a comment
There was a problem hiding this comment.
/lgtm
/approve
/verified by CI
|
@jhadvig: This PR has been marked as verified by DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jhadvig, jrangelramos The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@jrangelramos: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
/hold cancel |
|
/retitle NO-JIRA: skip duplicate Analysis stage in approve & upgrade flow |
|
@jrangelramos: This pull request explicitly references no jira issue. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
Summary
Duplicate value: {"type":"Analysis"}becauseapproveStage('Analysis')was called unconditionallyapproveStage, preventing the duplicate key API errorTest plan
approveStage('Analysis')normallyyarn testpasses (56/56)🤖 Generated with Claude Code