ci(spec-sync): read specs from live staging instead of S3 - #136
Merged
Conversation
Revert the V1/V2 spec source from the S3 copy back to live staging (api.va.staging, aide.staging — both now public and fetchable without auth). Since staging auto-reclaims and must be booked, an unreachable spec URL is now the expected case: the fetch-error step skips (logs and exits 0) instead of failing, so the run opens no PR and sends no Slack alert. The failure alert now covers only AI-wiring and generic failures. Docs and comments updated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Switches spec-sync from S3 snapshots to live staging OpenAPI endpoints and treats unavailable staging environments as no-op runs.
Changes:
- Uses live V1 and V2 staging spec URLs.
- Skips failed spec fetches without Slack alerts.
- Updates contributor and design documentation.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
.github/workflows/spec-sync.yml |
Updates spec sources and fetch-failure handling. |
CONTRIBUTING.md |
Documents live staging synchronization. |
docs/design/stainless-exit-and-v2.md |
Records unauthenticated spec availability. |
Comments suppressed due to low confidence (2)
.github/workflows/spec-sync.yml:292
- This skips every operational error, not just an unreachable staging host.
check-drift.shmaps all non-0/10 failures together, so malformed JSON (jqfailure), script regressions, and local filesystem errors now make the job succeed silently. Please give the expected curl-unavailable case a dedicated exit code and skip only that code; other failures should still fail and alert.
if: steps.drift.outputs.code != '0' && steps.drift.outputs.code != '10'
run: echo "spec fetch/normalize failed (exit ${{ steps.drift.outputs.code }}); staging is likely unbooked — skipping this run."
.github/workflows/spec-sync.yml:289
- The release-safety claim is currently false:
.github/workflows/release.ymlnever invokesscripts/spec-sync/release-gate.sh, as also documented indocs/design/v2-spec-sync-extension.md:96-106. This is especially relevant to V2 because the existing gate script only knows the V1 production URL and snapshot; remove this rationale unless both gates are wired.
# the next hourly run picks up any drift once staging is booked, and the release gate reads the
# always-online production spec, so releases are unaffected.
Address Copilot review. The previous skip treated every non-0/10 exit from check-drift.sh as an expected no-op, silently swallowing a reachable-but-empty/invalid spec, malformed JSON, or a script error. Give the unreachable-source case a dedicated exit 20 in fetch-normalize.sh (curl fetched separately from jq), and skip only that; every other failure now falls through to a new "Fail on spec error" step and fires the Slack alert. Also drop the incorrect note that the (unwired) release gate keeps releases unaffected. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ing-revert-236873 # Conflicts: # scripts/spec-sync/fetch-normalize.sh
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
scripts/spec-sync/fetch-normalize.sh:15
curl -ffails for HTTP 4xx/5xx as well as transport errors, so this maps a reachable endpoint returning 401, 404, or 500 to exit 20. Both workflow jobs then treat those authentication/routing/service regressions as an expected no-op with no alert. Map only the transport failures expected for an unbooked cluster to 20 and make every other curl failure an operational error.
raw="$(curl -fsSL --max-time 30 --retry 3 --retry-delay 2 "$url")" || exit 20
yzld2002
approved these changes
Jul 30, 2026
…alert) Address Copilot review on #136. `curl -f` collapsed every 4xx/5xx into a single exit code, so this mapped an auth regression (401/403) and a persistent 5xx server error to the same exit 20 as an unbooked cluster — skipping them silently. fetch-normalize.sh now inspects the HTTP status: a transport failure (DNS/refused/timeout) and a 404 (an unbooked staging cluster's response — see the book-ade flow) exit 20 and are treated as the expected no-op; any other non-200 (401/403/5xx), an empty/invalid spec, or a script error exits non-20 and fires the Slack alert. Workflow comments, check-drift.sh, and CONTRIBUTING.md updated to match. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
Suppressed comments (1)
scripts/spec-sync/fetch-normalize.sh:18
- This maps every
curlfailure to the expected-unavailable code, including certificate errors (60), malformed URLs (3), and local output/write failures (23). Those are configuration or runner errors, but both jobs will now succeed without the promised alert. Reserve exit 20 for the intended DNS/connect/timeout statuses and map other curl failures to an operational error.
code="$(curl -sS --max-time 30 --retry 3 --retry-delay 2 -o "$body" -w '%{http_code}' "$url")" || exit 20
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.
Revert spec-sync's spec source from the S3 copy back to live staging (V1
api.va.staging, V2aide.staging— both now public/no-auth).Staging auto-reclaims, so an unreachable spec URL is now an expected no-op: the fetch-error step skips instead of failing (no PR, no Slack alert). The failure alert keeps only the AI-wiring/generic cases. Docs and comments updated.
🤖 Generated with Claude Code