beady-eye v0.23.0
Order up: in beady-eye 0.23, a merged pull request frees the bead waiting on it
This post is more than a year old. It describes beady-eye v0.23.0; the latest release notes say what has changed since.
beady-eye 0.23.0 brings a new command, bdi gates. Once a
minute, by default, it finds every open gh:pr gate in the
projects bdi reads, asks GitHub how each one's pull request stands, and closes the gate when the pull
request has merged. The bead that gate was holding back is ready, and
nobody had to run bd gate resolve.
brew upgrade codeforbreakfast/tap/bdi
# or
cargo install beady-eye
bdi gates finds #42 merged and closes the
gate, and the next look at the tree shows it ticked off.
Read the demo as text
▾ spoon ✓ 7s ago 1/8 3 agents
├── ○ spoon-1 The caff takes card payments 1/6
│ ├── ◐ .1 Wire the card reader to the till ◍ wK:p2 · working
│ ├── ◐ .3 Refund a cold bacon roll ◍ wK:p5 · idle
│ ├── ○ .2 Print the VAT line on the receipt 0/2
│ │ └┄┄ ○ spoon-9t3 Gate: gh:pr 42 ⇢ till #42
│ └── ✓ .4 Price the menu in pence
└── ○ spoon-2 The tea timer forgets the second sugar 0/2
└── ◐ .1 Count sugars per cup, not per order ◍ wK:p3 · working
reading spoon, where bdi was started --all-projects reads every project
─────────────────────────────────────────────────────────────────────────────────────────────
no pane · nobody is working this bead
a all ? keys / find q quit
spoon $ bdi
spoon $ bdi gates
bdi gates: settling the gh:pr gates of 1 project, for every owner's repositories, every 60s
greasy-spoon/till#42 merged: spoon closed gate spoon-9t3
^C
spoon $
▾ spoon ✓ 8s ago 2/8 3 agents
├── ○ spoon-1 The caff takes card payments 2/6
│ ├── ◐ .1 Wire the card reader to the till ◍ wK:p2 · working
│ ├── ◐ .3 Refund a cold bacon roll ◍ wK:p5 · idle
│ ├── ○ .2 Print the VAT line on the receipt 1/2
│ │ └┄┄ ✓ spoon-9t3 Gate: gh:pr 42 ⇢ till #42
│ └── ✓ .4 Price the menu in pence
└── ○ spoon-2 The tea timer forgets the second sugar 0/2
└── ◐ .1 Count sugars per cup, not per order ◍ wK:p3 · working
reading spoon, where bdi was started --all-projects reads every project
─────────────────────────────────────────────────────────────────────────────────────────────
no pane · nobody is working this bead
a all ? keys / find q quit
The view draws each gh:pr gate under the bead it blocks,
linked to its pull request, so the gate under the receipt reads
⇢ till #42. A gate
that cannot name its pull request is still drawn, with a note saying
what it is missing.
Putting a bead on hold
When the pull request opens, record the wait as a gate on its number.
The gate copies repo from the bead it blocks, and where the
bead has none, you give the gate one yourself:
gate=$(bd gate create --type=gh:pr --blocks spoon-1.2 \
--await-id=42 --json | jq -r .id)
bd update "$gate" --set-metadata repo=greasy-spoon/till
Then leave bdi gates running under your service manager,
with gh signed in to an account that can see the
repositories. A pull request closed without merging leaves its gate
open, and the bead behind it gets one comment saying so. If a minute
is too long to wait, give it --listen and a webhook
secret, and GitHub's signed pull_request deliveries settle
a gate within seconds.
Two GitHub accounts in one kitchen? Run one bdi gates for
each, and give each its own config with [gates] owners
naming the owners whose repositories it settles. Every line it prints
is one gate closed, one bead told or one failure, and a failure stops
nothing: the next look tries again. The
configuration guide
has a systemd unit ready to drop in.
Tickets checked every sixty seconds. Order up.