Skip to content
open tomato/ rafa
GitHub
rafa pages
  1. rafa
  2. rafa next

rafa next

The shortcut workflow: read where the project stands, propose the one next step, and run that subject action on a yes.

rafa next reads the project once (the running loops, the branch and its base, the plans and their trackers, the open pull request and its checks, and the roadmap), prints where it stands on one line and the one next step on the next, and on a yes runs that step. Then it reads the project again and proposes what follows. It is a workflow over other subjects: each step calls the subject action that does it, with that action's own guards and questions.

Spends: 🪙 when the step it runs starts a session: its plan step runs rafa plan create, and start and resume run rafa loop start. Needs: see Prerequisites; a board for the plan, unblock and ready steps.

What it proposes, in order

rafa next checks these situations top to bottom and proposes the step of the first one that is true:

#WhenStepRuns
1a loop of this project is runningnonestops: nothing to do while it runs
2you are on the base branch and it is behind its remotesyncfast-forwards the base
3on a plan branch whose checklist holds a blocked taskresumerafa loop start --plan=<plan>
4on a plan branch whose checklist holds an open taskresumerafa loop start --plan=<plan>
5the branch's pull request is still settlingwaitrafa pr wait <n>
6that pull request is red, or conflictstriagerafa pr triage <n>
7it reports no check at all, and mergesmerge-uncheckedrafa pr merge <n> --skip-checks, which asks its own question
8it is green and mergesmergerafa pr merge <n> --yes
9on the base, a plan has no run and no branch yetstartrafa loop start --plan=<plan> --create-branch
10the roadmap's next line is ready and waits on nothingplanrafa plan create --next
11that line is blocked (labels mode only)unblockrafa issue unblock <n>, which re-reads the blockers and takes spec:blocked off once they have all closed
12that line is not marked readyreadyrafa issue ready <n>, always asked
13none of the abovenonenothing left to do

After a merge, while fragments wait on the base and fold into a version, it proposes settle, which runs rafa release settle. With --roadmap, two more steps follow a blocker into another epic: hop moves there with rafa switch, and home comes back once the loop has run (Epics and boards).

How rafa next chains steps, by default asking before each one.
How rafa next chains steps, by default asking before each one.100%
NOTE

The table and the diagram show the default sequence, the most common case. Workflows become configurable before 1.0, once workflow config lands (#71, #119). The config shape is [TBD: the workflow config shape].

Asking, and not asking

rafa next asks before every step. It stops when you answer no, when a step fails, when there is nothing to run, and once a loop has started. --dry-run prints the two lines and stops, and so does a run with no terminal and no --yes, since nobody can answer.

--yes names the steps to run without asking, as a comma list, and stops at the first step the list leaves out. ready and merge-unchecked are always asked and cannot be listed. For example, rafa next --yes=sync,plan brings the base up to date and makes the next plan, then stops before the loop.

NOTE

In the target layout this code lives in the private package rafa-run, bundled into @open-tomato/rafa (Repository layout). In 0.47.0 it is already a package, @open-tomato/rafa-run in packages/rafa-run, but only as a facade: it re-exports this code from the root package's src/, where the files still live until their move. You install and type the same either way. [verify: the release the move lands in]

Reference: rafa next

Say where the project stands, propose the one next step, and run it on a yes.

rafa next [--dry-run] [--roadmap] [--claim-ahead] [--yes=<string>]

Reads the project once — the running loops, the branch and its base, the plans and their trackers, the open pull request and its checks, and the roadmap — and prints where it stands on one line and the one thing to do about it on the next. On a yes it runs that action by calling the command that does it, then reads the project again and proposes what follows. It stops when the answer is no, when an action fails, when there is nothing to run, and once a loop has started. A working tree with changes to tracked files and a pull request provider that cannot be asked are reported in place of a proposal. A pull request no check has reported on is proposed as rafa pr merge <n> --skip-checks, which asks its own question after the warning it prints, so rafa next asks none before it. --dry-run prints the two lines and stops, and so does a run with no terminal to answer on and no --yes, since there is nobody to put the question to. After a merge, while fragments wait on the base and fold into a version, it proposes rafa release settle, which runs unasked only under a --yes list naming settle. With --roadmap it follows one blocker into another epic or board, works it up to its pull request and comes home, halting where that blocker is blocked in turn, and with --claim-ahead as well its plan step also claims the next line of the board. With --output=json the steps and why the chain stopped are the data of the terminal result event, and under --roadmap the hops that ran as well.

Spends: 🪙 when the step it runs starts a session: plan runs rafa plan create and its one planning session, and start and resume run rafa loop start and the sessions of its loop

FlagType and defaultWhat it does
--dry-runbooleanPrint where the project stands and what to do about it, and stop without asking or running it. A run with no terminal to answer on and no --yes does this whether or not the flag is typed.
--roadmapbooleanFollow one blocker into another epic or board and come home: where the walk stops at an issue blocked by one in another epic, or at an epic with no line left, propose the hop there, pass --roadmap to plan create and loop start, and go home once the loop has run. A blocker that is itself blocked halts with the chain instead, and a pull request whose owner has not approved is not merged.
--claim-aheadbooleanWith --roadmap, pass --claim-ahead to plan create, so the plan step also claims the line after the one it picks on the same board, both claims or neither, as claims.ahead: allow does. Refused without --roadmap.
--yesstringRun the actions named without asking, as a comma list of action ids, and stop at the first action the list leaves out. Bare it names sync, wait, unblock, plan, home. The ids are sync, resume, wait, triage, merge, settle, start, plan, unblock, hop, home; a list naming ready or merge-unchecked, which are always asked, or a word that is no id at all is refused.

Examples:

  • rafa next: Proposes the one next step and asks before each one it runs.
  • rafa next --dry-run: Prints where the project stands and what comes next, and runs nothing.
  • rafa next --yes=sync,plan: Fast-forwards the base and creates the next plan unasked, stopping at any other step.
  • rafa next --roadmap --yes=hop,plan,start,home: Hops to the epic holding the blocker, plans and runs it, and comes home unasked.
  • rafa next --roadmap --claim-ahead: Plans the next line and claims the one after it too, both claims or neither.

Output formats: text, json.