fix(ci): resolve TS5055 release build failure since May 19#4383
Conversation
The nightly/preview release workflow has been failing for 3 days with `TS5055: Cannot write file ... because it would overwrite input file` in packages/core during the version bump step. Root cause: `npm install --package-lock-only` in version.js triggers the root `prepare` lifecycle, which re-runs `tsc --build` while packages/core/dist/ already exists from the initial `npm ci`. The unbuilt acp-bridge reference (added in #4295 but missing from build.js) corrupts TypeScript's incremental project graph resolution. Fixes: 1. Add --ignore-scripts to the lock-file-only install in version.js 2. Add packages/acp-bridge to the build order in build.js Closes #4368, closes #4339, closes #4307
📋 Review SummaryThis PR addresses the TS5055 release build failures that have been occurring since May 19 by fixing two related issues: adding 🔍 General Feedback
🎯 Specific Feedback🔴 CriticalNo critical issues identified. The fix correctly addresses the root cause of the TS5055 errors. 🟡 HighNo high priority issues identified. The approach is sound and addresses the core problems. 🟢 Medium
🔵 Low
✅ Highlights
|
Qwen Code Review (STANDARD)What this PR does: Fixes a 3-day-old release CI regression (TS5055) by adding 🟡 P2 — Medium
🟢 P3 — Low
Cross-file notes (optional)
✅ Highlights (optional)
Validation EvidenceMISSING — The PR body lists a manual test plan with checkmarks ("Verified
Tier: STANDARD. Reply Reviewed by |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Fixes the nightly/preview release workflow failure caused by a redundant rebuild during the version bump step, which triggers TypeScript TS5055 due to an inconsistent project reference build graph.
Changes:
- Prevents
npm install --package-lock-onlyfrom running lifecycle scripts (avoiding an unnecessary second build). - Updates the build order to include
packages/acp-bridgebeforepackages/clito match TypeScript project reference dependencies.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| scripts/version.js | Adds --ignore-scripts to lockfile-only install to avoid triggering prepare and a redundant failing rebuild in CI. |
| scripts/build.js | Inserts packages/acp-bridge into the explicit build order ahead of packages/cli to satisfy dependency ordering. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
The nightly/preview release workflow has been failing for 3 days with `TS5055: Cannot write file ... because it would overwrite input file` in packages/core during the version bump step. Root cause: `npm install --package-lock-only` in version.js triggers the root `prepare` lifecycle, which re-runs `tsc --build` while packages/core/dist/ already exists from the initial `npm ci`. The unbuilt acp-bridge reference (added in #4295 but missing from build.js) corrupts TypeScript's incremental project graph resolution. Fixes: 1. Add --ignore-scripts to the lock-file-only install in version.js 2. Add packages/acp-bridge to the build order in build.js Closes #4368, closes #4339, closes #4307
…prevent TS5055 The VSCode IDE companion release workflow fails with TS5055 because prepackage.js triggers a second `npm run build` after version bumps. The generate step rewrites src/generated/git-commit.ts (new version), but tsc --build sees stale .d.ts in dist/ as input files due to composite project reference resolution. Fix: remove each package's own dist/ and tsconfig.tsbuildinfo before tsc --build. This forces a clean local rebuild without cascading into upstream packages (unlike `tsc --build --clean` which wipes all referenced projects). Applied to: - scripts/build_package.js (used by core, acp-bridge, cli) - All 5 channel packages (base, telegram, dingtalk, weixin, plugin-example) Ref: #4383 (partial fix for version.js path only)
Summary
The nightly/preview release workflow has been failing for 3 consecutive days (May 19–21) with
TS5055: Cannot write file ... because it would overwrite input fileduring thePublish Releasejob's version bump step.Root Cause
PR #4295 (
refactor(acp-bridge): create skeleton) introducedpackages/acp-bridgeas a new workspace with a TypeScript project reference topackages/core, and added a reference frompackages/cli/tsconfig.jsontopackages/acp-bridge. However, it did not addpackages/acp-bridgeto the build order inscripts/build.js.In the release workflow:
npm citriggers thepreparelifecycle → full build succeeds, creatingpackages/core/dist/with.d.tsoutput.scripts/version.jsbumps all workspace versions, then runsnpm install --package-lock-onlywhich re-triggersprepare(npm lifecycle behavior).tsc --buildforpackages/corefails because it attempts to rebuild whiledist/already exists. The unbuiltacp-bridgereference corrupts TypeScript's incremental project graph resolution, causing TS5055.Fix
scripts/version.js: Add--ignore-scriptsto thenpm install --package-lock-onlycommand — this lock-file update does not need a full rebuild.scripts/build.js: Addpackages/acp-bridgeto the build order beforepackages/cli(its dependent).Test plan
node scripts/version.js 0.15.12-test.1completes successfully with--ignore-scriptspackages/acp-bridgehas the expectedbuildscriptCloses #4368
Closes #4339
Closes #4307