Repository navigation
feat(deploy): slice 3 — real systemd activation with health-check flip-back (#5766) - #7886
Merged
Merged
Conversation
…p-back (#5766) Implements the non-dry-run deploy/rollback paths left as refusals in slice 2, in the design §4.1 plan order: install the generation into the per-service profile (deploy-managed profile link; store-path artifacts also registered via nix-env --set on a parallel profile), write the unit, daemon-reload, restart only that unit, run the health check, and flip the profile back to the previous generation on any failure. Rollback repoints at the previous distinct generation and restarts — never a rebuild. Failed activations append a non-folding deploy_failed/rollback_failed log entry so current/previous folds stay truthful. Adds --unit-dir and --scope system|user (user scope enables the laptop E2E without root). Launchd real activation still refuses explicitly. E2E on the laptop (user scope, harmless deploy-e2e service): deploy v1 serves, deploy v2 serves, rollback serves v1 again, broken generation fails its health check and auto-flips back to the previous generation serving. The first E2E run caught the flip-back restart hitting systemd start limits; flip-back now reset-faileds first and never raises. Tests: slice2 21/21 (refusal test updated to the new behavior), new test_deploy_slice3.py 7/7 with faked runner/prober asserting plan order, dupkeys/argv suites pass; slice-3 suite wired into lib checks.
developing-today
Bot
requested review from
a team and
dezren39
as code owners
November 9, 2026 00:50
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
Member
| **Agent note — task 13787 parked, CI pending (lane code-t, direct):** resumed from checkpoint implementation_complete. Fresh verification: PR #7886 OPEN, not draft, no hard-stop labels, head 8261c08; Codex: no reviews or comments from the Codex connector (checkpoint 2026-11-09T03:33Z verified clear, re-confirmed this shift via REST). Checks at head: 4 basic checks QUEUED (scripts-test 3.12/3.14, fleet-search parity, proxy port fallbacks), CodeRabbit skipped; polled ~5 min per the CI rule — still queued, so task 13787 is parked 1200s rather than holding the claim. Labels set to work/assigned + queue/parked + status/parked. Resume: when checks complete green, merge PR #7886 and complete task 13787; if checks fail, fix forward on the PR branch. Links: task 13787, PR #7886, issue #5766. |
Member
| **Agent note — task 13787 parked, CI pending (lane code-f, direct):** resumed from checkpoint stage implementation_complete. Fresh-verified 2026-11-09T04:50Z: PR #7886 OPEN, not draft, head 8261c08 (unchanged), labels are queue-state only — no hard stops (held / user/owned / do-not-merge / do-not-auto-edit). Prior evidence stands: pkgs/deploy tests slice2 21/21 + slice3 7/7 + dupkeys/argv pass on laptop; laptop E2E verified 2026-11-09T00:49Z (deploy v1/v2, rollback, broken-generation flip-back). Codex: no review comments or reviews on this PR — no findings to disposition. CI polled the full 5-minute window this shift: 4 basic checks still pending (fleet-search parity, proxy port fallbacks, scripts-test 3.12/3.14), 0 failures. Parked task 13787 for 1200s. Resume condition: merge PR #7886 when the basic checks go green on head 8261c08, then complete task 13787 as fixed_merged and close issue #5766 per its acceptance evidence. |
Member
|
🤖 Agent note · picked up + parked — CI pending
|
Member
|
🤖 Agent note · parked (awaiting CI)
|
Member
|
🤖 Agent note · parked (CI pending)
|
Member
|
🤖 Agent note · parked (awaiting CI)
|
Member
|
🤖 Agent note · parked (awaiting CI)
|
This was referenced Nov 14, 2026
Migration M2: one declaration for the fleet three (laptop-agent, secrets-broker, queue-broker)
#5769
Closed
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.
Closes the remaining acceptance of #5766 (deploy tool v1): slices 1–2 (PR #6231, PR #7692) shipped the registry, unit rendering, dry-run plans, generation log, and status/rollback logic; the non-dry-run paths refused explicitly. This slice implements real activation.
What changed
pkgs/deploy/deploy.py: real (non-dry-run)deployandrollbackfor the systemd class, in the design §4.1 plan order — install the generation into the per-service profile, write the unit, daemon-reload, restart only that unit, run the health check, flip back on any failure.currentsymlink names the artifact (the rendered unit's<profile>/current/<entryPoint>path resolves through it), so a flip is one atomic symlink repoint. Store-path artifacts are additionally registered withnix-env --seton a parallel<name>.nix-env-profile.deploy_failed/rollback_failedgeneration-log entry, so the current/previous fold never mistakes a failure for an activation.--unit-dir/--scope system|user(user scope exists so the laptop E2E can deploy a harmless service without root). Launchd real activation still refuses explicitly — it cannot be exercised from the Linux fleet.test_deploy_slice3.py(new, 7 tests, faked runner/prober asserting the §4.1 order, flip-back, rollback, and the recorded-not-raised flip-back-failure regression), wired intolib/default.nixchecks asdeploy-slice3-tests; the slice-2 refusal test updated to the new behavior. Slice-2 suite 21/21, slice-3 7/7, dupkeys/argv suites pass on the laptop.Laptop E2E acceptance (2026-11-09T00:49Z, user scope, harmless
deploy-e2eservice, no nixos-rebuild / home-manager in the loop) — full log on #5766 (comment 6729616258):The first E2E run caught a real bug — a broken unit restart-loops into systemd's start limit, so flip-back now issues
reset-failedbefore restarting and never raises (a flip-back failure is a recorded outcome, not a crash).Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.