Fix result CR status not updated on retry#41
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @jameswnl. Thanks for your PR. I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
e40f953 to
0ce6363
Compare
When a proposal step is retried and the result CR name collides with an existing one, createIdempotent previously returned nil on AlreadyExists, leaving stale failure data in the CR. This caused the AnalysisResult to show a failed status even when the retry succeeded. Now on AlreadyExists, the existing CR is fetched and its status is patched with the new result data (options, actions, checks, conditions, sandbox info, failure reason) while preserving the original metadata and spec. - Use comma-ok type assertions in copyResultStatus for safety - Add test for the core retry scenario: stale failure data overwritten with success data, verifying FailureReason is cleared Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0ce6363 to
d4d2a37
Compare
Summary
resultCRName),createIdempotentsilently returnednilonAlreadyExists, leaving stale failure data in the CRAnalysisResult(and other result types) to show failed status/conditions even when the retry succeeded — the proposal would showAnalyzed: True (Complete)but the result CR still contained the old failure reasonAlreadyExists, the existing CR is fetched and its status is patched with the latest result data (options, actions, checks, conditions, sandbox info, failure reason)Test plan
TestCreateIdempotent_AlreadyExistsupdated to verify status is updated (not skipped)go test ./controller/proposal/... -count=1🤖 Generated with Claude Code