Repository navigation
ci: One Python call measures a warning class from the Tier 2 compdb (#2689) - #2698
Merged
Merged
Conversation
RED: ci/warning_findings.py does not exist, so all 8 cases error with FileNotFoundError. The test drives the helper against a stub compiler over a synthetic compile_commands.json, so it needs no build tree, no CMake and no network.
…2689) GREEN: ci/warning_findings.py replays only the selected translation units with the named -Wno-* flags dropped and -c swapped for -fsyntax-only, and prints the findings grouped by directory (a table, or --json for a PR body). It reads the Tier 2 tree's `ninja -t compdb` output, so measuring a call-site-wide warning class costs minutes instead of one 35-minute Pull run per directory. uv run python -m unittest ci/test_warning_findings.py: 8 tests OK.
The per-directory slicing convention was folklore that contradicted #2625's own acceptance criteria and turned one call-site-wide class into N Pull runs (~35 min each) plus N merge-queue runs and N cache invalidations. Section 4 now states the shape (one PR per warning class, the flag removed in the same change, a findings table grouped by directory in the description, measured with ci/warning_findings.py) and keeps every limit: explicit casts only, no behaviour change, no per-file -Wno-*, never an existing C test or public header. Section 2's claim line says which case is the exception.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2689 (acceptance items 1 and 2; item 3 is an issue edit, item 5 is a maintainer call).
Problem
The "one PR per directory" convention for warning-ratchet work (#516 and its children) appears nowhere in
docs/or.claude/— it lives only in issue bodies — it contradicts #2625's own acceptance criteria (the split mechanism is per-directory-Wno-*, which the same issue forbids), and it multiplies an expensive CI run by the number of directories. Measured on #2643: one directory slice cost fivePullruns and 34m48s wall time for the successful one, plus a merge-queue run of the same gate.The measurement that makes one PR per warning class practical did not exist: every worker who wanted the finding count had to hand-run
ninja -t compdb, strip the zccache wrapper and rewrite-cto-fsyntax-onlythemselves.RED —
c63a13e04uv run python -m unittest ci/test_warning_findings.py→ 8 errors,FileNotFoundError: ci/warning_findings.py. The test drives the helper against a stub compiler over a syntheticcompile_commands.json, so it needs no build tree, no CMake and no network.GREEN —
379524300ci/warning_findings.pyreads the Tier 2 build tree'scompile_commands.json:For each selected C translation unit it strips the
zccache/ccachewrapper, drops the-Wno-*flags named with--drop, removes the object output (-o,-MF,-MT,-MQ,-MD,-MMD,-Werror,-c), appends-fsyntax-only, runs the TUs in parallel and prints the findings grouped by directory — a table by default,--json/--outfor the PR body. Exit 1 on any finding (the RED state), 0 when clean. Nothing is linked and no object is written.uv run python -m unittest ci/test_warning_findings.py→ 8 tests OK (grouping, drop, output removal, wrapper stripping, selection, clean exit,replay_argvpurity).Docs —
629eb95dedocs/rust-port/coordination.md§4 gains the policy (one PR per warning class, any number of directories, flag removed in the same change, findings table grouped by directory in the description, measured with the helper) and keeps every existing limit: explicit casts or widened types only, no behaviour change, no per-file-Wno-*, never an existing C test or public header. §2's claim line now says which case is the exception instead of implying per-file PRs.Local checks
uv run python -m unittest ci/test_warning_findings.py— 8 OKuv run python -m unittest ci/test_uv_run.py ci/test_ci_toml.py— 46 OKuv run --no-project ruff check ci/warning_findings.py ci/test_warning_findings.py— clean./lint— ok (35.9 s)Not in this PR
WORKFLOW.md(definition of Ready,obs-rust/.github) is a different repository: separate PR, linked here when it is open.docs/features.mdline: CI tooling, no user-visible change.