Repository navigation
Conversation
A rule can queue a launch with stackOn: pr. The launcher starts the ticket's branch at that PR's head and writes a stack record into the clone's git config, which rules read as t.stack. Rules also get t.branch, Blocker.ticket and ctx.pr.of(t), and dispatch:build opens its PR against a --base branch the kickoff names.
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.
Purpose
When one ticket builds on another, its worker can't start until the other merges, because a worker's branch always starts from the default branch. This gives rules the capability to start a worker from another ticket's unmerged PR, and to remember where that branch began. That start point is the one fact needed later to move the branch onto the default branch. It decides nothing about when anyone should stack. With no rule using
stackOn, nothing changes.The launch receipt reads
ok: workspace w2, stacked on ENG-1 at 0adc9f1 (thrawn01/eng-1), andt.stackreads{parent: "ENG-1", forkPoint: "<full sha>"}from then on. This is thestacked-launchpiece of ENG-568's blueprint.pr.conflict,exemptandrules/stacking.tsare later pieces.Implementation
internal/stackrecordowns the stack record, two keys in the clone's git config (branch.<b>.dispatchStackParentanddispatchStackForkPoint), and the both-or-neither rule.Readmatches git's lowercased key names. A partial record reads as partial.Request.Stack(stack parent ticket, its branch, the head). On a brand-new branch only, it fetches the parent branch, writes the record, then creates the branch at the head. A failed write or switch ischeckout_failedwith the lease returned. A relaunch or an existing branch never writes or changes a record.replayandexplainsee the samet.stack.t.stack,t.branch,Blocker.ticket,ctx.pr.of(t)andqueueLaunch'sstackOn.ctx.pr.ofis undefined when dispatch read the PR and found none, and unknown when it didn't read it this cycle. Generated types, the scenario fixtures (ticket(id, { branch, stack }),unread("stack")), docs, the glossary entries and ADR 0004 are included.dispatch:buildstep 6 passes a kickoff's--base <branch>togh pr create.rules/stack.test.tsandstack_test.gocover the acceptance criteria throughdispatch tick,explainandreplaywith real git.Changes from build
HEADreproduces it) left a stacked branch with no record for good, because the next launch sees an existing branch. Not in the design file, which is a Linear document, so only noted here and on the ticket.Requestcarries the record besideBase. Shipped:Request.Stackholds the parent ticket, its branch and the head, and overridesBase, since the launcher needs the branch to fetch it and the record doesn't store it.stackOnmissing its ticket, branch or head, where the design says nothing.Verification
make cipasses (vet,go test -tags tests_slow ./..., shellcheck), and the slow suite passed twice more with-count=1. I disabled the record clear, and separately the lease return and the keep-the-record check, and each made its test fail.Checked by: a test-review agent against the acceptance criteria, three code-review agents (correctness, fit with the ticket, next reader), a skill review of
skills/build/SKILL.md, and a second correctness round on the fixes, which found nothing needing a change. Not run:make test-drift(it needs the installed treehouse, gh, herdr and Claude) and any eval, which the ticket says to skip. Left as is after the second round:Fixes ENG-594