Repository navigation
feat(queue): keep waiting landings, and list them - #97
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
4c854f1 to
ae1ba2c
Compare
ae1ba2c to
e23fe66
Compare
A landing that conflicted or lacked evidence only said so to whoever ran it. Nothing remembered it, so nobody else could see what waited on a target, or why. Each landing that waits is now kept durably in its target's queue directory, `queue/<target id>/change-<id>` or `target-<target id>`, replacing the last attempt's, and forgotten once it lands or the target turns out to have it already. The file holds what lands, what the evidence must be about, and either the requirements missing or the `core.conflict` statement, whose payload lists the paths. A stack that waits is kept whole, as the landing of the change it was asked for, so retrying it lands the rest once the change it waits on can. `Queue::pending` lists every landing that waits, on every target, reading without the locks: a landing that ends while it reads is skipped.
e23fe66 to
c18ad21
Compare
A landing that conflicted or lacked evidence only said so to whoever ran it. Nothing remembered it, so nobody else could see what waited on a target, or why.
Each waiting landing is now kept durably in its target's queue directory, replacing the last attempt's, and forgotten once it lands or the target turns out to have it already. The file holds what lands, what the evidence must be about, and either the missing requirements or the
core.conflictstatement, whose payload lists the paths.A stack that waits is kept whole, as the landing of the change it was asked for, so retrying it lands the rest once the change it waits on can.
Queue::pendinglists every waiting landing on every target, reading without the locks: a landing that ends while it reads is skipped.Note
Written by Claude Opus 5.5 in Claude Code (via T3 Code)
Queue API (
apps/origin-src/src/queue/mod.rs)pub fn pending(store: &Store<P>) -> Result<Vec<Pending>, StoreError>toQueue.pendinglists waiting landings across all targets, sorted by target.pendingtakes no locks. It skips lock and temporary files.land_changeandland_targetcallsession.forgetbefore returningUnchanged.Pending record format (
apps/origin-src/src/queue/pending.rs, new)Pendinglanding as versioned text. The record holds the header, target, proposal, subject, and either missing requirements or a conflict statement.Nonefor missing, malformed, or unknown required fields.Session persistence (
apps/origin-src/src/queue/session.rs)pending_pathmaps a change tochange-{id}and a target totarget-{id}under the target queue directory.keepwrites the pending file durably. It replaces any previous file for that landing.fn forget(&self, proposal: &Proposal) -> Result<(), StoreError>. It removes the pending file and syncs the parent directory. A missing file counts as success. Other I/O errors are returned.forgetwhen a revision is unchanged or after an acceptance is appended.keepbefore returning for missing evidence or conflicts.Tests (
apps/origin-src/src/queue/tests/)changes.rs: Round-trips pending landings for evidence and conflict blockers. Rejects the legacyorigin pending 2encoding. Checks that a stack waiting on CI evidence is stored as one pending landing. After evidence is issued, both changes land, with the upper change as the proposal, and no pending entries remain.conflicts.rs: Checks that the pending queue holds the blocked landing. After a new revision merges and lands, checks that the queue is empty.evidence.rs: Checks that the pending queue holds the blocked landing while evidence is missing. After valid evidence lands the change, checks that the queue is empty.mod.rs: Replaces theTreeIdandPolicyErrorimports withTreeandRequirement.Scope of change: 7 files, +259/−11 lines.