Skip to content

feat: apply provisioning automatically on boot - #32

Merged
NovusEdge merged 3 commits into
mainfrom
auto-provision-boot
Aug 9, 2026
Merged

feat: apply provisioning automatically on boot#32
NovusEdge merged 3 commits into
mainfrom
auto-provision-boot

Conversation

@NovusEdge

Copy link
Copy Markdown
Owner

Part C of the auto-provision design (spec: 2026-08-10-auto-provision), and the payoff: a disk VM sets itself up on boot with no keypress.

core.NeedsProvision(v) gates the run. True when filterByRunMode finds a recipe to run (never applied, or its script changed) or the VM is a disk VM with a share (the idempotent share-mount step leaves no Applied entry to check). A cloud VM is always false — cloud-init handles it.

TUI — the y/N auto-provision prompt is gone. After a started VM reaches ssh, stoat runs startProvision directly when needsAutoProvision is true, and does nothing when it is false. A live VM still applies every boot (tmpfs root). Removed autoProvisionPrompt, wantsAutoProvisionPrompt, lastProvisionSucceeded, the pendingProvision model field, and the list-screen y/N handling. A pending delete confirmation still wins over an auto-provision landing on the ssh-watch timer.

CLIstoat up now waits for ssh and provisions when NeedsProvision is true, streaming the same progress stoat provision shows. --no-provision skips it and returns immediately. A VM with nothing pending returns without waiting. JSON mode is unchanged (returns immediately).

Net effect: the first boot after install mounts the share and applies every recipe; a later boot applies only what changed; a routine restart with nothing pending stays silent. v4 and v5 self-heal their udev on next boot, because the changed recipe now re-runs.

Tests: NeedsProvision across applied/changed/share/cloud; the TUI auto-applies without a prompt; stoat up --no-provision skips and a nothing-pending up returns without waiting. just check and just test pass.

NeedsProvision reports whether a provision run on a VM would do real
work: a recipe filterByRunMode would still run, or a disk VM has a
share whose idempotent mount step leaves no Applied record to check.
A cloud VM always returns false, since cloud-init already ran its
recipes from the seed at first boot.

TUI and CLI callers use this next to decide when to provision without
asking.
sshReadyMsg now starts a provision run itself instead of showing a
y/N prompt. needsAutoProvision replaces wantsAutoProvisionPrompt: it
defers to core.NeedsProvision, except for a live VM, whose tmpfs root
wipes every reboot, so its host-side Applied record cannot answer for
what the guest still has. A live VM with any recipe always
auto-provisions.

Removed autoProvisionPrompt, lastProvisionSucceeded, the model's
pendingProvision field, and list.go's y/N key handling for it: there
is no prompt left to answer. ensureNoStaleLog is unchanged.
afterStart waits for ssh and runs core.Apply once a started VM
answers, the same path stoat provision uses, streaming its log the
same way runApply does. It runs only when core.NeedsProvision reports
real work pending, so a VM with nothing to do returns immediately.

--no-provision skips this and returns as soon as the VM starts,
matching up's behavior before this feature existed.
@NovusEdge NovusEdge added the enhancement New feature label Aug 9, 2026
@NovusEdge NovusEdge self-assigned this Aug 9, 2026
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@NovusEdge, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 40 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 51bf0bca-f72d-454e-99b1-4060c2443111

📥 Commits

Reviewing files that changed from the base of the PR and between d5ad100 and b0f3240.

📒 Files selected for processing (12)
  • internal/cli/cli.go
  • internal/cli/cli_test.go
  • internal/cli/grammar.go
  • internal/cli/run_vm.go
  • internal/cli/run_vm_test.go
  • internal/core/needs_provision.go
  • internal/core/needs_provision_test.go
  • internal/tui/app.go
  • internal/tui/autoprov.go
  • internal/tui/autoprov_test.go
  • internal/tui/list.go
  • internal/tui/snapshots.go

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@NovusEdge
NovusEdge merged commit 51ba1c6 into main Aug 9, 2026
8 checks passed
@NovusEdge
NovusEdge deleted the auto-provision-boot branch August 9, 2026 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant