fix(ci): per-SHA reset and dispatch race fix in CI poller - #59
Merged
Conversation
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.
Context
CI escalation fired on the same poll that dispatched the agent, killing a 43-second run before it could fix anything (RSM-3739, PR #57). The lifetime
ci_retry_countalso stuck issues inescalatedacross new commits.TL;DR
Reset CI dispatch/rerun history per head SHA, protect in-flight dispatches from being escalated, and stop
poll_errorfrom clobbering the state-machine status.Summary
dispatched_shas,rerun_attempted_shas, downgradeescalated→watching. Lifetimeci_retry_countis preserved; only green resets it.handle_ci_failureso a SHA already indispatched_shasshort-circuits to:already_handledbefore the escalation branch, preventing the next poll from killing the in-flight agent.poll_error_attrsno longer writesstatus: "poll_error"— only:error,:consecutive_errors,:next_poll_at. Statuses likeescalated/rerun_requestedsurvive a transient GitHub error.docs/configuration.mdto describe the new retry semantics.Alternatives
ci_retry_counton every new SHA — rejected: escalation would never fire when an agent rapidly pushes new broken commits.retry_count + 1 == max_retries(skip the last dispatch instead of killing it) — rejected: drops one dispatch attempt and is harder to reason about than "protect the SHA you just dispatched."Test Plan
make allmix test test/symphony_elixir/ci_poller_test.exs(18 tests passing locally)