Skip to content

ci(fuzz): discover fuzz targets dynamically#1290

Merged
Benoît Cortier (CBenoit) merged 4 commits into
masterfrom
ci/fuzz-new-targets
May 20, 2026
Merged

ci(fuzz): discover fuzz targets dynamically#1290
Benoît Cortier (CBenoit) merged 4 commits into
masterfrom
ci/fuzz-new-targets

Conversation

@CBenoit
Copy link
Copy Markdown
Member

Mirror the check features pattern: expose cargo xtask fuzz list (with --format github-matrix) that enumerates fuzz targets by scanning fuzz/fuzz_targets/*.rs, and have the fuzz workflow build its matrix from that output. New targets dropped into the directory are picked up by CI automatically, with no workflow edits required.

Mirror the `check features` pattern: expose `cargo xtask fuzz list`
(with `--format github-matrix`) that enumerates fuzz targets by
scanning `fuzz/fuzz_targets/*.rs`, and have the fuzz workflow build
its matrix from that output. New targets dropped into the directory
are picked up by CI automatically, with no workflow edits required.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the xtask fuzz tooling and CI workflow so fuzz targets are discovered dynamically by scanning fuzz/fuzz_targets/*.rs, allowing the GitHub Actions fuzz job matrix to be generated automatically without hardcoding target names in the workflow.

Changes:

  • Removed the hardcoded FUZZ_TARGETS list and replaced it with filesystem-based discovery (discover_targets).
  • Added cargo xtask fuzz list (supports --format human and --format github-matrix) to expose discovered targets for local use and CI.
  • Updated the fuzz GitHub Actions workflow to build its job matrix from cargo xtask fuzz list --format github-matrix.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
xtask/src/prelude.rs Removes re-export of the removed FUZZ_TARGETS constant.
xtask/src/main.rs Drops FUZZ_TARGETS, switches to typed ListFormat, and wires up fuzz list.
xtask/src/fuzz.rs Implements dynamic fuzz target discovery and emits GitHub matrix JSON.
xtask/src/cov.rs Uses dynamic fuzz target discovery when generating fuzz coverage.
xtask/src/cli.rs Adds fuzz list subcommand and introduces ListFormat parsing/defaulting.
.github/workflows/fuzz.yml Adds a setup job to generate the fuzz matrix dynamically and uses matrix.include.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread xtask/src/fuzz.rs Outdated
Comment thread xtask/src/fuzz.rs Outdated
@CBenoit Benoît Cortier (CBenoit) merged commit 5663ce2 into master May 20, 2026
31 of 33 checks passed
@CBenoit Benoît Cortier (CBenoit) deleted the ci/fuzz-new-targets branch May 20, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants