CluPilotCloud/tests/Feature/Provisioning
nexxo 34874adec3
tests / pest (push) Failing after 8m6s Details
tests / assets (push) Successful in 21s Details
tests / release (push) Has been skipped Details
Apply a bought plan change instead of only pricing it
PlanChange could say what a move would cost and whether it was allowed, and
that was all it could do. Billing::purchase() wrote an upgrade order and
nothing ever consumed it: same snapshot, same machine, same quota. A customer
could pay for a bigger package and receive nothing.

ApplyPlanChange is now the single place a change lands — it moves the contract
onto the target's current version, writes one register row, settles the custom
domain, and starts a run that resizes the machine. Applying the same order
twice is a no-op, enforced by a unique event key rather than by a check two
callers could both pass.

Two things a plan change must not do, and now does not. A disk is never shrunk
— Proxmox cannot, so the QUOTA shrinks instead, which is what was sold anyway.
And a live machine is never rebooted as a side effect: cores and RAM are
written, and where they need a restart the instance says so where an operator
and the customer can both see it.

The storage allowance also joins the build pipeline. ApplyStorageQuota was
written for plan changes and ran only there, so a brand-new customer still got
no quota at all — quota_gb reached the instance row and stopped, and every
package delivered the whole disk. The test guarding that pipeline only counted
its steps, which is how a list missing the one step that makes a package's
storage real stayed green for its whole life. It now names the step.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-29 17:18:55 +02:00
..
CustomerDataModelTest.php fix(engine-b): default-deny firewall, disk-based capacity, synchronous credential mail 2026-07-25 12:39:15 +02:00
CustomerProvisioningEndToEndTest.php Stop mailing the initial admin password, hold it in the panel until noted 2026-07-28 23:19:20 +02:00
CustomerStepBaseTest.php Apply a bought plan change instead of only pricing it 2026-07-29 17:18:55 +02:00
CustomerStepsTest.php Stop mailing the initial admin password, hold it in the panel until noted 2026-07-28 23:19:20 +02:00
DataModelTest.php feat(engine): core provisioning data model + hosts 2026-07-25 09:49:43 +02:00
HostOnboardingEndToEndTest.php Close SSH and the Proxmox UI to the world once the tunnel is proven up 2026-07-28 23:57:07 +02:00
HostStepsTest.php Add the SSH identity to the vault, and give deployment config a console page 2026-07-29 00:52:44 +02:00
LiveProgressTest.php Send a guest bounced off the console to the console's own sign-in 2026-07-28 13:32:05 +02:00
PipelineRegistryTest.php feat(engine): orchestrator core (state machine + tick + lock) 2026-07-25 09:54:52 +02:00
PruneHostDnsTest.php Move host DNS names off the public zone into vpn-dns's internal hostsdir 2026-07-28 23:44:31 +02:00
RunRunnerTest.php Serve the custom domain, not just announce it 2026-07-29 16:44:52 +02:00
ServicesTest.php Move host DNS names off the public zone into vpn-dns's internal hostsdir 2026-07-28 23:44:31 +02:00
StripeWebhookTest.php Refuse a portal login for an address that already belongs to an operator 2026-07-28 14:42:16 +02:00
SubscriptionSnapshotTest.php feat(billing): the plan catalogue becomes three tables, and config stops selling 2026-07-26 12:05:56 +02:00
TickProvisioningTest.php feat(billing): the plan catalogue becomes three tables, and config stops selling 2026-07-26 12:05:56 +02:00