Forge API v2 migration + GitHub-built static binaries - #2
Open
ngunyimacharia wants to merge 16 commits into
Open
Forge API v2 migration + GitHub-built static binaries#2ngunyimacharia wants to merge 16 commits into
ngunyimacharia wants to merge 16 commits into
Conversation
ngunyimacharia
force-pushed
the
feat/forge-api-v2-migration
branch
from
July 27, 2026 15:21
1a60477 to
7c46dad
Compare
app('git.version') shells out to git at boot; inside a PHAR the cwd is a phar:// path so proc_open fails and the packaged binary cannot start. Bake the tag in as a literal at build time.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Box's requirements checker rejects the embedded PHP without iconv (required by symfony/polyfill-mbstring). Add it to the static-php-cli extension set. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Member
Author
|
Release pipeline verified end-to-end via v1.0.0-beta.1 (tag → The beta run caught two bugs that would have shipped a non-booting binary — both fixed here:
Still outstanding (needs real credentials): a live-Forge |
…ation errors Forge API v2 validation requires www_redirect_type (the OpenAPI schema marked it optional, but the live API rejects createSite without it) — default to 'none' for preview subdomains. Also catch Laravel\Forge\Exceptions\ValidationException in both commands and print the field-level errors instead of the opaque 'The given data failed to pass validation.' Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ested error bag
Forge API v2 requires letsencrypt.key_type on createCertificate (default ecdsa). Also fix bailValidation: the SDK passes the full {message, errors} body, so flatten the nested errors bag recursively instead of interpolating arrays into strings.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…anaged databases) Servers using an external database return 404 on database/schemas and database/users. safelyIterate() treats a NotFoundException on a list endpoint as empty so destroy still cleans up the remaining resources and deletes the site. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…olerate cert conflicts If createSite returns a 'domain has already been added' 422 (e.g. a prior partial/failed create that our site scan missed), look the site up and continue provisioning (setup-command, env, cert, deploy) instead of aborting and leaving it half-configured. Also tolerate a ValidationException on createCertificate (a reused site may already have one). Extract flattenValidationMessages into HandlesOutput. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…rovisioning
Forge returns a 422 ('recently created, wait 60s') when updating the .env of a just-created site. Retry the read-modify-write (bounded by --timeout) until provisioning completes, for both the --edit-env and database env-injection paths.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Enabling push_to_deploy in createSite makes Forge auto-deploy the instant the repo finishes cloning — before the deployment script and environment are configured — running Forge's default script and racing/blocking our own deployment. Create the site with push_to_deploy=false, run the explicit deployment (correct script + env), then enable push-to-deploy so future pushes still auto-deploy (skipped when --no-quick-deploy). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…+ wedges) forge-previewer always runs a deployment immediately after creating the site, which installs dependencies. Asking Forge to also install them during creation is redundant and runs an uncontrollable parallel composer install that, on servers hitting composer's download race, wedges and blocks our deployment. The deployment (with its serialized composer + shared-env restore) is the single source of truth. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Site creation (repo clone + directory setup) is async. createDeployment was firing before the site directory existed, so the deploy script's first command (cd <site dir>) failed instantly (2s). Poll the site until SiteStatus leaves creating/installing before running setup/cert/deploy. 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.
Summary
Migrates
forge-previewerfrom the deprecated Forge API v1 to API v2 usinglaravel/forge-sdk ^4.1, upgrades the application stack, and replaces the committed PHAR with self-contained release binaries built by GitHub Actions.Implements
docs/specs/2026-07-27-forge-api-v2-migration-design.md.Changes
Upstream sync
ryangjchandler/forge-previewer: commitcomposer.lockand removeInspireCommand.--timeoutoption andconfig('app.timeout')default.composer.lockgoing forward.Runtime and dependency upgrades
HandlesOutput::fail()tobail()to avoid a collision withIlluminate\Console\Command::fail().Forge API v2 migration
--orgoption orFORGE_ORGenvironment variable.dns-01for wildcard domains andhttp-01otherwise.php81tophp84.$GITHUB_OUTPUTinstead of using the deprecated::set-outputcommand.Forge API v2 does not accept DNS-provider credentials when creating certificates. The existing
--route-53-keyand--route-53-secretoptions remain for CLI compatibility, but credentials must now be configured in Forge for thedns-01challenge.CI and distribution
v*tag is pushed.builds/forge-previewerand use the source entry script for Composer installations.Verification
./forge-previewer list./forge-previewer deploy --help./forge-previewer destroy --helpcomposer validateThe static-binary release pipeline requires a real
v*tag, and a live deploy/destroy test requires Forge credentials. Both remain gated by their respective external prerequisites.