Repository navigation
Conversation
…, re-posts, one writer per environment) - --apply (a run or any action) refuses to start without ROLLOUT_DISCORD_WEBHOOK, before it reads anything. - A run fails when none of the environment's installed hosts in the plan has its deploy branch on the remote. The plan now says whether each host is installed: lib.mkFleet's host.json, and true for any other host. - A cluster API that doesn't answer counts as the host in flight not being back yet, on its last state's budget, then halts and posts; with nothing in flight the run fails without moving anything. - Halts and long waits post again every budgets.repost minutes (240). - write_state stops without pushing when the environment's own state file changed since the run read it; another environment's change is still rebuilt on top. - Fingerprints are evaluated --eval-batch hosts per nix eval (10). - ROLLOUT_RUN_URL sets the notices' run link. - approveEvery: listed later environments take only an approved commit.
There was a problem hiding this comment.
Summary
The promoter is hardened in several places: --apply now requires the Discord webhook, an unreachable cluster API becomes a wait/halt instead of an error, halts and long waits re-post, state writes are compare-and-swapped per environment, fingerprint evaluation is batched, and the plan gains approveEvery. The core logic and the new tests line up; I found two gaps in the new installed-host/deploy-branch handling.
Issues
- 🟡
rollout/promoter/promote.py:699— one installed host's deleted deploy branch still converges silently — see the thread on that line - 🟡
rollout/promoter/promote.py:698— an environment with no installed hosts records a stale target, not a quiet no-op — An environment whose hosts are allinstalled: falseskips this guard but then goes throughchoose_target→new_roll, which posts "Rolling …" and saves a target, so it is not the quiet no-op the change describes. When the hosts are later installed their deploy branches sit at the newer install commit, so the first real roll keeps that stale target and halts on provenance ("isn't a fast-forward of branch") until someone abandons it.
Reviewed @ b7b82390
Red pandas make a twittering "huff-quack" — the original microblogging.
| # host lib.mkFleet hasn't installed yet has none, and a fleet's | ||
| # scheduled run covers its environments whose hosts all wait to be. | ||
| installed = [h for h in self.hosts if self.plan["hosts"][h].get("installed", True)] | ||
| if installed and not any(refs[h] for h in installed): |
There was a problem hiding this comment.
🟡 one installed host's deleted deploy branch still converges silently
The guard fails the run only when none of the installed hosts has its deploy branch. If one installed host's branch is deleted (or unreadable) while its siblings' exist, logic.plan_step drops that host from migrated and the environment still converges with "every host runs the target" and stages the commit for the next environment, so production promotes a commit that host never ran — the same silent fail-open this change closes, for the partial case.
There was a problem hiding this comment.
Agreed, fixed in 3428735. fleet install pushes a host's deploy branch before it installs it, so a host whose host.json says it's installed and that has no branch lost it, or the token can't read it. The run now fails and names it, even when its siblings have their branches.
The plan's installed is now true or false from lib.mkFleet's host.json, and null for a host outside lib.mkFleet. Such a host without its branch may just not be migrated yet, so it keeps the "none of them has one" rule.
Tests: test_an_installed_host_without_its_deploy_branch_fails_the_run (fails with the new check disabled) and test_a_host_the_plan_cant_tell_is_installed_may_lack_its_deploy_branch.
There was a problem hiding this comment.
Addressed by 3428735. The guard is no longer all-or-nothing: rollout/promoter/promote.py:703 collects every host whose plan entry is installed: True and has no branch, and step() fails naming it (704–707) before the earlier "none of them has one" rule at 709–716, so a deleted or unreadable branch on one installed host now stops the run even when its siblings' branches exist. That matches the fleet install ordering, and lib/rollout-plan.nix:122 now carries installed = ... or null so hosts outside lib.mkFleet aren't mistaken for installed. Both new tests cover the split (rollout/promoter/test_promote.py:543 for an installed host failing, :555 for a host the plan can't tell about), and the README was updated to separate the two cases.
The remaining behaviour for installed: null hosts (no branch → skipped, converge as before) is now an explicit, documented choice rather than an oversight, so my finding no longer holds.
@ 3428735f
lib.mkFleet's fleet install pushes a host's deploy branch before it installs it, so a host host.json calls installed that has no branch lost it, or the token can't read it, and converging without it would stage a commit it never ran. The plan's installed is now true or false from host.json and null for any other host, which may not be migrated yet: those still fail the run only when none of them has its branch.
There was a problem hiding this comment.
The promoter now fails closed: applying runs require a Discord webhook, an unreachable cluster API becomes a wait/halt rather than an early error, halts and long waits re-post, state writes detect a competing writer, fingerprints are batched, and approveEvery adds explicit approval for later environments. The new commit closes the remaining gap from the previous review: a lib.mkFleet host marked installed but missing its deploy branch now fails the run instead of converging silently. I found no new code defects; minor note: the PR body still says non-fleet hosts count as installed true, while the final code and README treat them as null (unknown).
Reviewed 9 changed file(s) @ 3428735f — no blocking issues found.
Red pandas make a twittering "huff-quack" — the original microblogging.
The promoter could fail quietly in several ways. This makes each one fail closed, in today's GitHub Actions setup and for any other caller that runs it on a timer.
--apply. An applying run or action refuses to start withoutROLLOUT_DISCORD_WEBHOOK, before it reads anything. Before,notify()skipped posting when it was empty, so hosts moved and nobody heard. Dry runs andgateare unchanged.installedfor each host: true or false fromlib.mkFleet'shost.json, null for any other host.fleet installpushes it first. When it's missing, the run fails and names it, even when its siblings have theirs.lib.mkFleetenvironment whose hosts all wait to be installed stays a quiet no-op. That matters because the scheduled matrix runs every promoter environment once any one has an installed host.load_clusterraised before the run decided anything, so a single server that didn't come back after its reboot made every run error, and none halted or posted.budgets.repostminutes (default 240), recorded ashalted.postedAtandwait.notifiedAt. Before, each posted once.write_statestops without pushing when the environment's own state file changed since the run read it, which means a second run of the same environment wrote it. A change to another environment's file is still rebuilt on top. Before, it rebuilt on top in both cases and dropped the other run's move.--eval-batchhosts pernix eval(default 10), so a large fleet isn't one big process.ROLLOUT_RUN_URL, with the GitHub Actions run as the fallback.approveEvery(default[ ]). The listed later environments take only a commit approved with--action approve, the newest such one, which brings the commits before it. The plan refuses an environment that isn't after the first.Tested: new tests in
test_logic.pyandtest_promote.pyfor each point. Each fails on the previous code; the controls pass on both. Therollout-plancheck covers the new keys and the settings it refuses.promoter(120 tests),rollout-plan,formatting,fleet-example,fleet-scripts,fleet-rules,workflowsandcipass.A fleet will notice on its next lock bump:
nix evalcalls.The plan JSON gains
installed,approveEveryandbudgets.repost. That's fine forlib.rolloutPlan, which comes from the same lock as the promoter; a hand-written plan needs the last two.Worth reviewing:
logic.plan_step);Repo.write_state;promote_target's approval walk.Not verified: real kubectl error texts, and
nix eval's memory at the default batch of 10.