Repository navigation
feat(report)!: a repository that changed under the run is stale and requeues - #275
Merged
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
count-patchula | f97f44e | Commit Preview URL Branch Preview URL |
Nov 12 2026, 01:51 AM |
…equeues A run that loses a race with the repository is no longer a failure. When the default branch, an obsolete pull request or a published pull request's head changes under the run, the repository's report status is `stale` (new; report schemaVersion 7, actions 3) instead of `error`, and a raced pull request action is `stale` instead of `error`. A repository whose branches went stale at publish is `stale` too, where it was `complete`. `patchula run` exits 5 for it — so does the base race that previously exited 0 — and the Action fails the step so the next scheduled run retries it. The server runs it again a minute later without counting a failure, and after three such runs in a row treats the next as a failure. A stale run no longer takes the repository's schedule turn. The repository API's `status` can be `stale`.
sweepies
force-pushed
the
feat/stale-repositories
branch
from
November 12, 2026 01:39
fed20a3 to
c46edd1
Compare
Merged
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.
A run that loses a race with the repository is no longer a failure: the repository is
stale, and the server reruns it.Report (breaking: schemaVersion 6 → 7, actions 2 → 3, no reading of old versions)
Status::Stale("stale") for a repository that changed under the run;PullRequestStatus::Stalefor the two publish races.actions, and neverdryRun; a stale PR action needs a reason. The engine's interim lookup-phase report is checked before actions attach (a control or inventory read can race then), and the full check runs onfrom_json/run_at.staleexactly when a step raced, or a branch or PR action isstale, and nothing failed.erroroutranks it.Engine
StepFailure::StalewithFrom<patchula_update::Error>(Raced→Stale, anything else →Repo) at every step that maps an update error, the inventory read included. Publish and auto-merge share onefailure_status.completerepositories record their schedule turn, so a stale run keeps the window for its rerun.Server
BatchOutcome::reportrequeues onStatus::Stale;patchula_update::needs_requeueis deleted. The log readsrepository changed during the run; requeued. The cap from fix(server): consecutive requeues are bounded #274 still bounds a race that persists./api/v1status(and a PR's action status) can bestale, documented, with no path bump.CLI and Action
patchula run(andrun --remote) exits 5 when no repository errored and at least one is stale. An error still exits 1. This includes the base-moved race, which exited 0.stale: <reason>per repository. The Action already fails the step on any non-zero exit (guide/github-actions.mdsays so for 5), so a stale run is visible and the next scheduled run retries it.Tests
stalewith the race's text, no error action and no schedule turn, then a rerun that completes. Five of these races had no test before.a_stale_run_keeps_the_schedule_window_for_its_rerun: a raced run inside a single-time window records nothing, and the rerun a few seconds later still creates the branch.error.needs_requeueassertions, the two published-head cases (error→stale), the server's stale-base test, and the report test that rejected a stale PR action.Docs:
reference/report.md(v7),guide/server.mdx,guide/github-actions.md,internals/engine.md,reference/cli.mdand the help snapshot.Behaviour change: when the default branch, an obsolete pull request or a published pull request's head changes under the run, the repository's report status is
staleinstead oferror(orcomplete, for the base race), and a raced PR action isstale.patchula runexits 5 for it. The server reruns it a minute later without counting a failure, and treats the fourth such run in a row as a failure. A stale run no longer takes the repository's schedule turn.Follow-up (not in this PR): the
Actionworkflow's dry run runs the latest release against this checkout'sPatchulaConfig.pkl, so it fails whenever main has removed a config field since that release (v0.8.1 still requiressubmodules). It only runs whenaction.ymlortests/action/**change, and clears at the next release.