Commit Graph
1002 Commits
Author SHA1 Message Date
Daan De Meyer 9374d7fa06 ci: Allow claude-review access to /tmp and /var/tmp 2026-03-18 13:48:55 +01:00
Daan De Meyer 1a7678e881 ci: Stop using subagents in claude-review workflow
As it seems impossible to prevent claude from receiving notifications
about subagents finishing after it has produced structured output, which
breaks the structured output as it has to be the final reply, let's stop
using subagents and background tasks completely to avoid the issue.
2026-03-18 13:48:55 +01:00
Daan De Meyer 2e676fd636 ci: Allow all commands in claude-review workflow
claude is asking for permissions in the logs, let's grant it access
to execute all commands to avoid the permission denials.
2026-03-18 12:44:48 +01:00
Daan De Meyer 02ab8dfc4f ci: Enable unpriv user namespaces for claude-review
Required for bubblewrap to work properly.
2026-03-18 12:44:48 +01:00
Daan De Meyer e9396ef165 ci: Bump number of turns for claude and mention turns in prompt
claude keeps failing by its subagents completing after it has already
written the review for large prs. It seems to run out of turns, tries
to get the subagents to post partial reviews but doesn't seem to stop
them.

Let's insist that it waits for background tasks to stop but let's also
increase the max turns a bit so it doesn't run out as quickly.
2026-03-18 12:00:48 +01:00
Daan De Meyer eef8f528a3 ci: Enable network isolation for claude and allow most tools
claude wants to use python to access the JSON context so let's allow
it. Since python3 basically allows you to reimplement every other tool,
let's just enable all tools except the web related ones but enable network
isolation so it can't try to exfiltrate anything via python.
2026-03-18 12:00:48 +01:00
Zbigniew Jędrzejewski-Szmek cfc31d9c76 ci: reeanble compilation test with clang -O2, disable -Wmaybe-uninitialized for old gcc
In CI we get spurious failures about unitialized variables with gcc
versions older then (depending on the case) 12, 13, or 14. Let's only
try to do this check with newer gcc which returns more useful results.
At the same time, do compile with both gcc and clang at -O2, just
disable the warning.

The old logic seems to have been confused. We compile with -Wall, at
least in some cases, which includes -Wmaybe-unitialized. So if we
_don't_ want it, we need to explicitly disable it.
2026-03-18 10:28:47 +00:00
Daan De Meyer e87303d511 ci: Reduce retention for pr-context JSON file to a week
We don't need to keep this around fpr 90 days, let's keep it around
for a week.
2026-03-18 10:53:49 +01:00
Daan De Meyer 2967e89597 ci: Enable users without write action to the repo to access claude review
The labelling approach introduced in 6089075265
means contributors can now trigger the workflow on their own when the label
is added by a maintainer and they update the PR. Hence we need to allow all
users to access the claude code action. This is safe because we already gate
the workflow ourselves to only the contributors that we want to allow.
Additionally, the claude code job has no permissions anymore except read access
to the repository and can execute very limited tools, so this should be safe.
2026-03-18 10:53:49 +01:00
Daan De Meyer 2cada660de ci: Fix artifact name in claude-review workflow
The name doesn't actually matter, it gets replaced with the name
of the file when not archiving. So stop passing a name and pass in
the filename as the name when downloading the artifact.
2026-03-18 10:53:49 +01:00
Daan De Meyer b29f3bbfa8 ci: Use artifacts to pass around pr context
The current approach runs into issues on large prs:
https://github.com/systemd/systemd/actions/runs/23220105199/job/67490722033
2026-03-18 07:27:41 +01:00
Daan De Meyer f2210fda54 ci: Add issue comments to pr context for claude-review as well
Follow up for fb513a7e1c. The issue
comments are the regular comments left on the pr.
2026-03-17 23:48:54 +01:00
Daan De Meyer fb513a7e1c ci: Fetch context for claude-review job in setup job
Rather than have claude fetch the context itself, let's fetch the
context for it in the setup job. This has the following advantages:

- We can reduce the permissions granted to the claude job
- claude has less opportunity to mess up trying to fetch the context
  itself. Specifically, it keeps spawsning a background task to fetch
  the PR branch which messes up the structured output at the end, causing
  the review job to fail. By pre-fetching the context it won't have to
  spawn the background task. Additionally, we limit the git commands it
  can execute to local ones to ensure it doesn't try to fetch the PR branch.
  Finally, we fetch the branch ourselves as pr-review so claude can look at it
  to review the PR.
2026-03-17 22:54:38 +01:00
Daan De Meyer 6089075265 ci: Allow attaching claude-review label to PRs for automatic review
- If a pr is labeled with claude-review, review it immediately
- If a pr labeled with claude-review is updated, review it regardless
of the author
- If a pr is opened by a maintainer, review it and add the claude-review
label. If the claude-review label is later removed, the pr won't be
auto-reviewed anymore.
2026-03-17 20:07:23 +01:00
Daan De Meyer b54d61e00b ci: Fix allowed tools in claude-review
Bash(gh:api *) wasn't actually working. Turns out the colon syntax
is deprecated and unnecessary. Let's stop using it which also fixes
the bug so that gh api calls are allowed now.
2026-03-17 19:46:31 +01:00
Daan De MeyerandClaude Opus 4.6 58246e6408 ci: Add automatic review thread resolution to claude-review workflow
Claude now identifies which existing review comment threads should be
resolved (because the issue was addressed or someone disagreed) and
returns their REST API IDs in a new `resolve` array in the structured
output. The post job uses GraphQL to map comment IDs to threads and
resolve them.

Also switches all GitHub data fetching from MCP tools to `gh api` calls,
since the MCP tool strips comment IDs during its GraphQL-to-minimal
conversion and cannot be used for thread resolution.

The thread resolution GraphQL pagination is wrapped in a try/catch so
that a failure to fetch threads degrades gracefully instead of aborting
the entire post job. Unmatched comment IDs are logged for debuggability.

Adds explicit instructions to complete all data fetching before starting
review and to cancel background tasks before returning structured output,
working around a claude-code-action issue where a late-completing
background task triggers a new conversation turn that overwrites the
structured JSON result.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 18:40:32 +01:00
Daan De Meyer 94a695d89a ci: Review PRs per-commit and attach comments to correct commits
Switch claude-review from reviewing the entire PR diff at once to
reviewing each commit individually via subagents. Each commit review
subagent receives the PR context, preceding commit diffs, and its own
commit diff, then returns comments tagged with the commit SHA. This
ensures review comments are attached to the correct commit via the
GitHub API rather than all pointing at HEAD.

Also add Bash(gh:*) to allowed tools so subagents can fetch per-commit
diffs via `gh api` without needing local git objects, and remove CI
analysis (needs to be delayed until CI finishes to be useful).

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 16:12:04 +01:00
Daan De Meyer 52c4aca21e ci: Revert side/subject_type change for claude review workflow
This doesn't seem to actually work, so revert the change.
2026-03-16 16:08:26 +01:00
Daan De Meyer 3a76c0959f ci: Fix several issues in claude-review workflow
Address feedback from facebook/bpfilter#472:

- Fix setFailed error message counting file-level comments (without
  line numbers) that are intentionally skipped, use inlineComments.length
  instead of comments.length
- Fix double severity prefix in inline comments: the prompt told Claude
  to prefix body with **must-fix**/etc but the post job also prepended
  "Claude: ", producing "Claude: **must-fix**: ...". Now the prompt says
  not to prefix and the post job adds "Claude **severity**: " using the
  structured severity field
- Move error tracking instructions to a top-level section after all phases
  so they apply to all runs, not just the first run
- Clarify that line is optional: use "should be" instead of "must be"
  and document that omitting line still surfaces the comment in the
  tracking comment summary
- Distinguish cancelled vs failed in tracking comment message
- Add side: "RIGHT" and subject_type: "line" to createReviewComment
  per GitHub API recommendations
- Downgrade partial inline comment posting failures to warnings; only
  fail the job when no comments at all could be posted

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 15:30:09 +01:00
Daan De Meyer a9ac5cdf18 ci: Update github-script action version to 8.0.0 in claude-review 2026-03-16 12:23:39 +01:00
Daan De Meyer b1c446a0b0 ci: Run claude-review workflow automatically on trusted PRs 2026-03-16 12:12:46 +01:00
Daan De Meyer 9e7a2793ad ci: Insist on structured output from claude-review workflow
In some cases claude is not outputting structured JSON at the end.
Let's modify the prompt a bit to hopefully mitigate the issue.
2026-03-16 11:53:40 +01:00
Daan De Meyer 7178e3829f ci: Fix several robustness issues in claude-review workflow
- Use github.paginate() for listComments to handle PRs with 100+ comments
- Make line optional in review schema to allow file-level comments
- Skip createReviewComment for comments without a line number
- Fix failed count to exclude skipped file-level comments
- Pass review result via env var instead of expression injection
- Use core.warning() instead of console.log() for JSON parse failures
- Fix MARKER insertion for single-line summaries that have no newline
- Require "@claude review" instead of just "@claude" to trigger

Co-developed-by: Claude <claude@anthropic.com>
2026-03-16 09:16:19 +01:00
Daan De Meyer 876d36f68a ci: Add full output from claude to debug intermittent failures 2026-03-15 21:47:21 +01:00
Daan De Meyer 9a70fdcb74 ci: Add one more mcp tool to claude-review workflow 2026-03-10 21:36:20 +01:00
Daan De Meyer 45e4e035f7 ci: Only trigger claude review workflow on pr comments
The trigger for regular pr and issue comments is the same, so we
have to make sure we skip if it's an issue comment and not a pr
comment.
2026-03-10 21:02:36 +01:00
Daan De Meyer 55dd233797 ci: Update prompt to include a list of errors
To make debugging the review workflow easier, have claude include an
overview of errors encountered in the review summary.
2026-03-10 20:45:10 +01:00
Daan De Meyer b62b4c6973 ci: Give claude review read-only access to issues and pull requests
For retrieving previous review comments and extra details from issues
linked in the PR.
2026-03-10 20:45:10 +01:00
Daan De Meyer 60b3603b2d ci: Create claude review tracking comment before starting review
Let's create a comment to let the user know that the review is in
progress and then update that comment with the actual review later.
2026-03-10 20:23:54 +01:00
Daan De Meyer 8f56e54a91 ci: Add workflow url to tracking comment in claude-review workflow
Simplifies debugging of failed claude-review workflows.
2026-03-10 19:58:17 +01:00
Daan De Meyer 1254f4f2d2 ci: Don't make a single failed review comment fail the entire job
Let's handle failure to post individual review comments gracefully.
Reduces the impact of failures like in
https://github.com/systemd/systemd/actions/runs/22904601370/job/66461528144.
2026-03-10 19:57:11 +01:00
Daan De Meyer d9cd9b2a1d ci: Update claude review prompt to insist on valid lines
Hopefully fixes the failure in
https://github.com/systemd/systemd/actions/runs/22904601370/job/66461528144.
2026-03-10 19:56:09 +01:00
Daan De Meyer 8e59fb6248 ci: Use one more variable in claude-review workflow 2026-03-10 14:40:00 +01:00
Daan De Meyer f2a75354bc ci: Use github MCP in claude review instead of gh command line tool
MCP was specifically made for AI and is available, so we might as well
use it.
2026-03-10 10:58:27 +01:00
Daan De Meyer 8a19cad8ae ci: Drop tracking comment update from claude review
Too noisy, let's drop it.
2026-03-09 17:55:33 +01:00
Daan De Meyer 47e9876312 ci: Update claude action to v1 commit
I accidentally picked a random commit instead of the one pointing
to the official v1 release, let's fix that.
2026-03-09 11:18:44 +01:00
Daan De Meyer 48b3642dd1 ci: Don't cancel in progress jobs for claude-review workflow
This workflow runs on any comment to a github PR. 99% of the time the
workflow will be skipped yet it will still cancel any previous ongoing
workflows. Let's not cancel in progress workflow but instead queue the
workflow so we don't cancel in progress reviews any time a comment is
posted on a PR that is being reviewed.
2026-03-09 11:15:34 +01:00
Daan De Meyer a023d2bbdb ci: privilege-separate Claude review workflow
The workflow is split into two jobs for least-privilege:

1. 'review' job — runs Claude with read-only permissions (contents: read,
   id-token: write for AWS OIDC, actions: read). Claude produces a structured
   JSON review via --json-schema with a 'comments' array and a 'summary'
   string. Its tools are restricted to read-only operations (Read, LS, Grep,
   Glob, Task, and various Bash prefixes for common read-only commands).
   Claude also has access to CI MCP tools to analyze failed workflow runs.

2. 'post' job — only has pull-requests: write. Reads the structured JSON
   output from the review job and posts inline comments individually (so
   re-runs only add new comments). Maintains a tracking comment with a
   <!-- claude-pr-review --> marker that is created on first run and updated
   in-place on subsequent runs, preserving existing item order, wording,
   and checkbox state. Posts a notification comment when the tracking
   comment is updated or left unchanged.

Comment deduplication is handled by Claude in the prompt rather than in
the posting script, allowing for better semantic understanding of whether
two comments address the same issue.

The PR number is resolved via github.event.pull_request.number with a
fallback to github.event.issue.number for issue_comment events where
github.event.pull_request is not populated. The concurrency group uses
the same fallback.

Co-developed-by: Claude <claude@anthropic.com>
2026-03-09 09:45:31 +01:00
Daan De Meyer c7c0ea91aa ci: Fix missing parentheses in claude review workflow 2026-03-06 15:31:29 +01:00
Daan De Meyer a67cb44287 ci: React to issue_comment in claude review workflow
issue_comment is the trigger that fires on regular pull request comments,
so we have to trigger the review workflow on that as well.
2026-03-06 15:27:30 +01:00
Daan De Meyer 5d223ff468 ci: Make claude action review PRs only and fix the instructions
Turns out the claude code action has issues reviewing PRs from forks
(https://github.com/anthropics/claude-code-action/issues/939). Let's
reuse the approach from https://github.com/pzmarzly/demo--claude-bot-reviews
instead (which I've explicitly asked permission for to reuse).

Unlike the linked demo, we still insist on a comment by a maintainer
before claude reviews the PR.
2026-03-06 15:11:54 +01:00
Daan De Meyer 89f5f01caf Move AI instructions to AGENTS.md
This seems to be what all the tools are standardizing on, except
claude (https://github.com/anthropics/claude-code/issues/6235) so
add a symlink from CLAUDE.md to AGENTS.md for now until they support
it as well.

I also had claude extend the instructions a bit.

Co-developed-by: Claude <claude@anthropic.com>
2026-03-06 08:55:55 +01:00
Daan De Meyer e2c418d528 ci: Add claude code github action
This will allow maintainers to mention claude in comments on issues
and prs to do stuff like review something or try to reproduce a bug
or other stuff. Let's give it a try and see whether we like it or
not.
2026-03-05 22:13:51 +01:00
dependabot[bot] 57b6859757 build(deps): bump ninja from 1.11.1.4 to 1.13.0 in /.github/workflows
Bumps [ninja](https://github.com/scikit-build/ninja-python-distributions) from 1.11.1.4 to 1.13.0.
- [Release notes](https://github.com/scikit-build/ninja-python-distributions/releases)
- [Changelog](https://github.com/scikit-build/ninja-python-distributions/blob/master/HISTORY.rst)
- [Commits](https://github.com/scikit-build/ninja-python-distributions/compare/1.11.1.4...1.13.0)

---
updated-dependencies:
- dependency-name: ninja
  dependency-version: 1.13.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-05 00:48:10 +09:00
dependabot[bot] 298dc78821 build(deps): bump github/codeql-action in the actions group
Bumps the actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 4.32.0 to 4.32.4
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/b20883b0cd1f46c72ae0ba6d1090936928f9fa30...89a39a4e59826350b863aa6b6252a07ad50cf83e)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.32.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-02 12:30:25 +09:00
Daan De Meyer 59a83c37bf ci: Simplify musl build setup
No need to setup symlink farms, we can just use the host's /usr/include
now.
2026-02-19 20:04:06 +01:00
Zbigniew Jędrzejewski-Szmek ba67af7efb Bump minimum version of python to 3.9 (#40711) 2026-02-18 13:33:29 +01:00
dependabot[bot] 20b2224a7c build(deps): bump super-linter/super-linter in the actions group
Bumps the actions group with 1 update: [super-linter/super-linter](https://github.com/super-linter/super-linter).


Updates `super-linter/super-linter` from 8.4.0 to 8.5.0
- [Release notes](https://github.com/super-linter/super-linter/releases)
- [Changelog](https://github.com/super-linter/super-linter/blob/main/CHANGELOG.md)
- [Commits](https://github.com/super-linter/super-linter/compare/12562e48d7059cf666c43a4ecb0d3b5a2b31bd9e...61abc07d755095a68f4987d1c2c3d1d64408f1f9)

---
updated-dependencies:
- dependency-name: super-linter/super-linter
  dependency-version: 8.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-18 19:54:44 +09:00
Jörg Behrmann 761f1ef2f3 Bump minimum version of python to 3.9
This was announced in fd8c620751 and every
still-supported distributo release provides at least 3.9, as tracked by #38608.
2026-02-18 18:47:15 +09:00
Dmitry V. Levin 6461eccacb github/workflows: disable persisting credentials for actions/checkout
Set `persist-credentials: false` for actions/checkout.

By default, using `actions/checkout` causes a credential to be persisted on
disk.  Subsequent steps may accidentally publicly persist the credential, e.g.
by including it in a publicly accessible artifact via actions/upload-artifact.
However, even without this, persisting the credential on disk is non-ideal
unless actually needed.

Link: https://docs.zizmor.sh/audits/#artipacked
2026-02-18 08:00:00 +00:00