Skip to content

Commit 5555555

Browse files
jlsajfjclaude
andcommitted
Fix: route-sync tracks the prod (release) contract, not main (staging)
demo2 main builds to staging; prod is the `release` branch. The SDK defaults to app.textql.com (prod), so syncing against main would advertise routes before prod serves them — the lead/lag break this guard exists to prevent. Default MANIFEST_REF to `release` and soft-skip when the manifest isn't on that ref yet (bootstrap), failing loudly only on real fetch errors. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 7777777 commit 5555555

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

.github/workflows/route-sync.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ jobs:
2727
env:
2828
BACKEND_REPO_NAME: ${{ vars.BACKEND_REPO_NAME || 'demo2' }}
2929
MANIFEST_PATH: ${{ vars.BACKEND_MANIFEST_PATH || 'compute/pkg/platform/v2/routes.manifest.json' }}
30-
MANIFEST_REF: ${{ vars.BACKEND_MANIFEST_REF || 'main' }}
30+
# Track the PROD contract: the SDK defaults to app.textql.com, and demo2's
31+
# `main` is staging — prod is the `release` branch. Tracking `main` would
32+
# sync the SDK ahead of what prod serves.
33+
MANIFEST_REF: ${{ vars.BACKEND_MANIFEST_REF || 'release' }}
3134
steps:
3235
- uses: actions/checkout@v4
3336
- name: Mint App token
@@ -57,8 +60,16 @@ jobs:
5760
GH_TOKEN: ${{ steps.token.outputs.value }}
5861
run: |
5962
set -euo pipefail
60-
gh api "repos/${{ github.repository_owner }}/${BACKEND_REPO_NAME}/contents/${MANIFEST_PATH}?ref=${MANIFEST_REF}" \
61-
-H "Accept: application/vnd.github.raw" > upstream.json
63+
if ! gh api "repos/${{ github.repository_owner }}/${BACKEND_REPO_NAME}/contents/${MANIFEST_PATH}?ref=${MANIFEST_REF}" \
64+
-H "Accept: application/vnd.github.raw" > upstream.json 2> fetch_err; then
65+
if grep -qi "not found" fetch_err; then
66+
echo "manifest not on '${MANIFEST_REF}' yet (or path moved); skipping"
67+
echo "changed=false" >> "$GITHUB_OUTPUT"
68+
exit 0
69+
fi
70+
cat fetch_err >&2
71+
exit 1
72+
fi
6273
changed=$(python3 -c "import json; a=set(json.load(open('upstream.json'))); b=set(json.load(open('tests/routes.manifest.json'))); print('true' if a!=b else 'false')")
6374
if [ "$changed" = "true" ]; then cp upstream.json tests/routes.manifest.json; fi
6475
echo "changed=$changed" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)