docs(agents): clarify deploy environment target (staging vs production)#161
Conversation
The Deployment section showed only `gh workflow run deploy.yml`, which runs as staging (the workflow_dispatch default) and silently skips all WordPress theme/plugin steps — so backend changes don't ship even though the run goes green. Document that: - a release always deploys production; - workflow_dispatch defaults to staging; - production ships frontend + backend (theme/plugin), staging ships frontend only (WP steps are gated on ENVIRONMENT == 'production'); - backend changes require `-f environment=production`; - how to confirm the WP steps ran (not skipped), plus the transient kex_exchange_identification scp failure. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
📝 WalkthroughWalkthroughThis PR updates ChangesDeployment Documentation Update
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@AGENTS.md`:
- Around line 256-277: Run Prettier to fix the formatting errors in AGENTS.md by
reformatting the file; specifically run the repository's prettier formatter
(e.g., prettier --write AGENTS.md) so the "Deploys via GitHub Actions" section,
code blocks (bash examples), bullet lists, and inline emphasis match the
project's style rules and CI will pass.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
| Deploys via GitHub Actions (`deploy.yml`, SSH tar + scp). A published GitHub **release** always deploys to **production**. A manual `workflow_dispatch` takes an `environment` input (`production` or `staging`) that **defaults to `staging`**. | ||
|
|
||
| **The target controls what ships:** | ||
|
|
||
| - **`production`** — ships **both** the Next.js frontend **and** the WordPress backend (theme + plugin tarballs, plugin activation, OPcache flush). Use this for any change under `wordpress/themes/**` or `wordpress/plugins/**` — `functions.php`, REST handlers/routes, CPT/ACF registration, etc. | ||
| - **`staging`** — ships **only** the Next.js frontend. All WordPress theme/plugin steps are gated on `env.ENVIRONMENT == 'production'` and are **skipped** on staging (staging shares the production WP backend, so it must never push theme/plugin from a staging deploy). | ||
|
|
||
| > ⚠️ A bare `gh workflow run deploy.yml` runs as **staging**, so backend changes are **not** deployed — yet the run still succeeds (the frontend ships and smoke tests pass). Symptom: a new `cdcf/v1` route 404s or theme behaviour is unchanged after a "green" deploy. Always pass `-f environment=production` for backend changes. | ||
|
|
||
| ```bash | ||
| gh workflow run deploy.yml # after pushing to main | ||
| # Deploy frontend + backend (theme/plugin changes) — after pushing to main: | ||
| gh workflow run deploy.yml -f environment=production | ||
|
|
||
| # Deploy frontend only (Next.js): | ||
| gh workflow run deploy.yml -f environment=staging # or just: gh workflow run deploy.yml | ||
|
|
||
| # Confirm the WP theme/plugin steps actually ran (must be `success`, not `skipped`): | ||
| gh run view <run-id> --json jobs \ | ||
| -q '.jobs[].steps[] | select(.name|test("WP theme|OPcache|plugins")) | "\(.conclusion)\t\(.name)"' | ||
| ``` | ||
|
|
||
| The scp upload step occasionally fails transiently with `kex_exchange_identification: read: Connection reset by peer` (VPS SSH rate-limit after back-to-back deploys) — just re-run. |
There was a problem hiding this comment.
Fix Prettier formatting issues.
The CI pipeline detected code style issues. Run the following command to fix them:
prettier --write AGENTS.md🧰 Tools
🪛 LanguageTool
[uncategorized] ~260-~260: The official name of this content management system is spelled with a capital “P”.
Context: ...e flush). Use this for any change under wordpress/themes/** or wordpress/plugins/** — ...
(WORDPRESS)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@AGENTS.md` around lines 256 - 277, Run Prettier to fix the formatting errors
in AGENTS.md by reformatting the file; specifically run the repository's
prettier formatter (e.g., prettier --write AGENTS.md) so the "Deploys via GitHub
Actions" section, code blocks (bash examples), bullet lists, and inline emphasis
match the project's style rules and CI will pass.
Documents the
deploy.ymlenvironment behavior, which previously bit a deploy:gh workflow run deploy.ymlruns as staging (theworkflow_dispatchdefault), which skips all WordPress theme/plugin steps (gated onENVIRONMENT == 'production') — so backend changes don't ship, yet the run still goes green.functions.php, REST handlers/routes, CPT/ACF) require-f environment=production.skipped) and a note on the transientkex_exchange_identificationscp failure.Docs-only (repo-root
AGENTS.md, symlinked fromCLAUDE.md); nothing deploys.🤖 Generated with Claude Code
Summary by CodeRabbit