Skip to content

Commit 98e2ed5

Browse files
authored
fix(release): rebuild the web bundle when the release PR bumps versions (#353)
## Requirement or Bug The release PR (#348) fails `build`, `test`, `nix build`, `Artifact security` and the preview publish. ## Bug Reproduction Steps 1. Merge any PR with a changeset that names `@pymodel/pythinker-web`. 2. The Release workflow opens `ci: release packages`, which bumps `apps/pythinker-web/package.json` `version`. 3. Every job that runs `check-web-assets.mjs` fails: "The committed web bundle is stale". ## Root Cause `vite.config.ts` compiles the web package version into the bundle (`__PYTHINKER_WEB_VERSION__`), and `package.json` is a fingerprinted build input. `changeset version` bumps it but nothing rebuilt `dist-web`, so the committed bundle was genuinely stale. Earlier releases (#301) were fixed by rebuilding by hand on the release branch. Fundamental fix: `version:release` now runs `pnpm run build:web` after `changeset version`, so the changesets action commits the rebuilt bundle with the bump. The release job already installs dependencies and runs `pnpm build` before this step. Second, unrelated failure in the same run: `towerService.test.ts` "leaves the roster untouched when another session owns the tower store" asserted the order of two log lines written by two independent async event handlers. It failed on CI when the order flipped. The test now checks both lines without order and finds the payload by message. ## Code Changes - `package.json`: `version:release` appends `&& pnpm run build:web`. - `towerService.test.ts`: order-independent assertion. ## Behavior Changes and Affected Users None for users. Release PRs now include the rebuilt `dist-web` whenever a version that reaches the bundle changes; the release job takes about one web build longer. Verification: - Simulated the bump locally: set the web version to `9.9.9`. The stale check failed; after `pnpm run build:web` it passed, and the new version appears in the bundle. Then I reverted. - `towerService.test.ts` passes: 108 of 108. ## Checklist - [x] I have read the [CONTRIBUTING](https://github.com/PyModel/pythinker-code/blob/main/CONTRIBUTING.md) document. - [x] I have linked a related issue (external PRs: issue must have a maintainer's `/approve`). - [x] I have added tests that prove my feature works. - [x] The behavior-change table above is complete, and every removed behavior or flipped default is named in the changeset and either has an escape hatch or was explicitly approved by a maintainer in this PR. - [x] Ran `gen-changesets` skill, or this PR needs no changeset. - [x] Ran `gen-docs` skill, or this PR needs no doc update.
1 parent 772e69a commit 98e2ed5

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"release:status": "node scripts/release/release-status.mjs",
3535
"test:release": "node --test scripts/release/*.test.mjs scripts/check-identity-freeze.test.mjs",
3636
"version": "changeset version",
37-
"version:release": "node scripts/release/link-desktop-changesets.mjs && changeset version",
37+
"version:release": "node scripts/release/link-desktop-changesets.mjs && changeset version && pnpm run build:web",
3838
"publish": "pnpm run typecheck && pnpm run lint && pnpm run sherif && pnpm run test && pnpm run build && pnpm run lint:pkg && changeset publish",
3939
"prepare": "simple-git-hooks",
4040
"dev:agent-gateway": "pnpm -C apps/pythinker-code run dev:agent-gateway",

‎packages/agent-core-v2/test/features/tower/towerService.test.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -928,11 +928,11 @@ describe('AgentTowerService', () => {
928928
expect(activityLog).not.toContain(' revived ');
929929

930930
const skips = infos.filter((entry) => entry.msg.includes('skipping'));
931-
expect(skips.map((entry) => entry.msg)).toEqual([
932-
'tower: skipping roster agent death mark — tower store is owned by another session',
931+
expect(skips.map((entry) => entry.msg).toSorted()).toEqual([
933932
'tower: skipping roster agent death clear — tower store is owned by another session',
933+
'tower: skipping roster agent death mark — tower store is owned by another session',
934934
]);
935-
expect(skips[0]?.payload).toMatchObject({
935+
expect(skips.find((entry) => entry.msg.includes('death mark'))?.payload).toMatchObject({
936936
event: 'TaskTerminatedNotice',
937937
agentId: 'agent-w1',
938938
sessionId: 'session-main',

0 commit comments

Comments
 (0)