Skip to content

Cleaned up trigger_cd payload to send artifact identity only#26721

Merged
rob-ghost merged 1 commit intomainfrom
chore/trigger-cd-cleanup
Mar 5, 2026
Merged

Cleaned up trigger_cd payload to send artifact identity only#26721
rob-ghost merged 1 commit intomainfrom
chore/trigger-cd-cleanup

Conversation

@rob-ghost
Copy link
Contributor

@rob-ghost rob-ghost commented Mar 5, 2026

The trigger_cd dispatch was sending deployment policy fields (dry_run, should_rollout, environment) alongside artifact identity. This meant Ghost CI was dictating how Moya should deploy — making it impossible to change deployment defaults without pushing a change to the public Ghost repo.

This strips the payload down to artifact identity and a single fact flag. The new payload sends: ref (commit SHA), pr_number, deploy (whether deploy-to-staging label is present), admin_artifact_id, and admin_artifact_run_id. The previous sha, image_tag, dry_run, should_rollout, and environment fields are all removed — Moya now derives everything it needs from ref, pr_number, and deploy.

The deploy flag replaces the old dry_run/should_rollout booleans. It's a fact about the PR (the deploy-to-staging label is set and the user is authorized), not a policy decision. Moya interprets it: PR builds without the flag are dry runs, main merges publish and rollout to all sites, and the deploy flag triggers publish + rollout to a fixed set of test sites.

Companion PR in Ghost-Moya (TryGhost/Ghost-Moya#177) updates the orchestrator to interpret the new payload shape. The Moya change is backwards-compatible — it handles both old and new payloads during the transition, so this can be merged second without coordination issues.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d6bf7f0c-c8f9-4731-afdd-cac3fe2a04be

📥 Commits

Reviewing files that changed from the base of the PR and between 0e3ca3c and c693d5c.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml

Walkthrough

This pull request modifies the continuous integration workflow in .github/workflows/ci.yml to restructure deployment control parameters. The main branch flow is updated to emit a single deploy flag instead of separate dry_run and should_rollout outputs. The PR path similarly shifts to use the deploy output with conditional logic based on deployment labels. The repository-dispatch payload is simplified by removing the environment and image_tag fields while adding the deploy field to replace the separate boolean flags. These changes affect how deployment decisions are communicated to downstream workflows.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: cleaning up the trigger_cd payload to send only artifact identity, which aligns with removing deployment policy fields and simplifying the payload structure.
Description check ✅ Passed The description is directly related to the changeset, explaining the motivation (stopping Ghost CI from dictating deployment policy), the payload changes (removing dry_run, should_rollout, environment), and the new structure with the deploy flag.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/trigger-cd-cleanup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.24%. Comparing base (d8b5e75) to head (c693d5c).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #26721   +/-   ##
=======================================
  Coverage   73.24%   73.24%           
=======================================
  Files        1534     1534           
  Lines      120760   120760           
  Branches    14610    14610           
=======================================
  Hits        88445    88445           
+ Misses      31300    31284   -16     
- Partials     1015     1031   +16     
Flag Coverage Δ
admin-tests 54.31% <ø> (ø)
e2e-tests 73.24% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.

ref https://linear.app/ghost/project/ghost-cicd-e70bca221364

The trigger_cd dispatch was sending deployment policy fields
(dry_run, should_rollout, environment) alongside artifact identity,
which meant Ghost CI was dictating how Moya should deploy. This made
it impossible to change deployment defaults without modifying Ghost.

Stripped the payload to identity fields only (sha, ref, image_tag,
pr_number, admin artifact IDs). Added a `deploy` flag that signals
when the deploy-to-staging label is present — this is a fact about
the PR, not a policy decision. Moya derives dry_run and should_rollout
from pr_number presence and the deploy flag.
@rob-ghost rob-ghost force-pushed the chore/trigger-cd-cleanup branch from 5800a0f to c693d5c Compare March 5, 2026 21:26
@rob-ghost rob-ghost marked this pull request as ready for review March 5, 2026 21:30
@rob-ghost rob-ghost enabled auto-merge (rebase) March 5, 2026 21:31
@rob-ghost rob-ghost merged commit 515a4d6 into main Mar 5, 2026
31 checks passed
@rob-ghost rob-ghost deleted the chore/trigger-cd-cleanup branch March 5, 2026 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant