Step 8 — crate:install provisioning command + Laravel Cloud deploy guide - #8
Merged
Merged
Conversation
Add the first-run Crate installer and deployment guide so operators can safely configure only Crate-owned app env before first build. Cover idempotency, clobber protection, and Cloud-managed env exclusions in command tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Reverse the env-value escaping in a single left-to-right pass so a backslash- bearing value (e.g. a Windows Satis path) round-trips correctly and stays idempotent instead of tripping the clobber guard on re-run. Add tests proving unrelated .env keys are preserved and a backslash value round-trips, and note in deploy.md that a bare non-interactive crate:install makes no changes (pass the flags for automated deploys). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Step 8 —
crate:installprovisioning command + Laravel Cloud deploy guideThe final build step: a first-run installer that configures a deployed Crate, plus a deploy guide so an operator can fork → deploy → run.
What shipped (vs the plan)
crate:install(app/Console/Commands/CrateInstallCommand.php) — app-level command using built-for-cloud'sWritesInstallEnvtrait. Interactive (prompts, defaulting to the current value) and flag/--no-interactiondriven (--url,--archive-disk,--satis-path,--credential-api,--force,--path). It writes only the four Crate app keys —CRATE_URL,CRATE_ARCHIVE_DISK,CRATE_SATIS_PATH,BUILT_FOR_CLOUD_CREDENTIAL_API_ENABLED— and never the Cloud-injected resource env (DB_*/QUEUE_*/CACHE_*/FILESYSTEM_DISK). Idempotent (a second identical run reports "already configured; no changes"); never clobbers an existing non-empty value without interactive confirmation or--force.docs/deploy.md— a Laravel Cloud deploy guide (linked from the README) covering: resource provisioning with the cardinal rule stated explicitly (never hand-set Cloud-injectedDB/QUEUE/CACHE/FILESYSTEMenv); the build-command step that installs the isolated Satis tool (composer create-project composer/satis "$CRATE_SATIS_PATH" --no-dev, nevercomposer required in); and the first-run flow (crate:install→migrate --force→token:create ci --abilities=admin→crate:repos:add→crate:build→ consumercrate:auth→composer requirethrough the gate). Every command/flag cross-checks against the shipped code..env, no real Cloud).Deserves attention
crate:installwrites only the four keys, and a test asserts a populated.env'sDB_CONNECTION/QUEUE_CONNECTION/CACHE_STORE/FILESYSTEM_DISK/APP_KEYare left untouched.Findings disposition
5be961d): (1)crate:install's env-value un-escaping now uses a single left-to-right pass, so a backslash-bearing value (e.g. a Windows Satis path) round-trips correctly and stays idempotent instead of tripping the clobber guard on re-run — plus a new env-preservation test and a backslash round-trip test; and (1b)docs/deploy.mdnow notes that a bare non-interactivecrate:installmakes no changes (pass the flags for automated deploys). One advisory deferred and flagged for you: the committed IDE-helper metadata (.phpstorm.meta.php) bakes a worktree-absolute path — a pre-existing repo-wide hygiene item affecting every PR, not introduced by step 8; worth gitignoring the regenerated IDE helpers in a separate cleanup.Gate evidence (verified by the coordinator on committed SHA
0d2134b; the later change5be961dadds only the round-trip fix + tests + a deploy.md note)composer ready→ exit 0 (pintpassed, phpstanerrors:0, pest 43/130,composer audit: no advisories); tree clean.composer packages:check→ exit 0; all packages green.Risk / next
v*release tag was pushed — tagging + thekibblesplit to the mirror repos is Ed-authorized. The IDE-helper-hygiene cleanup above is optional.🤖 Generated with Claude Code