Skip to content

Commit 9358d62

Browse files
StuBehanybidois
andcommitted
ci: add a v7 leg and assert the resolved ai version
Co-Authored-By: Yannick Bidois <yannick@lekanoe.com>
1 parent d03e2e2 commit 9358d62

1 file changed

Lines changed: 24 additions & 6 deletions

File tree

‎.github/workflows/ci.yaml‎

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,19 @@ jobs:
6161
run: pnpm test
6262

6363
# The `ai` peer range spans three majors whose tool types differ, so the
64-
# single build-and-test job above only ever proves the version pinned in the
65-
# dev catalog. This job checks the rest of the declared range.
64+
# single build-and-test job above only ever proves whichever version the dev
65+
# catalog pins. This job covers the declared range independently of that pin.
6666
#
67-
# Versions are pinned rather than ranged: newer v5/v6 patches resolve
68-
# transitive packages that this repo's `trustPolicy: no-downgrade` rejects,
69-
# which would fail CI for reasons unrelated to the code under test.
67+
# Every entry is an exact version, not a range. A range resolves to whatever
68+
# the lockfile already holds unless the lockfile is deleted, and deleting it
69+
# re-resolves every dependency to its newest in-range version, which trips
70+
# this repo's `trustPolicy: no-downgrade` on unrelated packages. Each pin is
71+
# therefore a boundary worth holding still:
72+
# v5 - the lower bound of the declared peer range
73+
# v6 - the last v6 the dev catalog shipped
74+
# v7 - the major boundary where the AI SDK tool types changed shape
75+
# The newest v7 is not covered here; build-and-test covers whatever the dev
76+
# catalog pins, which is the only v7 that moves.
7077
ai-peer-range:
7178
name: ai-peer-range (${{ matrix.ai }})
7279
runs-on: ubuntu-latest
@@ -76,6 +83,7 @@ jobs:
7683
ai:
7784
- 5.0.108 # lower bound of the peer range
7885
- 6.0.7 # last v6 the dev catalog shipped
86+
- 7.0.0 # first v7, where Tool became a union
7987
steps:
8088
- name: Checkout repository
8189
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -87,11 +95,21 @@ jobs:
8795

8896
# `--filter .` keeps the examples workspace out of resolution; it pulls a
8997
# dependency that `blockExoticSubdeps` rejects on any lockfile update.
98+
#
99+
# Assert the resolved version, not just that the edit looked applied. A
100+
# `sed` that stops matching would otherwise leave the catalog untouched
101+
# and the job would pass while silently testing the version it was meant
102+
# to replace.
90103
- name: Install with ai@${{ matrix.ai }}
91104
run: |
92105
sed -i -E "/^ dev:/,/^ [a-z]+:/ s|^ ai: .*| ai: '${{ matrix.ai }}'|" pnpm-workspace.yaml
93-
grep -nE "^ ai: " pnpm-workspace.yaml
94106
pnpm install --no-frozen-lockfile --filter .
107+
resolved=$(node -p "require('./node_modules/ai/package.json').version")
108+
echo "resolved ai@$resolved"
109+
if [ "$resolved" != "${{ matrix.ai }}" ]; then
110+
echo "::error::expected ai@${{ matrix.ai }} but resolved ai@$resolved"
111+
exit 1
112+
fi
95113
96114
# Type errors are the failure mode here, and vitest type-checks the suite
97115
# via the root project's `typecheck` config.

0 commit comments

Comments
 (0)