Repository navigation
Commit 1c761c0
test(create-objectstack,metadata): make two version-sensitive tests hold across the 17.5.0 version pass (#20565)
Fixes #20560
Unblocks the 17.5.0 Version Packages PR #17076
(`changeset-release/main`). Its required `Test Core (1/6)` is red on
head `de35e567` (CI run 36510180528):
```
AssertionError: scaffolded Dockerfile pins :17.4.2 but the scaffolded package.json asks for "^17.5.0" — the generated app would run a runtime image that is not the CLI building its artifact (#9017): expected false to be true
```
Both changes are test-only. No runtime code moves, and neither file
ships: both packages publish only `dist`, `README.md` and
`CHANGELOG.md`, and neither file is a tsup entry. So there is no
changeset and the PR carries `skip-changeset`.
## 1. `create-objectstack`: the runtime-image fixture (the reported
failure)
`runtime-image.test.ts` planted the npm-resolved `@objectstack/cli` as
the literal `${major}.4.2`. The scaffolder writes a caret range on its
own version, so that literal is inside the range only while the minor is
4 or lower. At 17.5.0 it falls below the floor, and the agreement test
blamed the scaffolder for what was a fixture defect.
- `resolved` is now derived from the package's own version: same major,
own minor + 1, patch 2 (17.4.0 gives 17.5.2, 17.5.0 gives 17.6.2). It is
always inside the caret range and always above its floor, which is what
the fixture's own comment says it is for.
- A new precondition test, `plants a resolved version inside the
scaffolded range and above its floor`, makes future fixture drift point
at the fixture rather than at the scaffolder.
I checked the other create-objectstack tests for a current-minor
assumption. They key on the major only (`template-consistency`), use
fixed literals unrelated to the package version (the
`readResolvedCliVersion` cases, `banner-version`), or carry a fixture
version of their own (`template-version-stamps`). The whole suite passes
on the versioned tree (table below).
## 2. `metadata`: artifact-door notice wording (found by running the
unreached shard-1 packages on the versioned tree)
Turbo stopped shard 1 at the failure above, so ten scheduled packages
never ran against 17.5.0. Running them found one more failure of the
same class:
```
FAIL src/plugin-artifact-forward-conversion-retired-after.test.ts > [#20390] artifact door — a 17.4.0-built artifact boots on unreleased main > logs one conversion summary per retired entry it replayed, naming the site count
AssertionError: expected '[MetadataPlugin] artifact \'forward-p…' not to contain 'predates this runtime\'s spec'
```
The fixture is a 17.4.0-built artifact (`engines.protocol: ^17.4.0`).
While `packages/spec` carries the 17.4.0 label, the floor is not below
the label. The per-entry half of the window opens
(`converted-retired-after`), and its clause deliberately avoids
"predates". The version pass moves the label to 17.5.0 and the floor
falls below it. The label half opens instead (`converted-forward`), and
the door correctly prints `predates this runtime's spec (authored
engines.protocol floor 17.4.0, runtime spec 17.5.0)`. The runtime
behaves as designed; the assertion had the pre-release label built in.
The assertion now reads the running spec label the same way the door
does, with `resolveInstalledSpecVersion()`.
`plugin-artifact-forward-conversion.test.ts` already uses that pattern.
The test then pins the exact clause of whichever half that label
selects. Both halves were exercised: the per-entry clause on `main`
(label 17.4.0), and the `predates` clause with the exact floor and
runtime version on the versioned tree (label 17.5.0).
## Verification on the versioned tree
I made a throwaway worktree at `origin/changeset-release/main` =
`de35e567`, the #17076 head that the failing run tested, and copied both
fixes in. Then:
1. `pnpm install --frozen-lockfile`.
2. `pnpm turbo run build` over each package's dependency closure
(`--filter='PKG^...'`; 61 tasks, 0 cached).
3. Each package's own script via `pnpm --filter PKG run SCRIPT`, with
the env Test Core sets (`OS_TEST_TIERS=queue`, `CI=true`).
| Package | Script | Result on de35e56 + this PR |
|---|---|---|
| create-objectstack | test | pass: 16 files / 234 tests. Without the
fix: 1 failed, the assertion quoted above |
| @objectstack/spec | test | pass: 573 / 16846, 1 todo |
| @objectstack/spec | test:repo | pass: 40 / 716 |
| @objectstack/verify | test | pass: 15 / 116 |
| @objectstack/metadata | test | pass: 55 / 826. Without the fix: 1
failed, the assertion quoted in section 2 |
| @objectstack/plugin-audit | test | pass: 25 / 363 |
| @objectstack/example-todo | test | pass: 7 / 238 |
| @objectstack/trigger-record-change | test | pass: 10 / 101 |
| @objectstack/formula | test | pass: 42 / 1227 |
| @objectstack/downstream-contract | test | pass: 3 / 31 |
| @objectstack/service-cluster-redis | test | pass: 3 / 37 |
| @objectstack/knowledge-ragflow | test | pass: 1 / 10 |
Of shard 1's other scheduled packages, `@objectstack/types` had already
passed in that run, and shards 2–6 were green. So every package that run
scheduled has now passed against the `de35e567` tree.
## Checks on this branch (base `b0574343`)
- `pnpm --filter create-objectstack test`: 16 files / 234 tests pass;
`typecheck` clean.
- `pnpm --filter @objectstack/metadata test`: 55 / 826 pass (the
per-entry half); `typecheck` clean.
- `eslint` on both changed files: clean.
`main` has since moved to `f6ceddc3`, six commits on. None of them
touches `packages/create-objectstack`, `packages/metadata` or
`packages/metadata-core`.
A wider gap is tracked separately in #20562 and not addressed here: a
version-sensitive test is only exercised after `pnpm run version`.
---
_Generated by [Claude
Code](https://claude.ai/code/session_014VGCS11YUtYAiinRcdqQwL)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent dee9b26 commit 1c761c0
2 files changed
Lines changed: 55 additions & 5 deletions
File tree
- packages
- create-objectstack/src
- metadata/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
99 | 106 | | |
100 | 107 | | |
101 | 108 | | |
| |||
104 | 111 | | |
105 | 112 | | |
106 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
107 | 127 | | |
108 | 128 | | |
109 | 129 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
61 | 70 | | |
62 | 71 | | |
63 | 72 | | |
| |||
111 | 120 | | |
112 | 121 | | |
113 | 122 | | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
118 | 148 | | |
119 | 149 | | |
120 | 150 | | |
| |||
0 commit comments