Re-enable deploy-to-staging label workflow (Step 6/6)#27076
Re-enable deploy-to-staging label workflow (Step 6/6)#27076
Conversation
Removed the false guard and disabled comments. Added unlabeled/closed handlers that dispatch to Ghost-Moya to clear version pins and deactivate GitHub deployments. refs https://www.notion.so/ghost/31951439c03081daa133eb0215642202
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/deploy-to-staging.yml:
- Around line 158-161: The workflow YAML contains a hardcoded staging site ID
"303000" without explanation. Add an inline comment next to the "site_ids":
"303000" line to clarify that this value is the staging site ID. This will help
future maintainers understand the purpose of this constant in the
deploy-to-staging job.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 8318d3f1-6a54-48f5-b6fc-dbec32ccc8fa
📒 Files selected for processing (2)
.github/workflows/ci.yml.github/workflows/deploy-to-staging.yml
| client-payload: >- | ||
| { | ||
| "site_ids": "303000", | ||
| "pr_number": "${{ github.event.pull_request.number }}" |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Search for references to site_ids or 303000 in the repository to understand context
rg -n '303000' --type yaml --type json
rg -nP 'site_ids?\s*[=:]' --type yaml -C2Repository: TryGhost/Ghost
Length of output: 40
🏁 Script executed:
# Search for references to unpin-staging-sites event and Ghost-Moya
rg -n 'unpin-staging-sites'
rg -n 'Ghost-Moya\|ghost-moya'
rg -n 'site_ids\|site.id'
# Check if there's documentation about the site IDs
rg -in 'staging.*site.*id\|site.*303000'
# Get the full deploy-to-staging.yml file to understand context
fd 'deploy-to-staging.yml' --exec cat -n {}Repository: TryGhost/Ghost
Length of output: 40
🏁 Script executed:
# First, verify the file exists and get its location
fd 'deploy-to-staging.yml'
# Try to read the specific file mentioned in the review
cat -n .github/workflows/deploy-to-staging.yml | sed -n '125,165p'
# Also search for any comments or documentation in the workflow file
cat -n .github/workflows/deploy-to-staging.yml | grep -A5 -B5 'site_ids\|unpin-staging\|303000'Repository: TryGhost/Ghost
Length of output: 2160
🏁 Script executed:
# Search for any documentation or comments about the staging site or site_ids
rg -n 'site.id\|site_id\|staging.*site\|303' .github/workflows/
# Look for any README or documentation files that might explain the site configuration
fd -e md -e txt -e json | xargs rg -l 'staging\|site.*id' 2>/dev/null | head -20
# Check if there are any comments in the workflow file around this section
cat -n .github/workflows/deploy-to-staging.yml | sed -n '100,125p'
# Check the end of the file for any documentation
tail -50 .github/workflows/deploy-to-staging.yml | cat -nRepository: TryGhost/Ghost
Length of output: 3460
Add a comment explaining the hardcoded staging site ID.
The site_ids: "303000" is a magic constant with no explanation. Add an inline comment (e.g., # Staging site ID) to clarify what this ID represents for future maintainers.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.github/workflows/deploy-to-staging.yml around lines 158 - 161, The workflow
YAML contains a hardcoded staging site ID "303000" without explanation. Add an
inline comment next to the "site_ids": "303000" line to clarify that this value
is the staging site ID. This will help future maintainers understand the purpose
of this constant in the deploy-to-staging job.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #27076 +/- ##
=======================================
Coverage 73.19% 73.20%
=======================================
Files 1531 1531
Lines 121796 121796
Branches 14695 14695
=======================================
+ Hits 89154 89158 +4
+ Misses 31646 31623 -23
- Partials 996 1015 +19
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|


Summary
Re-enables the
deploy-to-staginglabel workflow that was disabled due to admin deploys being global and main merges overwriting targeted server deploys. Both problems are now solved by per-site version pinning (Steps 1-5).Changes
false &&guard and disabled comments. Addedunlabeledandclosedevent handlers that dispatch to Ghost-Moya to clear version pins and deactivate GitHub deployments.deploy-to-staginglabel detection in thetrigger_cdjob so PR CI dispatches includedeploy=truewhen the label is present.How it works now
deploy-to-staginglabel → Ghost CI dispatches to Moya withdeploy=truemainskip demo.ghost.is (pinned)unpin-staging-sitesto Moya → pins clearedProposal
https://www.notion.so/ghost/31951439c03081daa133eb0215642202
Merge order
This is Step 6 of 6 — must be merged last, after all infrastructure is deployed to staging.
ref: https://linear.app/ghost/issue/BER-3516/ghost-re-enable-deploy-to-staging-label-workflow