fix(operator): defer workflow reconciliation until runner is ready#1487
Merged
mergify[bot] merged 2 commits intomainfrom Apr 30, 2026
Merged
fix(operator): defer workflow reconciliation until runner is ready#1487mergify[bot] merged 2 commits intomainfrom
mergify[bot] merged 2 commits intomainfrom
Conversation
Workflow reconciliation was attempted during the Pending phase before the runner pod existed, causing DNS failures that were silently discarded. The observedGeneration was then set, preventing any retry in the Running phase. Move workflow reconciliation to the Running phase where the runner HTTP endpoint is reachable. Add NeedsWorkflowReconciliation check and ReconcileWorkflow to retry failed or missing workflow application with 5-second backoff. Also fix swallowed errors in ReconcileSpecChanges and add requeue on spec reconciliation failure. Closes #1486 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
✅ Deploy Preview for cheerful-kitten-f556a0 canceled.
|
Contributor
Merge Queue Status
This pull request spent 15 seconds in the queue, including 2 seconds running CI. Required conditions to merge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
reconcileActiveWorkflowWithPatch()was called before the runner pod existed, causing DNS failures that were silently discarded via_ =NeedsWorkflowReconciliation()check detectsWorkflowReconciled != Trueand triggersReconcileWorkflow()with 5-second backoff requeue_ = statusPatch.Apply()with proper error logging inReconcileSpecChanges, and add requeue on spec reconciliation failureRoot Cause
Three-part failure chain (as described in #1486):
reconcileActiveWorkflowWithPatch()attempted HTTP POST to runner before pod existed → DNS error_ = reconcileActiveWorkflowWithPatch(...))observedGenerationset despite failure, preventing Running phase from retryingChanges
handlers/sessions.goreconcileActiveWorkflowWithPatch()call from Pending phase; log repo reconciliation errorshandlers/reconciler.goReconcileWorkflow()for targeted workflow retry; fix_ = statusPatch.Apply()handlers/helpers.goNeedsWorkflowReconciliation()to detect unreconciled workflowshandlers/helpers_test.goNeedsWorkflowReconciliationcontroller/reconcile_phases.goreconcileRunning(); requeue onReconcileSpecChangesfailureTest plan
go build ./...passesgo vet ./...passesTestNeedsWorkflowReconciliation— 6 cases covering: no workflow, empty gitUrl, no conditions, True condition, False condition, missing conditionactiveWorkflow— verifyWorkflowReconciledbecomesTrueCloses #1486
🤖 Generated with Claude Code
🤖 Ambient Session