From c1ab5a92e9f7d1aed7b51a90dfdc6376ad280acf Mon Sep 17 00:00:00 2001 From: MK Date: Sat, 25 Apr 2026 10:14:08 +0800 Subject: [PATCH 1/3] ci(upgrade-deps): teach autofix agent to handle sync-remote failures The "Sync remote and build" step runs `pnpm tool sync-remote` with `continue-on-error: true` so the downstream Claude Code "Check upgrade dependencies" step can repair anything that breaks. But that step's prompt never mentioned sync-remote, so when the catalog merger errored on a cross-major version conflict (e.g. rolldown bumping `diff` to ^9 while vp's catalog still pinned ^8), the failure was silently swallowed and the daily workflow opened a PR with `sync-remote-and-build: failure` baked into the body but no actual fix attempted. This commit updates the prompt to: - Surface `${{ steps.build.outcome }}` and `${{ steps.build-upstream.outcome }}` so the agent can see that sync-remote already failed. - Add an explicit Step 1 fixup describing the typical `Incompatible semver ranges for : ^X vs ^Y` failure mode and how to resolve it: bump the passthrough catalog entry in `pnpm-workspace.yaml` to match the rolldown/vite version, then re-run `pnpm tool sync-remote` until it exits 0. --- .github/workflows/upgrade-deps.yml | 43 ++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/.github/workflows/upgrade-deps.yml b/.github/workflows/upgrade-deps.yml index 4e583616ca..aa07e17772 100644 --- a/.github/workflows/upgrade-deps.yml +++ b/.github/workflows/upgrade-deps.yml @@ -74,30 +74,51 @@ jobs: show_full_output: 'true' prompt: | Your goal: after the daily upstream-dependency upgrade, bring the project back - to a fully green state. The upgrade script has already bumped every dep to the - latest version and the `build-upstream` action has attempted a build — your job - is to diagnose and fix every error that surfaced, then prove the fix is complete - by running a final validation pass. + to a fully green state. The upgrade script has bumped every dep to the latest + version, the `Sync remote and build` step has attempted to merge the rolldown + and vite catalogs into the workspace, and the `build-upstream` action has + attempted a build — your job is to diagnose and fix every error that surfaced, + then prove the fix is complete by running a final validation pass. ### Background - Upgrade script: `./.github/scripts/upgrade-deps.mjs` + - Sync-remote tool: `pnpm tool sync-remote` (source in + `packages/tools/src/sync-remote-deps.ts`) — clones rolldown/vite into the + working tree and merges their pnpm-workspace catalogs into the root + `pnpm-workspace.yaml`. - Build-upstream action: `./.github/actions/build-upstream/action.yml` - Package manager: `pnpm`. Do NOT downgrade any dep — we want the latest. + ### Outcomes from earlier steps (both ran with continue-on-error) + - Sync remote and build: ${{ steps.build.outcome }} + - build-upstream action: ${{ steps.build-upstream.outcome }} + ### Fixups to perform (in order) - 1. Re-run the steps in `./.github/actions/build-upstream/action.yml`; fix any + 1. If the `Sync remote and build` outcome above is `failure`, fix it FIRST — + nothing else will work until the merged workspace is correct. Re-run + `pnpm tool sync-remote` and read the error. The most common cause is a + cross-major semver conflict in the merged catalog, e.g. + `Incompatible semver ranges for : ^X vs ^Y`. The merger refuses to + auto-resolve cross-major conflicts for packages outside its synced list + (oxc-*, vitest deps). For passthrough deps that vp does NOT import + directly (e.g. `diff`, `acorn`, `astring`, anything only present in + `rolldown/scripts/package.json` or vite's internals), bump vp's + `pnpm-workspace.yaml` catalog entry to match the rolldown/vite version, + then re-run `pnpm tool sync-remote` until it exits 0. Finish with + `pnpm install --no-frozen-lockfile`. + 2. Re-run the steps in `./.github/actions/build-upstream/action.yml`; fix any non-zero exits. - 2. If the rolldown hash changed, follow `.claude/agents/cargo-workspace-merger.md` + 3. If the rolldown hash changed, follow `.claude/agents/cargo-workspace-merger.md` to resync the workspace. - 3. Compare tsdown CLI options with `vp pack` and sync new/removed options per + 4. Compare tsdown CLI options with `vp pack` and sync new/removed options per `.claude/skills/sync-tsdown-cli/SKILL.md`. - 4. Install the global CLI: + 5. Install the global CLI: - `pnpm bootstrap-cli:ci` - `echo "$HOME/.vite-plus/bin" >> $GITHUB_PATH` - 5. If any Rust code or `Cargo.toml` was modified, run `cargo check + 6. If any Rust code or `Cargo.toml` was modified, run `cargo check --all-targets --all-features` and `cargo shear`; fix anything they report. - 6. Run `pnpm run lint` (requires a prior `just build`); fix any errors. - 7. Smoke-test the CLI: `vp -h`, `vp run -h`, `vp lint -h`, `vp test -h`, + 7. Run `pnpm run lint` (requires a prior `just build`); fix any errors. + 8. Smoke-test the CLI: `vp -h`, `vp run -h`, `vp lint -h`, `vp test -h`, `vp build -h`, `vp fmt -h`, `vp pack -h`. ### Final validation (this step is complete ONLY when all pass) From ed8ab9c1b8d3297b814a0ba33a8bdc8444eb2891 Mon Sep 17 00:00:00 2001 From: MK Date: Sat, 25 Apr 2026 10:36:40 +0800 Subject: [PATCH 2/3] ci(upgrade-deps): drop redundant outcomes block, always re-run sync-remote Per PR review: the agent can verify sync-remote's state directly by re-running it, so the `${{ steps.*.outcome }}` block is a redundant second source of truth. Step 1 now always runs sync-remote and fixes any failure, regardless of how the earlier step exited. --- .github/workflows/upgrade-deps.yml | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/.github/workflows/upgrade-deps.yml b/.github/workflows/upgrade-deps.yml index aa07e17772..bc59a7e191 100644 --- a/.github/workflows/upgrade-deps.yml +++ b/.github/workflows/upgrade-deps.yml @@ -89,18 +89,13 @@ jobs: - Build-upstream action: `./.github/actions/build-upstream/action.yml` - Package manager: `pnpm`. Do NOT downgrade any dep — we want the latest. - ### Outcomes from earlier steps (both ran with continue-on-error) - - Sync remote and build: ${{ steps.build.outcome }} - - build-upstream action: ${{ steps.build-upstream.outcome }} - ### Fixups to perform (in order) - 1. If the `Sync remote and build` outcome above is `failure`, fix it FIRST — - nothing else will work until the merged workspace is correct. Re-run - `pnpm tool sync-remote` and read the error. The most common cause is a - cross-major semver conflict in the merged catalog, e.g. - `Incompatible semver ranges for : ^X vs ^Y`. The merger refuses to - auto-resolve cross-major conflicts for packages outside its synced list - (oxc-*, vitest deps). For passthrough deps that vp does NOT import + 1. Run `pnpm tool sync-remote` and ensure it exits 0 — earlier failures + here are swallowed by `continue-on-error`, so verify directly. The most + common failure is a cross-major semver conflict in the merged catalog, + e.g. `Incompatible semver ranges for : ^X vs ^Y`. The merger refuses + to auto-resolve cross-major conflicts for packages outside its synced + list (oxc-*, vitest deps). For passthrough deps that vp does NOT import directly (e.g. `diff`, `acorn`, `astring`, anything only present in `rolldown/scripts/package.json` or vite's internals), bump vp's `pnpm-workspace.yaml` catalog entry to match the rolldown/vite version, From 4961b135a829147f8eefbfb05693925380822e6b Mon Sep 17 00:00:00 2001 From: MK Date: Sat, 25 Apr 2026 10:58:51 +0800 Subject: [PATCH 3/3] Revert "ci(upgrade-deps): drop redundant outcomes block, always re-run sync-remote" This reverts commit ed8ab9c1b8d3297b814a0ba33a8bdc8444eb2891. --- .github/workflows/upgrade-deps.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/upgrade-deps.yml b/.github/workflows/upgrade-deps.yml index bc59a7e191..aa07e17772 100644 --- a/.github/workflows/upgrade-deps.yml +++ b/.github/workflows/upgrade-deps.yml @@ -89,13 +89,18 @@ jobs: - Build-upstream action: `./.github/actions/build-upstream/action.yml` - Package manager: `pnpm`. Do NOT downgrade any dep — we want the latest. + ### Outcomes from earlier steps (both ran with continue-on-error) + - Sync remote and build: ${{ steps.build.outcome }} + - build-upstream action: ${{ steps.build-upstream.outcome }} + ### Fixups to perform (in order) - 1. Run `pnpm tool sync-remote` and ensure it exits 0 — earlier failures - here are swallowed by `continue-on-error`, so verify directly. The most - common failure is a cross-major semver conflict in the merged catalog, - e.g. `Incompatible semver ranges for : ^X vs ^Y`. The merger refuses - to auto-resolve cross-major conflicts for packages outside its synced - list (oxc-*, vitest deps). For passthrough deps that vp does NOT import + 1. If the `Sync remote and build` outcome above is `failure`, fix it FIRST — + nothing else will work until the merged workspace is correct. Re-run + `pnpm tool sync-remote` and read the error. The most common cause is a + cross-major semver conflict in the merged catalog, e.g. + `Incompatible semver ranges for : ^X vs ^Y`. The merger refuses to + auto-resolve cross-major conflicts for packages outside its synced list + (oxc-*, vitest deps). For passthrough deps that vp does NOT import directly (e.g. `diff`, `acorn`, `astring`, anything only present in `rolldown/scripts/package.json` or vite's internals), bump vp's `pnpm-workspace.yaml` catalog entry to match the rolldown/vite version,