Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
14 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/browser-run-web-peer-floor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@e2e-dev/browser-run": patch
---

Requires `@e2e-dev/web` 0.16.0 or later.
7 changes: 7 additions & 0 deletions .changeset/engine-peer-floors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@e2e-dev/acp": patch
"@e2e-dev/limrun": patch
---

- acp: `e2e` peer floor `>=0.21.4` to `>=0.22.0`, the first version exporting the `e2e/agent` rules and tools it imports.
- limrun: mobile peer floor `>=0.11.1` to `>=0.12.0`, the first mobile release with the provider-owned local daemon change from #988.
9 changes: 8 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,14 @@ trees, on both platforms, without a device.
newer sibling's export or contract field;
`scripts/check-peer-ranges.ts` (`pnpm check`) fails on any other shape for
every peer one package under `packages/` has on another (vendor SDK peers
such as `@onkernel/sdk` are not checked). Narrow or exact, every runner minor (exact: every patch too)
such as `@onkernel/sdk` are not checked). The floor must name a version the
sibling released, or the sibling's version in the same release, and a raise
past a runner minor the previous range accepted needs a `**Breaking:**`
Comment thread
Varshith-Kali marked this conversation as resolved.
Resolved
minor changeset (`scripts/check-changeset-bumps.ts`); a new `e2e/engine`
import counts as a raise, so the check also fails any named `e2e/*` import the
floor version does not export, read off the `e2e@<version>` tag (a namespace
import is reported as an unverifiable note instead, since its names cannot
be enumerated). Narrow or exact, every runner minor (exact: every patch too)
falls out of range, and changesets 3 then patch-bumps each engine and
rewrites its pin, never a major (`determineDependents` in
`@changesets/assemble-release-plan` patches an out-of-range peer dependent).
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,18 @@
"Szymon Rybczak <szymon@tester.army>"
],
"devDependencies": {
"@changesets/assemble-release-plan": "7.0.0",
"@changesets/changelog-github": "1.0.1",
"@changesets/cli": "3.0.3",
"@changesets/config": "4.0.1",
"@changesets/parse": "1.0.0",
"@mdx-js/mdx": "3.1.1",
"@oxlint/plugins": "1.93.0",
"@sindresorhus/slugify": "4.0.1",
"@types/node": "26.6.6",
"ajv": "8.20.0",
"fallow": "3.43.0",
"oxc-parser": "0.158.0",
"oxlint": "1.93.0",
"remark-gfm": "4.0.1",
"typescript": "7.0.2"
Expand Down
2 changes: 1 addition & 1 deletion packages/acp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"zod": "4.6.7"
},
"peerDependencies": {
"e2e": ">=0.21.4 <1"
"e2e": ">=0.22.0 <1"
},
"devDependencies": {
"@modelcontextprotocol/client": "2.4.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/browser-run/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"test:unit": "vitest run tests/unit"
},
"peerDependencies": {
"@e2e-dev/web": ">=0.15.6 <1"
"@e2e-dev/web": ">=0.16.0 <1"
},
"devDependencies": {
"@e2e-dev/web": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/limrun/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"test:unit": "vitest run tests/unit"
},
"peerDependencies": {
"@e2e-dev/mobile": ">=0.11.1 <1",
"@e2e-dev/mobile": ">=0.12.0 <1",
"@limrun/api": ">=0.59.0 <1",
"e2e": ">=0.15.0 <1"
},
Expand Down
9 changes: 9 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

163 changes: 162 additions & 1 deletion scripts/changeset-bumps.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
import assert from 'node:assert/strict';
import { describe, it } from 'node:test';
import { parseChangesetFile } from '@changesets/parse';
import { disallowedBumps } from './changeset-bumps.ts';
import {
announcesFloorRaise,
disallowedBumps,
floorRaiseProblems,
floorRaisesPastMinor,
latestReleaseVersion,
parseVersion,
versionBumpAnnounces,
type FloorRaiseInput,
} from './changeset-bumps.ts';

const versions = new Map([
['e2e', '0.20.0'],
Expand Down Expand Up @@ -36,3 +45,155 @@ describe('disallowedBumps', () => {
assert.deepEqual(disallowedBumps(parseChangesetFile('---\n---\n'), versions), []);
});
});

describe('floorRaisesPastMinor', () => {
const released = new Set(['0.18.0', '0.19.0', '0.20.0', '0.21.0', '0.21.3', '0.22.0', '0.23.0']);

it('flags a raise that cuts off a released version on an older minor', () => {
assert.equal(floorRaisesPastMinor('0.22.0', '0.23.0', released), true);
assert.equal(floorRaisesPastMinor('0.18.0', '0.23.0', released), true);
});

it('passes a raise within one minor, a lowering, and no change', () => {
assert.equal(floorRaisesPastMinor('0.22.0', '0.22.1', released), false);
assert.equal(floorRaisesPastMinor('0.23.0', '0.22.0', released), false);
assert.equal(floorRaisesPastMinor('0.22.0', '0.22.0', released), false);
});

it('passes a correction from a never-published floor to the version it already meant in practice', () => {
assert.equal(floorRaisesPastMinor('0.22.1', '0.23.0', released), false);
assert.equal(floorRaisesPastMinor('0.21.4', '0.22.0', released), false);
});

it('passes when no released version sits between the floors', () => {
assert.equal(floorRaisesPastMinor('0.22.0', '0.23.0', new Set(['0.23.0'])), false);
});
});

describe('announcesFloorRaise', () => {
it('accepts a breaking minor and a release major, but not a release minor', () => {
assert.equal(announcesFloorRaise('minor', '**Breaking:** drops old runners.'), true);
assert.equal(announcesFloorRaise('minor', '**Release:** the runner API.'), false);
assert.equal(announcesFloorRaise('major', '**Release:** the runner API.'), true);
});

it('rejects a patch, a plain minor, and a breaking major', () => {
assert.equal(announcesFloorRaise('patch', '**Breaking:** drops old runners.'), false);
assert.equal(announcesFloorRaise('minor', 'Raises the floor.'), false);
assert.equal(announcesFloorRaise('major', '**Breaking:** drops old runners.'), false);
});
});

describe('floorRaiseProblems', () => {
const released = new Set(['0.22.0', '0.23.0']);
const input = (changes: FloorRaiseInput['changes'], extra: Partial<FloorRaiseInput> = {}): FloorRaiseInput => ({
name: '@e2e-dev/web',
path: 'packages/web/package.json',
peer: 'e2e',
previousFloor: '0.22.0',
currentFloor: '0.23.0',
released,
changes,
alreadyFlagged: false,
announcedByVersionBump: false,
...extra,
});

it('fails a floor-raising changeset with a patch bump', () => {
const problems = floorRaiseProblems([input([{ type: 'patch', summary: 'Fixes a thing.' }])]);
assert.equal(problems.length, 1);
assert.match(problems[0]!, /e2e peer floor rises 0\.22\.0 -> 0\.23\.0/);
assert.match(problems[0]!, /make it a minor whose summary opens \*\*Breaking:\*\*/);
});

it('names the highest bump when several changesets touch the package', () => {
const problems = floorRaiseProblems([
input([
{ type: 'patch', summary: 'Fixes a thing.' },
{ type: 'patch', summary: 'Fixes another thing.' },
]),
]);
assert.equal(problems.length, 1);
assert.match(problems[0]!, /with only a patch bump/);
});

it('fails a floor raise with no changeset at all', () => {
const problems = floorRaiseProblems([input([])]);
assert.equal(problems.length, 1);
assert.match(problems[0]!, /with no changeset for @e2e-dev\/web/);
});

it('passes a floor raise carried by a **Breaking:** minor', () => {
assert.deepEqual(floorRaiseProblems([input([{ type: 'minor', summary: '**Breaking:** needs e2e 0.23.0.' }])]), []);
});

it('fails a floor raise carried only by a **Release:** minor', () => {
const problems = floorRaiseProblems([input([{ type: 'minor', summary: '**Release:** the runner API.' }])]);
assert.equal(problems.length, 1);
assert.match(problems[0]!, /make it a minor whose summary opens \*\*Breaking:\*\*/);
});

it('passes a correction from a never-published floor on a patch bump', () => {
assert.deepEqual(
floorRaiseProblems([input([{ type: 'patch', summary: 'Names the released floor.' }], { previousFloor: '0.22.1' })]),
[],
);
});

it('passes a floor raise the release version bump announces', () => {
assert.deepEqual(floorRaiseProblems([input([], { announcedByVersionBump: true })]), []);
});

it('still fails a floor raise carried only by a patch version bump', () => {
const problems = floorRaiseProblems([input([], { announcedByVersionBump: false })]);
assert.equal(problems.length, 1);
assert.match(problems[0]!, /with no changeset for @e2e-dev\/web/);
});

it('leaves an unannounced minor to disallowedBumps instead of reporting it twice', () => {
assert.deepEqual(
floorRaiseProblems([input([{ type: 'minor', summary: 'Raises the floor.' }], { alreadyFlagged: true })]),
[],
);
});
});

describe('versionBumpAnnounces', () => {
it('accepts a 0.x minor and a major as the announcement', () => {
assert.equal(versionBumpAnnounces('0.2.4', '0.3.0'), true);
assert.equal(versionBumpAnnounces('0.23.0', '1.0.0'), true);
});

it('rejects a patch bump, no bump, and a 1.x minor', () => {
assert.equal(versionBumpAnnounces('0.2.4', '0.2.5'), false);
assert.equal(versionBumpAnnounces('0.2.4', '0.2.4'), false);
assert.equal(versionBumpAnnounces('1.2.3', '1.3.0'), false);
});

it('rejects versions that are not x.y.z', () => {
assert.equal(versionBumpAnnounces('0.2.4', '0.3.0-canary-x'), false);
assert.equal(versionBumpAnnounces('not semver', '0.3.0'), false);
});
});

describe('latestReleaseVersion', () => {
const tags = ['e2e@0.22.0', 'e2e@0.23.0', 'e2e@0.21.3', '@e2e-dev/web@0.15.5', 'e2e@0.23.0-nightly-1'];

it('picks the highest released tag for the package', () => {
assert.equal(latestReleaseVersion(tags, 'e2e'), '0.23.0');
assert.equal(latestReleaseVersion(tags, '@e2e-dev/web'), '0.15.5');
});

it('answers undefined when the package has no released tag', () => {
assert.equal(latestReleaseVersion(tags, '@e2e-dev/e2b'), undefined);
assert.equal(latestReleaseVersion([], 'e2e'), undefined);
});
});

describe('parseVersion', () => {
it('parses strict x.y.z and nothing else', () => {
assert.deepEqual(parseVersion('0.23.0'), [0, 23, 0]);
assert.equal(parseVersion('0.23.0-canary-x'), undefined);
assert.equal(parseVersion('not semver'), undefined);
});
});
Loading
Loading