Skip to content

Commit cddde25

Browse files
committed
ci(adcp-sdk): pin @adcp/sdk to 7.10.1, salt cache key with version
@adcp/sdk@latest was floating, and the npm cache key ``${{ runner.os }}-npm-adcp-sdk`` was OS-only — so a runner that cached an older release served stale SDK to every subsequent CI run on that runner, while a fresh runner pulled the current @latest. Same commit flipped red/green depending on which runner picked it up (see 2026-05-21 storyboard incident, adcp#4907). - ADCP_SDK_VERSION env var pinned at workflow header (7.10.1). - All 4 ``npm install -g @adcp/sdk@latest`` sites use the pin. - All 4 cache keys salted with ${{ env.ADCP_SDK_VERSION }} so a bump invalidates deterministically. - Stale comments rationalizing @latest removed. Bumping the SDK version now happens via PR — silent-upgrade footgun closed. Tracks adcp-client-python#779 Track B and adcp#4907 Phase 1.
1 parent 35f581d commit cddde25

1 file changed

Lines changed: 25 additions & 22 deletions

File tree

.github/workflows/ci.yml

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ on:
66
pull_request:
77
branches: [main]
88

9+
# Pinned @adcp/sdk version. Bump deliberately; cache invalidates when this moves.
10+
# Background: adcontextprotocol/adcp-client-python#779 (Track B), adcontextprotocol/adcp#4907.
11+
env:
12+
ADCP_SDK_VERSION: "7.9.0"
13+
914
concurrency:
1015
group: ci-${{ github.ref }}
1116
cancel-in-progress: true
@@ -369,28 +374,23 @@ jobs:
369374

370375
# Cache the npm tarball + extracted package directory so the
371376
# storyboard runner install isn't a cold network fetch every run.
372-
# Key by OS only (not by version) so the cache survives across
373-
# ``@adcp/sdk`` releases — npm install reuses tarballs that are
374-
# already in the cache and only fetches the delta. ``@latest`` is
375-
# intentional for drift detection (see "Run storyboard suite"
376-
# below); the cache amortizes the 5-15 s of fetch+extract that
377-
# would otherwise repeat on every CI run.
377+
# Cache key is salted with the pinned ``@adcp/sdk`` version so
378+
# bumping ADCP_SDK_VERSION invalidates the cache deterministically.
378379
- name: Cache ~/.npm
379380
uses: actions/cache@v4
380381
with:
381382
path: ~/.npm
382-
key: ${{ runner.os }}-npm-adcp-sdk
383+
key: ${{ runner.os }}-npm-adcp-sdk-${{ env.ADCP_SDK_VERSION }}
383384
restore-keys: |
384385
${{ runner.os }}-npm-
385386
386387
- name: Pre-install @adcp/sdk (once, then call binary directly)
387388
# Single install step at the top of the job; subsequent runner
388389
# calls invoke the already-installed binary instead of paying
389390
# the ``npx -y -p ...`` per-invocation extract+link tax.
390-
# ``@adcp/sdk@latest`` is intentionally unpinned: this is AdCP's
391-
# own CI running AdCP's own canonical runner — tracking latest
392-
# surfaces protocol drift as soon as it ships, which is the
393-
# point of this job.
391+
# Pinned to ADCP_SDK_VERSION (see workflow header) — bump via PR
392+
# so reference-impl breakage from a new SDK release shows up as
393+
# a labelled change set, not silent CI flake.
394394
#
395395
# Vendor missing fixtures into the SDK install:
396396
# ``@adcp/sdk`` does not ship two fixtures its storyboard runner
@@ -403,13 +403,18 @@ jobs:
403403
# into the SDK's expected locations post-install; idempotent if
404404
# upstream later ships them in the npm tarball.
405405
run: |
406-
npm install -g @adcp/sdk@latest
406+
npm install -g @adcp/sdk@${ADCP_SDK_VERSION}
407407
adcp --version
408408
SDK_ROOT="$(npm root -g)/@adcp/sdk"
409409
mkdir -p "${SDK_ROOT}/test/lib/v2-projection-fixtures"
410410
cp tests/fixtures/aao-reference-formats.json "${SDK_ROOT}/test/lib/v2-projection-fixtures/aao-reference-formats.json"
411411
mkdir -p "${SDK_ROOT}/schemas/cache/3.1.0-beta.2/registries"
412412
cp tests/fixtures/v1-canonical-mapping.json "${SDK_ROOT}/schemas/cache/3.1.0-beta.2/registries/v1-canonical-mapping.json"
413+
SDK_ROOT="$(npm root -g)/@adcp/sdk"
414+
mkdir -p "${SDK_ROOT}/test/lib/v2-projection-fixtures"
415+
cp tests/fixtures/aao-reference-formats.json "${SDK_ROOT}/test/lib/v2-projection-fixtures/aao-reference-formats.json"
416+
mkdir -p "${SDK_ROOT}/schemas/cache/3.1.0-beta.2/registries"
417+
cp tests/fixtures/v1-canonical-mapping.json "${SDK_ROOT}/schemas/cache/3.1.0-beta.2/registries/v1-canonical-mapping.json"
413418
414419
- name: Install dependencies
415420
run: |
@@ -541,15 +546,13 @@ jobs:
541546
with:
542547
node-version: "22"
543548

544-
# Cache ~/.npm by OS only so subsequent runs hit the tarball
545-
# cache; npm install reuses what's there and only fetches the
546-
# delta on a new ``@latest`` release. See the storyboard job
547-
# above for the same pattern + rationale.
549+
# Same cache pattern as the storyboard job: keyed by
550+
# ADCP_SDK_VERSION so a bump invalidates deterministically.
548551
- name: Cache ~/.npm
549552
uses: actions/cache@v4
550553
with:
551554
path: ~/.npm
552-
key: ${{ runner.os }}-npm-adcp-sdk
555+
key: ${{ runner.os }}-npm-adcp-sdk-${{ env.ADCP_SDK_VERSION }}
553556
restore-keys: |
554557
${{ runner.os }}-npm-
555558
@@ -567,7 +570,7 @@ jobs:
567570
# See the comment on the storyboard job's install step for the
568571
# AAO reference-formats fixture rationale (upstream adcp#3307).
569572
run: |
570-
npm install -g @adcp/sdk@latest
573+
npm install -g @adcp/sdk@${ADCP_SDK_VERSION}
571574
adcp --version
572575
SDK_ROOT="$(npm root -g)/@adcp/sdk"
573576
mkdir -p "${SDK_ROOT}/test/lib/v2-projection-fixtures"
@@ -775,15 +778,15 @@ jobs:
775778
uses: actions/cache@v4
776779
with:
777780
path: ~/.npm
778-
key: ${{ runner.os }}-npm-adcp-sdk
781+
key: ${{ runner.os }}-npm-adcp-sdk-${{ env.ADCP_SDK_VERSION }}
779782
restore-keys: |
780783
${{ runner.os }}-npm-
781784
782785
- name: Pre-install @adcp/sdk
783786
# See the comment on the storyboard job's install step for the
784787
# AAO reference-formats fixture rationale (upstream adcp#3307).
785788
run: |
786-
npm install -g @adcp/sdk@latest
789+
npm install -g @adcp/sdk@${ADCP_SDK_VERSION}
787790
adcp --version
788791
SDK_ROOT="$(npm root -g)/@adcp/sdk"
789792
mkdir -p "${SDK_ROOT}/test/lib/v2-projection-fixtures"
@@ -883,15 +886,15 @@ jobs:
883886
uses: actions/cache@v4
884887
with:
885888
path: ~/.npm
886-
key: ${{ runner.os }}-npm-adcp-sdk
889+
key: ${{ runner.os }}-npm-adcp-sdk-${{ env.ADCP_SDK_VERSION }}
887890
restore-keys: |
888891
${{ runner.os }}-npm-
889892
890893
- name: Pre-install @adcp/sdk
891894
# See the comment on the storyboard job's install step for the
892895
# AAO reference-formats fixture rationale (upstream adcp#3307).
893896
run: |
894-
npm install -g @adcp/sdk@latest
897+
npm install -g @adcp/sdk@${ADCP_SDK_VERSION}
895898
adcp --version
896899
SDK_ROOT="$(npm root -g)/@adcp/sdk"
897900
mkdir -p "${SDK_ROOT}/test/lib/v2-projection-fixtures"

0 commit comments

Comments
 (0)