Skip to content

fix(ci): fail the tinystudio.in deploy lane loudly when Pages secrets are missing - #131

Merged
nish3451 merged 1 commit into
mainfrom
fix/deploy-public-site-fail-closed-20260813
Aug 12, 2026
Merged

fix(ci): fail the tinystudio.in deploy lane loudly when Pages secrets are missing#131
nish3451 merged 1 commit into
mainfrom
fix/deploy-public-site-fail-closed-20260813

Conversation

@nish3451

Copy link
Copy Markdown
Collaborator

What

The deploy lane's 'dormant' step printed provisioning steps and exited 0 when CLOUDFLARE_API_TOKEN/CLOUDFLARE_ACCOUNT_ID were absent from repo secrets. Every main merge therefore reported a green deploy run while production stayed stale (live acceptance currently fails 6/13 checks).

Change

  • Replace the dormant step with a fail-closed step that prints the one-time provisioning steps and exit 1 when either required secret is missing.
  • Green now means 'deployed and verified': the publish step runs check-public-live-deploy.mjs after upload and fails the run on acceptance failure; the run can no longer go green without running it.
  • Add hermetic regression scripts/test-deploy-public-site-workflow.mjs (wired into npm test/npm run ci): red on the old dormant workflow, green on the fail-closed one.

Proof

  • node scripts/test-deploy-public-site-workflow.mjs on the pre-change workflow: 3 failures, exit 1; on this branch: 10 checks, 0 failures, exit 0.
  • node scripts/test-public-deploy-bundle.mjs: 0 failures. node --check all scripts: 0.
  • npm run ci fails only on the pre-existing check-retention-automation.mjs environment issue (identical failure on a pristine origin/main worktree — automation.toml points at a different checkout; unrelated to this change).

Note

No Pages-capable Cloudflare token exists anywhere yet (fleet token tested live: Pages API error 10000; no token in any repo/environment secret). Until gh secret set CLOUDFLARE_API_TOKEN -R nish3451/tinystudio-in is done, the lane runs red — that is the intended truthful behavior; the nightly live-site-check.yml remains the staleness alarm.

… are missing

Replace the green 'dormant' step (which exited 0 when
CLOUDFLARE_API_TOKEN / CLOUDFLARE_ACCOUNT_ID were absent, making every
main merge report a deploy while production stayed stale) with a
fail-closed step that prints the provisioning steps and exits 1.

Green now means 'deployed and verified': the publish step still runs
check-public-live-deploy.mjs after upload and fails the run when the
live acceptance fails, and the run can no longer succeed without
running it.

Add scripts/test-deploy-public-site-workflow.mjs (hermetic, wired into
npm test and npm run ci) asserting the fail-closed contract: no dormant
step, a fail-loud step gated on missing secrets, deploy steps gated on
both secrets, acceptance script in the deploy path. Red on the old
workflow (dormant step), green on the new one.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@nish3451, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 46 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Free

Run ID: baf34983-b133-4484-b66b-763ae03a5c99

📥 Commits

Reviewing files that changed from the base of the PR and between a406256 and 42987aa.

📒 Files selected for processing (3)
  • .github/workflows/deploy-public-site.yml
  • package.json
  • scripts/test-deploy-public-site-workflow.mjs

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

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

@nish3451
nish3451 merged commit 78eaa91 into main Aug 12, 2026
2 checks passed
@nish3451
nish3451 deleted the fix/deploy-public-site-fail-closed-20260813 branch August 12, 2026 20:55
nish3451 added a commit that referenced this pull request Aug 13, 2026
…le PRs #130 + #131)

Resolve the draft PR #130 conflict with main after PR #131 merged the
fail-closed deploy workflow:

- deploy-public-site.yml: keep PR #131's fail-loud missing-secret step,
  env hoisting and both-secrets gates byte-for-byte; the only deltas are
  the documented capture/rollback/re-verify contract and the descriptive
  auto-rollback step name from #130.
- package.json: combine both test chains (test-operator-check-strictness,
  test-deploy-public-site-workflow from main; test-pages-release from #130).
- publish-public-site.mjs: rename runAcceptance to verifyLive so the
  merged test-deploy-public-site-workflow.mjs contract (live verification
  after deploy via check-public-live-deploy.mjs) holds on the reconciled
  branch; behavior unchanged.
nish3451 pushed a commit that referenced this pull request Aug 13, 2026
…le with main after PRs #135/#104/#99/#112/#100/#105)

The PR #130 branch had already been reconciled with origin/main through
c617364 (PRs #131 + #133/#134/#132/#116). Since then origin/main moved to
d4f3ef4 with six more merges (#135 #104 #99 #112 #100 #105). Pull them in
so PR #130 can be reviewed against current main without weakening the
capture/rollback/reverification implementation or the PR #131 fail-closed
missing-secret gate.

The merge resolved cleanly:
- PR #130 capture/rollback logic (publish-public-site.mjs canonical_deployment,
  rollbackTo, restored identity re-verify, accept-again) is intact.
- PR #130 test file (scripts/test-pages-release.mjs) is intact and wired
  into the npm ci/test scripts.
- PR #131 fail-loud missing-secret workflow step in
  .github/workflows/deploy-public-site.yml is preserved byte-for-byte.
- The new origin/main changes touch operator surfaces and the deploy
  bundle prep; none of them modify the publish-public-site.mjs rollback
  contract or the Pages token gate, so there were no conflict markers.
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