Skip to content

ci(fuzz): auto-run fixer on fuzzer issues and open a draft PR with the fix#8196

Merged
joseph-isaacs merged 6 commits into
developfrom
claude/brave-edison-Jf6ky
Jun 1, 2026
Merged

ci(fuzz): auto-run fixer on fuzzer issues and open a draft PR with the fix#8196
joseph-isaacs merged 6 commits into
developfrom
claude/brave-edison-Jf6ky

Conversation

@joseph-isaacs

@joseph-isaacs joseph-isaacs commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

What

Two related changes to the fuzzer fix automation:

  1. Auto-trigger on fuzzer issues — new .github/workflows/fuzzer-issue-autofix.yml runs the existing Fuzzer Fix Automation whenever an issue is opened with, or gains, the fuzzer label.
  2. Persist the fix as a draft PRfuzzer-fix-automation.yml now commits the fix to a branch and opens a draft PR that triggers normal CI, reusing the GitHub App token mechanism from claude-write.yml.

Add a thin reusable-workflow caller (fuzzer-issue-autofix.yml) that
triggers the existing Fuzzer Fix Automation whenever an issue is opened
with the "fuzzer" label or has the label applied. This covers issues
filed manually as well as by the scheduled fuzz pipeline, complementing
the in-pipeline attempt-fix-* job in fuzz.yml.

The label gate is a meaningful boundary: only the github-actions bot and
users with triage/write access can apply the "fuzzer" label, so
arbitrary external issues cannot trigger the automation. A per-issue
concurrency group collapses duplicate opened+labeled triggers.

Also allow the "issues" event in the attempt-fix job guard in
fuzzer-fix-automation.yml. A called reusable workflow inherits the
caller's github.event_name, so when invoked from an issues-triggered
caller the inner job sees "issues" rather than "workflow_call" and
would otherwise be skipped.

Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
@joseph-isaacs joseph-isaacs added the changelog/skip Do not list PR in the changelog label Jun 1, 2026

@0ax1 0ax1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

love option B

Reuse the GitHub App token mechanism from claude-write.yml so the
Fuzzer Fix Automation persists its work and surfaces it as a reviewable
PR instead of throwing it away after the run.

- Attach the claude-automation environment and mint a short-lived App
  installation token via actions/create-github-app-token.
- Pass the App token (not GITHUB_TOKEN) to claude-code-action so the
  committed fix branch and its PR trigger normal pull_request CI.
- After a successful fix, open a draft PR from the branch claude-code
  pushed (steps.claude.outputs.branch_name), linking the issue, and
  comment the PR link back on the issue.
- Check out with persist-credentials: false so the built-in token isn't
  left in git config.

Draft keeps the per-issue fuzzer flow low-noise: a maintainer reviews
the analysis and diff, then marks the PR ready.

Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
@joseph-isaacs joseph-isaacs changed the title ci: auto-run Fuzzer Fix Automation on fuzzer-labeled issues ci(fuzz): auto-run fixer on fuzzer issues and open a draft PR with the fix Jun 1, 2026
Fuzzer issue titles are "Fuzzing Crash: <variant> in <target>", so the
previous PR title doubled up as "fix(fuzz): Fuzzing Crash: ...". Strip
the prefix to get "fix(fuzz): <variant> in <target> (#N)".

Rewrite the body to state the target and crash file, point to the issue
thread for the analysis/diff/test, and explain that it is a draft. Drop
any closing keyword: the nightly close-fixed-fuzzer-issues workflow
closes the issue only after re-running the crash, so merging this PR
should not close the issue on its own.

Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
Address review feedback on the issues-triggered fuzzer autofix:

1. The "fuzzer" label is not a trust boundary. Applying a label only
   needs triage permission, which is below write, yet the autofix calls
   a workflow that mints the GitHub App token and runs write-capable
   Claude against attacker-controllable issue-body fields. Add a gate
   job that runs WITHOUT the claude-automation environment and only lets
   the run proceed when the issue was authored by a trusted fuzz-report
   bot, or the actor who opened/labeled it has write/maintain/admin.

2. With explicit workflow permissions, unspecified scopes are disabled,
   so the crash-artifact download via 'gh run download' needs
   actions: read. Add it to the issues-triggered caller, the existing
   attempt-fix-io caller in fuzz.yml, and the reusable workflow job.

Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
@codspeed-hq

codspeed-hq Bot commented Jun 1, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚡ 1 improved benchmark
❌ 1 regressed benchmark
✅ 1273 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation chunked_varbinview_opt_canonical_into[(1000, 10)] 188.4 µs 225.7 µs -16.51%
Simulation chunked_varbinview_canonical_into[(100, 100)] 308 µs 273.2 µs +12.71%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing claude/brave-edison-Jf6ky (613932a) with develop (70be73c)

Open in CodSpeed

…ude-code-action

The draft-PR step keyed on steps.claude.outputs.branch_name, assuming
claude-code-action auto-commits to a branch like it does in
claude-write.yml. But that auto-branch behavior only kicks in when the
action has an issue/PR event to anchor to. The fuzzer fixer runs via
workflow_dispatch/workflow_call, so on a real run (issue #8189) Claude
edited files and posted analysis as the App bot but no branch was ever
pushed, branch_name was empty, and the PR step was skipped.

Add an explicit 'Commit and push fix branch' step that stages Claude's
modifications to tracked files (git add -u, dropping lockfile churn),
commits them signed-off onto fuzzer-fix/issue-<n>, and pushes with the
App token. The draft-PR step now gates on that step's pushed output and
uses its branch name.

Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
A `type: number` workflow input is rendered as a float when interpolated
in an expression, so `${{ inputs.issue_number }}` for issue 8189 became
`8189.0`. That broke the very first step, `gh issue view 8189.0` ("invalid
issue format"), and would also have poisoned the fix branch name and every
issue comment. Declare the dispatch and call inputs as `type: string`; the
`issues` caller's `github.event.issue.number` coerces cleanly to a string.

Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
@joseph-isaacs joseph-isaacs merged commit 326b475 into develop Jun 1, 2026
63 of 64 checks passed
@joseph-isaacs joseph-isaacs deleted the claude/brave-edison-Jf6ky branch June 1, 2026 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/skip Do not list PR in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants