Skip to content

[#3336] Signed the Lagoon PR closure webhook with 'LAGOON_WEBHOOK_TOKEN' and switched to the 'webhook.amazeeio.cloud' endpoint. - #3338

Merged
AlexSkrypnyk merged 5 commits into
mainfrom
feature/3336-lagoon-webhook-token
Nov 15, 2026
Merged

AlexSkrypnyk merged 5 commits into
mainfrom
feature/3336-lagoon-webhook-token

Conversation

@AlexSkrypnyk

@AlexSkrypnyk AlexSkrypnyk commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

Closes #3336

Summary

.github/workflows/close-pull-request.yml now signs the closed pull_request event with the LAGOON_WEBHOOK_TOKEN repository secret before posting it to Lagoon. It sends X-Hub-Signature-256 and X-Hub-Signature headers the same way GitHub signs its own webhooks, and its default endpoint is https://webhook.amazeeio.cloud/ instead of https://hooks.lagoon.amazeeio.cloud/.

Since 2 November 2026, Lagoon rejects unsigned webhooks. It answers a rejected one with HTTP 200 and {"error":"unable to resolve project for webhook"}, so curl exited 0, the job went green, and every closed PR left its pr-<N> environment running until someone deleted it by hand.

After merge, the job fails when LAGOON_WEBHOOK_TOKEN is empty, when the HTTP request fails (--fail-with-body), or when the response body contains "error". It prints Lagoon's response on every run. Consumer projects need to add the LAGOON_WEBHOOK_TOKEN secret, and the docs now say where to get it. LAGOON_WEBHOOK_ENDPOINT still overrides the endpoint. In the template repository itself, a VORTEX_DEV-fenced job-level if: skips the job, because drevops/vortex has no Lagoon project and no token. The installer strips that fence, so consumers never see it.

Before / After

BEFORE                                       AFTER

PR closed                                    PR closed
   │                                            │
   ▼                                            ▼
cat event.json | curl --data-binary @-       token empty? ──yes──► exit 1 (red check)
   │  (no signature)                            │ no
   ▼                                            ▼
hooks.lagoon.amazeeio.cloud                  HMAC-SHA256 + HMAC-SHA1 of event.json
   │                                            │
   ▼                                            ▼
HTTP 200 {"error": "unable to resolve..."}   curl --fail-with-body
   │                                            --data-binary @event.json
   ▼                                            + X-Hub-Signature-256 / X-Hub-Signature
curl exits 0 ──► job green                      │
   │                                            ▼
   ▼                                         webhook.amazeeio.cloud
pr-<N> environment keeps running                │
                                                ▼
                                             HTTP error or "error" body? ──yes──► exit 1
                                                │ no
                                                ▼
                                             Lagoon removes pr-<N>, job green

Changes

Workflow

  • .github/workflows/close-pull-request.yml: signs $GITHUB_EVENT_PATH with openssl dgst -hmac (SHA-256 and SHA-1) and sends the same file with --data-binary @"$GITHUB_EVENT_PATH", so the signed bytes and the body are identical. The cat | curl --data-binary @- pipe is gone.
  • Same file: adds --silent --show-error --fail-with-body, an empty-secret guard and a response check for "error", and passes LAGOON_WEBHOOK_TOKEN: ${{ secrets.LAGOON_WEBHOOK_TOKEN }} into the step.
  • Same file: a #;< VORTEX_DEV job-level if: ${{ github.repository != 'drevops/vortex' }}, so PR closures in the template repository don't fail on the missing secret.

Documentation

  • .vortex/docs/content/deployment/lagoon.mdx: documents the signed webhook, the 2 steps to add LAGOON_WEBHOOK_TOKEN (the Webhook token from the project's Details page in the Lagoon UI, or the organization's token for a polysite), the failure modes and the new default endpoint. It also tells CircleCI projects with GitHub Actions enabled to add the secret.
  • .vortex/docs/content/installation.mdx: adds the LAGOON_WEBHOOK_TOKEN secret to both the GitHub Actions and the CircleCI setup steps, linking to the Lagoon deployment page.
  • .vortex/docs/cspell.json: adds polysite, Lagoon's term for a multi-project site, to the spelling dictionary.

Installer fixtures

  • Regenerated with ahoy update-snapshots: the 5 close-pull-request.yml fixtures under hosting_lagoon, hosting_project_name___lagoon, migration_enabled_lagoon, migration_disabled_lagoon and provision_database_lagoon. They match the template with the VORTEX_DEV fence removed.

@AlexSkrypnyk AlexSkrypnyk added the A5 Board worker 5 label Nov 15, 2026
@github-project-automation github-project-automation Bot moved this to BACKLOG in Vortex 1.x Nov 15, 2026
@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

This review includes 4 billable files and costs up to $1.00.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 20 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 4f5cc6e and 5deee0c.

Files ignored due to path filters: 5

  • .vortex/installer/tests/Fixtures/handler_process/hosting_lagoon/.github/workflows/close-pull-request.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/hosting_project_name___lagoon/.github/workflows/close-pull-request.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/migration_disabled_lagoon/.github/workflows/close-pull-request.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/migration_enabled_lagoon/.github/workflows/close-pull-request.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/provision_database_lagoon/.github/workflows/close-pull-request.yml is excluded by !.vortex/installer/tests/Fixtures/**
Files selected for processing: 4

  • .github/workflows/close-pull-request.yml
  • .vortex/docs/content/deployment/lagoon.mdx
  • .vortex/docs/content/installation.mdx
  • .vortex/docs/cspell.json
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

📖 Documentation preview for this pull request has been deployed to Netlify:

https://6afa3c6397fe2b6628d81748--vortex-docs.netlify.app

This preview is rebuilt on every commit and is not the production documentation site.

@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@AlexSkrypnyk

This comment has been minimized.

@github-actions

This comment has been minimized.

@AlexSkrypnyk

This comment has been minimized.

1 similar comment
@AlexSkrypnyk

This comment has been minimized.

@github-actions

This comment has been minimized.

@codecov

codecov Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.65%. Comparing base (4f5cc6e) to head (5deee0c).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3338   +/-   ##
=======================================
  Coverage   92.65%   92.65%           
=======================================
  Files         114      114           
  Lines        5091     5091           
  Branches       49       49           
=======================================
  Hits         4717     4717           
  Misses        374      374           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@AlexSkrypnyk AlexSkrypnyk added the AUTOMERGE Pull request has been approved and set to automerge label Nov 15, 2026
@AlexSkrypnyk
AlexSkrypnyk enabled auto-merge (squash) November 15, 2026 23:09
@github-actions

This comment has been minimized.

@AlexSkrypnyk

This comment has been minimized.

@github-actions

This comment has been minimized.

@AlexSkrypnyk

This comment has been minimized.

1 similar comment
@AlexSkrypnyk

Copy link
Copy Markdown
Member Author

Code coverage (threshold: 90%)

  Classes: 100.00% (1/1)
  Methods: 100.00% (2/2)
  Lines:   100.00% (233/233)
Per-class coverage
Drupal\ys_demo\Plugin\Block\CounterBlock
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 10/ 10)

@github-actions

Copy link
Copy Markdown

Code coverage (threshold: 90%)

  Classes: 100.00% (1/1)
  Methods: 100.00% (2/2)
  Lines:   100.00% (233/233)
Per-class coverage
Drupal\ys_demo\Plugin\Block\CounterBlock
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 10/ 10)

@AlexSkrypnyk
AlexSkrypnyk merged commit 4dbe604 into main Nov 15, 2026
51 checks passed
@AlexSkrypnyk
AlexSkrypnyk deleted the feature/3336-lagoon-webhook-token branch November 15, 2026 23:28
@github-project-automation github-project-automation Bot moved this from BACKLOG to Release queue in Vortex 1.x Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A5 Board worker 5 AUTOMERGE Pull request has been approved and set to automerge

Projects

Status: Release queue

Development

Successfully merging this pull request may close these issues.

Sign the Lagoon PR closure webhook with 'LAGOON_WEBHOOK_TOKEN' and use the 'webhook.amazeeio.cloud' endpoint

1 participant