Skip to content

cmd: add --for to confirmation accept - #243

Open
kleinbem wants to merge 1 commit into
nlewo:mainfrom
kleinbem:confirmation-accept-for
Open

kleinbem wants to merge 1 commit into
nlewo:mainfrom
kleinbem:confirmation-accept-for

Conversation

@kleinbem

Copy link
Copy Markdown
Contributor

comin confirmation accept can only accept "whatever is waiting": a generation waiting for building gets confirmed for deploying too (Confirm(uuid, "all")), and a waiting deployment only gets accepted when no build waits. With both confirmers in manual mode that's a problem:

  • A script that confirms builds (mine checks the cache and builds a few small derivations, then accepts) also lets the generation deploy right away, so the deploy confirmer never holds anything.
  • Accepting a deployment while a newer generation waits for building confirms the newer build instead.

I use this on my desktop: comin builds whenever main moves, but only switches overnight, from a timer that runs comin confirmation accept --for deploy.

This adds --for build and --for deploy. The server already handles "build" and "deploy" in ConfirmRequest.For, so the change is only in the CLI. Without the flag nothing changes. The choice moved into acceptTarget with a table test.

Tested: go test -race ./... and nix flake check pass on x86_64-linux. I built comin with this patch for my host and checked --help and that an unknown value is rejected.

Prepared with help from Claude Code.

`comin confirmation accept` confirms a generation waiting for building
for deploying as well, and only accepts a waiting deployment when no
build waits. With both confirmers in manual mode, a script that builds
and confirms generations cannot leave the deployment to someone else,
and accepting a deployment can confirm a newer build instead.

`--for build` accepts only the generation waiting for building,
`--for deploy` only the one waiting for deploying. The server already
takes "build" and "deploy" for ConfirmRequest.For; without the flag
nothing changes.

The choice moves into acceptTarget, covered by a table test.
@kleinbem
kleinbem force-pushed the confirmation-accept-for branch from 16186cf to 6b51369 Compare November 25, 2026 20:03
kleinbem added a commit to kleinbem/nix-config that referenced this pull request Nov 25, 2026
nixos-nvme moves from autoUpgrade to comin, so every host deploys the
same way: signed heads only, a `testing-nixos-nvme` canary branch,
`comin status` and metrics. As a desktop it still only switches
overnight.

- New `my.deploy.comin.deployAt` (calendar spec): comin's
deployConfirmer goes to manual and a `comin-deploy` timer runs `comin
confirmation accept --for deploy`. Persistent, so a night spent off
switches at the next boot, as autoUpgrade did. `comin confirmation
accept --for deploy` switches at once by hand.
- With deployAt, comin-assemble confirms with `--for build`: a plain
`accept` confirms the deployment as well (`Confirm(uuid, "all")`), which
would skip the hold.
- `--for` isn't in comin yet. The package carries the patch from
nlewo/comin#243 on hosts with deployAt only; hass-pi and the others keep
the unpatched package and the plain accept.
- nixos-nvme: comin with requireCache, localAssembly, deployAt `*-*-*
04..05:00/15`. build-nvme.yaml keeps building its packages.

Checked: `just dev::preflight` passes. Patched comin builds (its Go
tests run in the build), `--for` shows in `--help` and rejects other
values. nixos-nvme evaluates to buildConfirmer and deployConfirmer
manual, comin-assemble runs `accept --for build`, the timer
`OnCalendar=*-*-* 04..05:00/15`, `Persistent=true`. hass-pi's comin drv
is unchanged and its deployConfirmer stays `without`. Upstream branch:
`go test -race ./...` and `nix flake check` pass.

After merge, the old autoUpgrade timer still runs once: its next 04:00
run pulls production and switches nixos-nvme onto comin.

🤖 Generated with [Claude Code](https://claude.com/claude-code)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **New Features**
* NVMe deployments can now be scheduled to run every 15 minutes between
04:00 and 05:00.
* Build and deployment confirmations are handled separately when a
deployment schedule is configured. Confirmation can also be requested
specifically for a build or deployment; if none is waiting, the command
reports that no confirmation is required.
* **Documentation**
* Updated the deployment options reference to include the schedule
setting and the NVMe host.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: kleinbem-bot[bot] <293345884+kleinbem-bot[bot]@users.noreply.github.com>
@nlewo

nlewo commented Nov 26, 2026

Copy link
Copy Markdown
Owner

@kleinbem thanks for you contrib!

I agree with the feature (the confirmation feature is currently only partially implemented).

I will review it in the next few days.

FYI, on the comin matrix chan, we discussed about the same kind of needs: the idea would be to implement a new confirmation mode named "on-calendar" that would auto confirm at a specific time, with an optionnal randomized delay.

@kleinbem
kleinbem marked this pull request as ready for review November 26, 2026 11:29
@kleinbem

Copy link
Copy Markdown
Contributor Author

Thanks! on-calendar would suit my desktop better than my timer, I'd drop it 👍

--for build is still needed though: my build-confirm script's accept also confirms the deploy, which would get around on-calendar too.

Marked ready. Happy to have a go at on-calendar after if nobody's on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants