Repository navigation
Commit 98e2ed5
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
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
928 | 928 | | |
929 | 929 | | |
930 | 930 | | |
931 | | - | |
932 | | - | |
| 931 | + | |
933 | 932 | | |
| 933 | + | |
934 | 934 | | |
935 | | - | |
| 935 | + | |
936 | 936 | | |
937 | 937 | | |
938 | 938 | | |
| |||
0 commit comments