refactor: rename the apply action off "provision" - #36
Conversation
Every user-facing string now says "apply" instead of "provision": TUI key hints, toasts, the detail pane title, and CLI progress lines. Internal identifiers (sshx.Provision, ErrProvisionInProgress, the last-provision.log filename, the recipe stage schema) stay unchanged; only parsers and wire formats depend on those. The CLI drops runProvision and its divergent output strings. `provision` becomes a hidden command that shares applyCmd's fields and dispatches to runApply, so it gains --only and matches apply's JSON shape. `up`'s --no-provision flag is renamed to --no-apply, with --no-provision kept as a hidden alias for scripts that already pass it. TestToastOverlayKeepsScreenShape compared rendered lines byte for byte, which broke on the shorter "apply" footer label: lipgloss v2's compositor trims trailing whitespace when it draws the toast over a line, so a label-length change alone shifted trailing spaces without changing anything visible. The test now trims trailing spaces before comparing width, keeping the real invariant (no added row, no wrap).
WalkthroughThe CLI now uses ChangesRecipe application flow
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/troubleshooting.md`:
- Around line 112-114: Tag the troubleshooting status example’s fenced Markdown
block as text, and update the concurrent-apply message in the TUI app to use
complete wording such as “recipes are already being applied” or the
CLI-compatible “an apply is already running.”
In `@internal/tui/provision.go`:
- Line 81: Update the toast message returned by the provision flow around
showToast to replace “cloud VMs” with “VMs using cloud-init,” preserving the
rest of the warning and its behavior.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 5f691c0a-015c-42f3-8792-6856c17892bb
📒 Files selected for processing (16)
docs/troubleshooting.mdinternal/cli/cli.gointernal/cli/cli_test.gointernal/cli/grammar.gointernal/cli/kong_test.gointernal/cli/run_access.gointernal/cli/run_apply.gointernal/cli/run_vm.gointernal/cli/run_vm_test.gointernal/core/lock.gointernal/tui/app.gointernal/tui/detail.gointernal/tui/keymap.gointernal/tui/provision.gointernal/tui/provstep_test.gointernal/tui/toast_test.go
💤 Files with no reviewable changes (1)
- internal/cli/run_access.go
| ``` | ||
| <name>: installing itself; wait for it to finish and reboot, then stoat notices the install and offers to provision | ||
| <name>: installing itself; wait for it to finish and reboot, then stoat notices the install and offers to apply recipes | ||
| ``` |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Specify a language for the fenced block.
Add a language tag to the status example so Markdown lint passes and renderers treat it as literal text.
Proposed fix
-```
+```text
<name>: installing itself; wait for it to finish and reboot, then stoat notices the install and offers to apply recipes</details>
</review_comment>
</file_review>
<file_review path="internal/tui/app.go">
<review_comment line_ranges="361-363">
**Use a complete concurrent-apply message.**
`recipes already applying` is grammatically incomplete. Use `recipes are already being applied` or match the CLI wording, `an apply is already running`.
<details>
<summary>Proposed fix</summary>
```diff
- cmd := m.showToast(msg.name+": recipes already applying", false)
+ cmd := m.showToast(msg.name+": recipes are already being applied", false)
</review_comment>
<review_comment line_ranges="368-368">
LGTM!
</review_comment>
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ``` | |
| <name>: installing itself; wait for it to finish and reboot, then stoat notices the install and offers to provision | |
| <name>: installing itself; wait for it to finish and reboot, then stoat notices the install and offers to apply recipes | |
| ``` |
| ``` | |
| <name>: installing itself; wait for it to finish and reboot, then stoat notices the install and offers to provision | |
| <name>: installing itself; wait for it to finish and reboot, then stoat notices the install and offers to apply recipes | |
| ``` | |
| cmd := m.showToast(msg.name+": recipes are already being applied", false) |
🧰 Tools
🪛 markdownlint-cli2 (0.23.2)
[warning] 112-112: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/troubleshooting.md` around lines 112 - 114, Tag the troubleshooting
status example’s fenced Markdown block as text, and update the concurrent-apply
message in the TUI app to use complete wording such as “recipes are already
being applied” or the CLI-compatible “an apply is already running.”
Source: Linters/SAST tools
| // shows the user the refusal before anything starts, instead of | ||
| // after a failed attempt. | ||
| return m.showToast(v.Name+": cloud VMs provision at first boot via cloud-init. Recipes are applied automatically; recreate the VM to change them", true) | ||
| return m.showToast(v.Name+": cloud VMs apply recipes at first boot via cloud-init. Recreate the VM to change them", true) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Match the toast wording to the backend condition.
The condition at Lines [68-71] intentionally handles backend=="cloudinit" even when v.Mode=="disk". The toast says “cloud VMs”, which is inaccurate for that reachable state. Use “VMs using cloud-init” so the message matches the condition.
The supplied branch comment confirms that this backend state is reachable.
Proposed wording
- return m.showToast(v.Name+": cloud VMs apply recipes at first boot via cloud-init. Recreate the VM to change them", true)
+ return m.showToast(v.Name+": VMs using cloud-init apply recipes at first boot. Recreate the VM to change them", true)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| return m.showToast(v.Name+": cloud VMs apply recipes at first boot via cloud-init. Recreate the VM to change them", true) | |
| return m.showToast(v.Name+": VMs using cloud-init apply recipes at first boot. Recreate the VM to change them", true) |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@internal/tui/provision.go` at line 81, Update the toast message returned by
the provision flow around showToast to replace “cloud VMs” with “VMs using
cloud-init,” preserving the rest of the warning and its behavior.
Part 1 of the plan (rename → automate → runtimes). Renames the user-facing action from "provision" to "apply" and unifies the two CLI commands on
apply.TUI: the
pkey reads "apply"; the detail pane is "last apply"; the toasts say "recipes applied" / "recipes already applying"; the cloud-init and no-recipes messages are reworded off "provision".CLI:
stoat applyis the keeper (goes throughcore.Apply, has--onlyand the per-VM lock).stoat provisionstays as a hidden alias that dispatches torunApply, andrunProvisionis deleted (confirmedrunApplyalready takes the same lock and writes the same log).up --no-provisionbecomes--no-apply, with--no-provisiona hidden alias. One deliberate behavior change:stoat provision <cloud-vm>now exits 1 withErrAppliedAtBootlikeapplydoes, instead of the old exit-0 message.Scope: user-facing only. Internal identifiers (
sshx.Provision,WithProvisionLock,NeedsProvision), thelast-provision.logfilename, the=== recipe NAME ===marker, and the recipestage = "provision"schema value stay.Toast test:
TestToastOverlayKeepsScreenShapecompared raw rendered width, which the lipgloss v2 compositor shifts by trimming trailing spaces when the footer label width changes. Relaxed to compare each line after trimming trailing spaces, keeping the real invariants (no wrap, no added row).just checkandjust testpass.stoat --helpshowsapply/--no-apply;provision/--no-provisionstill parse but stay hidden.Summary by CodeRabbit
New Features
--no-applyto skip applying recipes after starting a VM.--no-provisionas a hidden compatibility alias.provisioncommand now operates as an alias forapply.Improvements