Skip to content

Phase 1: serialize + gate backend deploys (#897) - #934

Merged
neuromechanist merged 2 commits into
feature/issue-896-epic-arch-hardeningfrom
feature/issue-897-phase1-deploy-safety
Jul 6, 2026
Merged

neuromechanist merged 2 commits into
feature/issue-896-epic-arch-hardeningfrom
feature/issue-897-phase1-deploy-safety

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Summary

Fixes the P0 where every release double-deploys production ungated (verified live 2026-07-02). deploy-backend.yml had no concurrency: and no test dependency, so the dev->main merge commit and auto-tag's strip commit (both match backend/** via package.json) fired wrangler d1 migrations apply + wrangler deploy to prod in parallel, racing tests.

  • concurrency: deploy-backend-${{ github.ref }} (cancel-in-progress: false) — the two release commits now deploy sequentially; a queued deploy waits rather than cancelling an in-flight prod migration.
  • test-gate job — typecheck + lint + pure unit tests (auto-classified identically to test.yml's required unit-pure tier). Both deploy-dev and deploy-production needs: it, so a red build can't reach either environment.
  • Release-tag drift notice — post-deploy ::notice::/::warning:: on whether the deployed commit is a tagged release (git-tag vs running-Worker drift).

Test plan

  • actionlint clean (only pre-existing SC2086 info notes on the untouched detect-environment step).
  • test/workflow-yaml.test.ts passes (13 tests) — validates the workflow parses.
  • Gate logic: test-gate runs for any dev/main push (environment != ''); deploy jobs are skipped if it fails (needs:).

Closes #897
Part of epic #896

Epic #896 Phase 1 (#897). Prod was double-deployed ungated: the dev->main
merge commit and the auto-tag strip commit both match backend/** and fired
migrate+deploy to production in parallel, racing tests.
- concurrency group deploy-backend-${{ github.ref }} (cancel-in-progress:false)
  serializes deploys per ref; the two release commits now deploy sequentially.
- new test-gate job (typecheck + lint + pure unit tests, mirroring test.yml's
  required tier); both deploy jobs needs: it, so a red build can't deploy.
- post-deploy release-tag drift notice (git tag vs deployed commit).
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR934

Version: 0.8.76-PR934.63eaa7d
Commit: 63eaa7d


🤖 Updated on each push.

Review found the gate was a no-op: deploy jobs have a custom if: (env
check), which drops GitHub Actions' implicit needs-success gate, so a
FAILED test-gate would not block the deploy. Add explicit
needs.test-gate.result == 'success' to both deploy jobs.
@neuromechanist

Copy link
Copy Markdown
Contributor Author

Review (sonnet) — findings addressed in 8a40d3e

  • [critical] the gate was a no-op: because the deploy jobs carry a custom if:, GitHub Actions drops the implicit needs-success gate, so a failing test-gate would NOT block the deploy. Fixed by adding && needs.test-gate.result == 'success' to both deploy-dev and deploy-production. actionlint + workflow-yaml test still green.
  • [moderate] backend/src has no lint coverage anywhere (pre-existing, not a regression) → filed backend/src has no lint coverage in CI #936.
  • [moderate] cancel-in-progress: false queues depth 1 — sufficient for the documented 2-commit release pattern; a 3rd rapid push is self-correcting (monotonic commits). Left as-is.
  • [suggestion] fetch-depth: 0 is more than the drift check needs but is the safe/simple choice. Left as-is.

@neuromechanist
neuromechanist merged commit ef02939 into feature/issue-896-epic-arch-hardening Jul 6, 2026
1 check passed
@neuromechanist
neuromechanist deleted the feature/issue-897-phase1-deploy-safety branch July 6, 2026 21:27

This branch was previously deployed

1 inactive deployment
npm — 8a40d3ed Deployed Jul 6, 2026 by neuromechanist via publish #1692
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