Skip to content

Commit 34a2960

Browse files
authored
ci: use claude code to fix upgrade issues (#459)
<!-- CURSOR_SUMMARY --> > [!NOTE] > Introduces automated remediation and tooling to the `upgrade-deps` CI workflow. > > - **Adds conditional `anthropics/claude-code-action`** to investigate and fix `build-upstream` failures, with scoped `actions: read` permission and detailed pnpm/cargo instructions > - **Expands job permissions** to include `actions: read` and `id-token: write` > - **Enhances Rust setup** by installing `just` and `cargo-shear`; keeps cross-compilation target steps > - **Refines build step** with explicit `id: build-upstream` and `continue-on-error` to allow PR creation despite failures > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 5c4d2d5. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent b8407d0 commit 34a2960

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

.github/workflows/upgrade-deps.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313
permissions:
1414
contents: write
1515
pull-requests: write
16+
actions: read
17+
id-token: write
1618
steps:
1719
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
1820
- uses: ./.github/actions/clone
@@ -24,6 +26,7 @@ jobs:
2426
with:
2527
save-cache: ${{ github.ref_name == 'main' }}
2628
cache-key: upgrade-deps
29+
tools: just,cargo-shear
2730

2831
- uses: oxc-project/setup-node@fdbf0dfd334c4e6d56ceeb77d91c76339c2a0885 # v1.0.4
2932

@@ -50,8 +53,41 @@ jobs:
5053
5154
- name: Build
5255
uses: ./.github/actions/build-upstream
56+
id: build-upstream
57+
continue-on-error: true
5358
with:
5459
target: x86_64-unknown-linux-gnu
60+
61+
- uses: anthropics/claude-code-action@a017b830c03e23789b11fb69ed571ea61c12e45c # v1.0.0
62+
if: steps.build-upstream.outcome == 'failure'
63+
with:
64+
claude_code_oauth_token: ${{ secrets.ANTHROPIC_API_KEY }}
65+
github_token: ${{ secrets.GITHUB_TOKEN }}
66+
prompt: |
67+
Check why the build-upstream steps failed and fix them.
68+
### Background
69+
- The build-upstream steps are at ./.github/actions/build-upstream/action.yml
70+
- The deps upgrade script is at ./.github/scripts/upgrade-deps.mjs
71+
72+
### Instructions
73+
- We are using `pnpm` as the package manager
74+
- We are aiming to upgrade all dependencies to the latest versions in this workflow, so don't downgrade any dependencies.
75+
- Check `.claude/agents/cargo-workspace-merger.md` if rolldown hash is changed.
76+
- If deps in our `Cargo.toml` need to be upgraded, you can refer to the `./.claude/agents/cargo-workspace-merger.md`
77+
- If `Cargo.toml` has been modified, you need to run `cargo shear` to ensure there is nothing wrong with our dependencies.
78+
- Run `cargo check --all-targets --all-features` to ensure everything works fine if any Rust related codes are modified.
79+
- Run the steps in `build-upstream` action.yml after your fixing. If no errors are found, you can safe to exit.
80+
- Your final step is to run `just build` to ensure all builds are successful.
81+
- Run `pnpm run lint` to check if there are any issues after the build, if has, deep investigate it and fix it. You need to run `just build` before you can run `pnpm run lint`.
82+
- Run `pnpm run test` after `just build` to ensure all tests are successful.
83+
- The snapshot tests in `pnpm run test` are always successful, you need to check the updated snapshot to see if there is anything wrong after our deps upgrade.
84+
85+
Help me fix the errors in `build-upstream` steps, no need to commit changes after your fixing.
86+
claude_args: |
87+
--model opus --allowedTools "Bash,Edit,Replace,NotebookEditCell"
88+
additional_permissions: |
89+
actions: read
90+
5591
- name: Update lockfile
5692
run: |
5793
pnpm install --no-frozen-lockfile

0 commit comments

Comments
 (0)