feat: #553 add AsyncDeploy option for Pantheon review apps via Quicksilver webhook#1211
Open
rabbitlair wants to merge 35 commits into
Open
feat: #553 add AsyncDeploy option for Pantheon review apps via Quicksilver webhook#1211rabbitlair wants to merge 35 commits into
rabbitlair wants to merge 35 commits into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
Introduces asynchronous deployment for Pantheon Review Apps via Quicksilver hooks for GitHub and GitLab and adds PANTHEON_SKIP_WIPE_MULTIDEV to preserve multidev state. Use ln -sf for symbolic links to ensure idempotency. Replace deprecated set-output with $GITHUB_OUTPUT. Remove redundant composer install steps. Quote shell variables to prevent expansion errors.
b541cae to
cad1710
Compare
…llabot/drainpipe into 553--pantheon-review-apps-performance
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.
Closes #553
Summary
success.setup-terminusaction now caches the Terminus binary withactions/cache, skipping the download on subsequent runs.PANTHEON_SKIP_WIPE_MULTIDEVfor GitLab: GitLab review app jobs now supportPANTHEON_SKIP_WIPE_MULTIDEV, matching the existing GitHub behaviour. When set to"true"and the multidev already exists, the delete-and-recreate step is skipped.Async deploy flow
New opt-in config
Running
composer installafter addingAsyncDeployscaffolds:.github/workflows/PantheonReviewApps.yml— replaced with async variant.github/workflows/PantheonReviewAppsPostDeploy.yml— new post-deploy workflowweb/private/scripts/drainpipe_notify_github.php— Quicksilver script (+ GitLab equivalents)Manual steps required after scaffolding: register the
sync_codeQuicksilver hook inpantheon.ymland set two Pantheon secrets (drainpipe_github_token,drainpipe_github_repo). Full instructions in the README.In async mode, Job 2 is triggered by
repository_dispatchand does not appear as a PR check. A failed Drush update will not block a merge even if the review app check is required in branch protection. Job 2's result is visible in the GitHub Deployments panel on the PR.Async deploy observability
The async deploy pipeline introduces a new class of failure that the original implementation left silent: once Job 1 exits, the GitHub Deployment stays
in_progressindefinitely if the Pantheon sync fails, if Quicksilver's webhook call is rejected, or if the dispatched Job 2 never starts. To surface these failures, every deployment status update now carries alog_urlpointing directly to the CI run that created it — the "View deployment" link in the PR Deployments panel always navigates to the relevant logs regardless of which stage the pipeline is in. When Job 2 starts, it refreshes thein_progressstatus with its own run URL, so the link stays current as the pipeline hands off between jobs. The Quicksilver scripts also now exit with code 1 on non-2xx HTTP responses, causing Pantheon to record thesync_codeworkflow as failed rather than silently succeeding when the webhook dispatch is rejected.For failures that happen entirely outside GitHub's visibility — a Pantheon sync error or a Quicksilver script that fails before firing the dispatch — a new
PantheonReviewAppsWatchdog.ymlworkflow runs on a 30-minute schedule. It scans all GitHub Deployments stuck inin_progresspast a configurable threshold (default 20 minutes, overridable viaPANTHEON_ASYNC_WATCHDOG_THRESHOLD_MINUTES), queriesterminus workflow:listto retrieve the Pantheon sync outcome, and marks each stale deploymenterrorwith a diagnostic description identifying whether the Pantheon sync failed, or whether sync succeeded but the post-deploy job never started. The watchdog is scaffolded automatically alongside the other async files whenAsyncDeployis added tocomposer.json. Job 1 also now writes a step summary to the Actions job page with a direct link to the Pantheon dashboard workflow logs and theterminus workflow:listcommand, giving developers a clear next step even before the watchdog fires.Test plan
"AsyncDeploy"to a test project'scomposer.jsonand runcomposer install— verify the three async files are scaffolded andPantheonReviewApps.ymlcontainsasync: 'true'ReviewAppswithoutAsyncDeployis unaffected (blocking workflow unchanged, no post-deploy file)TestPantheonAsyncDeploy.ymlCI workflow covers: scaffold file placement (both modes), bash async guards inreview/action.ymlandupdate/action.yml, and Quicksilver PHP script pattern filtering + secrets validationsetup-terminusskips thecurldownload stepPANTHEON_SKIP_WIPE_MULTIDEV=trueon GitLab skips multidev wipe on subsequent pushes