spp next
spp next <epic> [--json] [--resume] [--running <tickets>] prints the build's next actions, one per line. The build loop is: run
spp next, do what it says, run it again. It reads the Epic's preconditions, its state, CI on open pull requests,
the gate's verdict history and the pull request to the base branch from GitHub, never from a session list; the one
input that comes from the caller is --running. With --json it prints NextActions.
--running takes the comma-separated tickets (numbers in the Epic's repo, owner/repo#N or issue URLs) the build
started a worker on, until that worker reports back. Each is in flight in any state, landed included: never
dispatched, gated or sent to a fix round again, nor any fix pull request of its, main-gate waits for it, and a
ready ticket that overlaps one that has not landed is held. Without it nothing is held that way, so a new
session, or a restart after spp unclaim, dispatches them.
With --resume, for the first call of a run, a Sub-issue that is claimed, has no open or merged pull request and
no assignee comes back as a hand-back action with the reason worker lost: the session that started its worker
is gone, so the user decides whether to hand it back or start a worker again. Without it such a Sub-issue is in
flight.
Functions¶
run()¶
Prints the build's next actions.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
args |
string[] |
The Epic (an issue number in the current repo or an issue URL), --json for the NextActions shape, --resume to report each lost worker as a hand-back, and --running with the tickets the build started a worker on and whose worker has not reported back. |
Returns¶
Promise\<number>
0 when it printed the actions, a failed precondition included (as a preflight action); 2 on a usage
error, with the usage on stderr. A gh error exits 1 with the reason on stderr.
Example¶
Variables¶
USAGE¶
The usage text spp next --help prints.
usage: spp next <epic number | issue URL> [--json] [--resume] [--running 101,owner/repo#7]
Prints the next actions: preflight, branch, dispatch, gate, fix, hand-back, merge, wait, main-gate, close or stuck.
--resume, on a run's first call, hands back each claimed Sub-issue with no pull request and no assignee as "worker lost".
--running names the tickets the build started a worker on, until that worker reports back; each is in flight in any
state: neither it nor its fixes are dispatched, gated or fixed again, main-gate waits, and a ready ticket that overlaps
one is held.
Type Aliases¶
NextActions¶
The build's next actions: the --json shape of spp next.
Properties¶
| Property | Type | Description |
|---|---|---|
actions |
Action[] |
The actions, in the order to take them. |
ActionKind¶
type ActionKind =
| "preflight"
| "branch"
| "dispatch"
| "gate"
| "fix"
| "hand-back"
| "merge"
| "wait"
| "main-gate"
| "close"
| "stuck";
What the build does next: fix a precondition, cut the branch, start workers, gate, fix, hand back, merge, wait, gate the pull request to the base branch, close the Epic, or stop as stuck.
Action¶
One next action of the build.
Properties¶
| Property | Type | Description |
|---|---|---|
kind |
ActionKind |
What to do. |
tickets? |
string[] |
The tickets it is about, for dispatch, gate, fix, hand-back and merge; a Fix pull request's is its Sub-issue, when attributed. |
pr? |
string |
The pull request URL it is about. |
panel? |
boolean |
On main-gate: whether the Epic is large enough for the review panel. |
reason |
string |
Why, in a sentence. |