fix(bb): TRA-743 — check-deploy-lag.sh compares against preview, not main#160
Merged
Merged
Conversation
…t `main` Two bugs in the script as shipped in PR #158: 1. **Wrong branch.** Cloudflare Pages deploys `docs.preview.trakrf.id` from the `preview` branch (force-pushed by `.github/workflows/sync-preview.yml` = main + all open non-draft PRs). The script was comparing the deployed docs commit against `origin/main`, which is the merge target, not the ref preview actually serves. With work in flight on PR branches synced to `preview`, the deployed commit would normally lead `origin/main` and the check would (silently) pass even when preview lagged behind newer PR work. 2. **Required a local docs checkout.** Used `git fetch origin main` + `git rev-parse origin/main`. `bb_cycle` copies `tests/blackbox/` to `/tmp/bb-N/` for the BB session — `/tmp` has no git context, so the script would silently exit 2 if ever run from there. The retired `check-spec-sync.sh` queried the GitHub public API for the branch tip instead; that pattern is location-independent and `trakrf/docs` is public so no auth needed. Switched to the GitHub-API-based check from the retired predecessor. Kept the graceful WARN-and-skip fallback for GitHub rate limits / network blips (exit 0 with a warning rather than fail-closed — the script's job is to fail-fast on real deploy lag, not on its own observability gap). Verified against live preview: `4d213d3` (deployed) matches `preview@4d213d3` (GitHub branch tip). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
🚀 Preview Deployment Update ✅ This PR has been successfully merged into the preview branch. The preview environment will update shortly at: https://docs.preview.trakrf.id |
Deploying docs with
|
| Latest commit: |
1617067
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://570a41c5.docs-4n7.pages.dev |
| Branch Preview URL: | https://preview.docs-4n7.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TRA-743 — fix two bugs in
check-deploy-lag.sh(introduced in PR #158).Bug 1: wrong branch
Cloudflare Pages deploys
docs.preview.trakrf.idfrom thepreviewbranch (force-pushed by.github/workflows/sync-preview.yml=main+ all open non-draft PRs). The script was comparing the deployed docs commit againstorigin/main— the merge target, not the ref preview actually serves.In practice the deployed commit usually leads
origin/main(sincepreviewcarries open-PR work too). So the inequality check would silently pass even when CF Pages was lagging behind the latestpreviewtip.Verified on the previous merge: after PR #158 landed,
docs.preview.trakrf.id/health.jsonreportedcommit: "7ec727c"whileorigin/mainwasb76860dandorigin/previewwas7ec727c. The right ref waspreview.Bug 2: required a local docs checkout
The script used
git fetch origin main+git rev-parse origin/main. Butbb_cyclecopiestests/blackbox/to/tmp/bb-N/for the BB session —/tmphas no git context, so the script would silently exit 2 if run from there.The retired
check-spec-sync.shqueried the GitHub public API for the branch tip instead — location-independent, andtrakrf/docsis public so no auth needed.Fix
Ported the GitHub-API-based check from the retired predecessor. Kept the graceful WARN-and-skip fallback for GitHub rate limits / network blips (exit 0 with a warning rather than fail-closed — the script's job is to fail-fast on real deploy lag, not on its own observability gap).
Test plan
API_TEST_DOCS_URL=https://docs.preview.trakrf.id bash tests/blackbox/check-deploy-lag.shreturnsOK: preview docs on 4d213d3 (matches preview@4d213d3).bash scripts/test_bb_cycle.sh— 8/8 pass (theBB_SKIP_PREFLIGHT=1test path is unaffected)🤖 Generated with Claude Code