Skip to content

fix(tests): keep coverage profiles out of wheel fixture history - #7423

Merged
EffortlessSteven merged 1 commit into
mainfrom
fix/wheel-fixture-coverage-history
Oct 12, 2026
Merged

EffortlessSteven merged 1 commit into
mainfrom
fix/wheel-fixture-coverage-history

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Summary

Coverage instrumentation writes profiles while the wheel-routing fixture runs real policy subprocesses. git add --all admitted those outputs to fixture history, so the exact merge-base path assertion failed with a .profraw path beside the ledger. Stage the explicit copied fixture inputs and intentional new paths, then commit tracked updates only. Preserve LLVM_PROFILE_FILE unchanged in measured child processes.

Swarm / Source Boundary

  • Test-fixture repair for same-repository swarm CI. No analyzer, wheel runtime, workflow, credentials, release, consumer or gate-policy changes.

Source-of-truth Links

Governing claim: postmerge Coverage run38195323754/job114636587184 on d6aa97f; related wheel CI umbrella #4987. Acceptance: profiles stay collectible on disk without entering fixture Git history; actual merge-base and full path assertions remain intact.

Candidate Relationships

Branch: fix/wheel-fixture-coverage-history. Base6bd224b5ee898092a671cb10a2d2ee66b3609057 includes merged #7420. That active file owner completed before this repair; no competing draft replaces it.

Scope

  • Docs/spec/test-only evidence package.

Only Fixture::new, command, commit, change, one regression and a changelog fragment. The regression requires both intended ledger/new input paths, refuses accidental profile and unrelated unrequested tracking, retains both files on disk and checks profile-setting propagation when instrumentation is active. No filename filtering or broad ignore rule.

Support-tier Impact

None; public behavior/output unchanged.

Policy Impact

No policy/workflow/allowance change. Existing process helper remains the authority; process-policy passed without exceptions.

Proof

Baseline real RUSTFLAGS=-Cinstrument-coverage test exited101 with default_1288539452804724987_0_92731.profraw plus the ledger; baseline normal7/7 passed. New deterministic regression observed behavioral RED with both accidental files tracked. Repaired normal and instrumented suites12/12 passed. Matching LLVM tools merged profiles and exported LCOV successfully; measured subprocess coverage setting is preserved. Strict repo-policy all-target Clippy, formatting/diff and process-policy passed before publication.

Published head731dc35fa96bf58a23b77212f760eb2c521597ed, tree6b44efb0a2b1715f66f7c0a45dd879cdf400388c, parent6bd224b5ee898092a671cb10a2d2ee66b3609057. Actual object fetched and tree/parent verified. Fresh published-head normal and instrumented suites12/12 each passed. A clean profile directory contains57 nonempty actual profiles; matching LLVM tools merge and LCOV export both exit0 and emit1789205-byte LCOV containing the fixture source. Exact published-head package all-target Clippy, fmt and diff native exits0. Process-policy passed on the same coherent source tree before publication; no allowance change. No active command remains. Independent source review5486262270 cleared this exact head. Full hosted workspace/all-features Coverage run38200010242/job114651109383 passed, including the previously failing test. Its actual PR merge checkout c8a3c9cbd… combines candidate731dc35 with base6bd224b; it is distinct from the newer-main4d0895 combined tree01dfb2c48f48f9533f3a095b9aa608761e96e25b, whose affected package/Cargo/workflow identities match the reviewed source. Full-workspace coverage is established on the hosted old-base checkout, not rerun on that newer tree. Retained LCOV artifact11726300802:3417467bytes, GitHub digest4533e8dd90c596b760bbb1b6e840a3b41c180c7e2a6a838badba9d66da5ca64f.

Claim Boundary

Fixes fixture-history contamination under coverage; does not classify this as an analyzer regression or qualify unchanged release/package/runtime behavior.

Rollback

Revert the two-file test-only patch; no migration or security-setting change.

Spec-Test-Code Traceability

Tests: fixture_commits_preserve_untracked_profiles_and_track_intended_inputs and unchanged main_drift_and_independent_matching_edits_use_the_merge_base. Code: existing Fixture owner. Changelog disposition: changelog.d/4987-wheel-fixture-coverage.md follows Fixed section/bullet/trailing #4987 convention.

Static Language Check

No static exposure claims.

CI Economics

No workflow, runner, gate, upload or protection changes. Restores existing Coverage test execution and profile collection; package-scoped instrumentation is the local discriminator. The existing coverage label admitted the successful full-workspace hosted qualification; no workflow or readiness bypass was added.

Engineering Check

No production changes or new dependencies, launcher APIs, network/JSON/schema surface. Existing test assertion style and process allowance retained.

Gates

Package normal/instrumented12-test suites and profile merge/LCOV export; strict package Clippy, formatting, diff and process-policy as recorded above. Independent exact-head source review and full hosted Coverage passed. Fresh PR metadata confirms Ready (draft=false) after the parent transition at04:18:45UTC. Tracker owns required validation; its terminal result remains pending. No merge or release claim.

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 8f9d5927-4e3c-4b34-ad5f-5aa945aec22c


📥 Commits

Reviewing files that changed from the base of the PR and between 6bd224b and 731dc35.



📒 Files selected for processing (2)
  • changelog.d/4987-wheel-fixture-coverage.md
  • tools/repo-policy/tests/python_wheel_workflow.rs


🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:



Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.




Summary by CodeRabbit

  • Tests
    • Wheel-routing workflow fixtures now keep coverage instrumentation outputs out of Git history while retaining coverage data from measured subprocesses.
    • Fixture commit checks now verify that only intended repository changes are included and that untracked profile files remain uncommitted.

Walkthrough

The wheel-routing fixture now copies and stages selected inputs, stages tracked updates without adding untracked files, and forwards LLVM_PROFILE_FILE when set. A new test checks environment forwarding and commit contents. A changelog entry describes the fixture coverage behavior.

Changes

Wheel fixture coverage and staging

Layer / File(s) Summary
Fixture inputs, staging, and coverage environment
tools/repo-policy/tests/python_wheel_workflow.rs, changelog.d/4987-wheel-fixture-coverage.md
Fixture setup and change helpers stage explicit paths. Commit helpers stage tracked updates. Subprocesses receive LLVM_PROFILE_FILE when set. A test checks environment forwarding and confirms that commits exclude unrequested untracked files.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 731dc

The fixture keeps intended changes in Git history, leaves untracked coverage outputs on disk, and forwards profile configuration to child processes. No actionable merge blocker was identified.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 1 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly and concisely describes the primary change: preventing coverage profiles from entering wheel fixture Git history.
Description check Passed The description is detailed and relevant. It covers the change, scope, policy impact, proof, tests, claim boundary, rollback, and traceability. Some template fields are summarized rather than complete…

Full details: Docstring Coverage

Explanation

Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 1 files. (1 skipped: 1 unsupported.)


  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR



🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR



  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks the paths we stage,
And keeps stray files beyond the page.
Profile runs leave tracks to show,
While chosen changes make the commit go.
I nibble the changelog, pleased to see,
The fixture keeps its history tidy.

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Member Author

Exact-head handoff ready for independent review:731dc35fa96bf58a23b77212f760eb2c521597ed/tree6b44efb0a2b1715f66f7c0a45dd879cdf400388c, parent6bd224b5ee898092a671cb10a2d2ee66b3609057. Original landed-base real-instrumentation RED reproduced with accidental default_…profraw in immutable fixture Git history; normal baseline7/7 passed. Deterministic new regression observed RED before repair, with both profile and arbitrary unrequested file admitted.

Published head: normal12/12 and instrumented12/12 PASS. Measured processes retain LLVM_PROFILE_FILE; fresh collection57 nonempty profiles, LLVM merge0, LCOV export0 with fixture source included. Exact-head package all-target Clippy/fmt/diff0; process-policy passed coherent prepublication source tree without exception. Actual merge-base and full Git path assertions retained, no filename filtering/ignore/suppression; intentional new paths still tracked and profile/unrequested files remain on disk. Only test fixture + changelog changed.

Executor health was independently verified after reported disconnect; retained instrumented session completed exit0 and remote draft state/head reconciled. No active command remains. Full workspace Coverage CI and independent source review remain pending; no Ready/merge and no main-job cancellation.

@github-actions github-actions Bot 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.

Decision

  • Needs reviewer attention before upstream: findings remain.

Confirmed findings

  • tools/repo-policy/tests/python_wheel_workflow.rs:389 — LEDGER in the new test body is the same LEDGER constant from the existing test group; spelling the intended files as a duplicated format! is correct but the copied "coverage bytes must remain available" payload is a copy-paste smell. Replace with a fixture-local constant to avoid drift.

Verification questions

  • Confirm lLVM_PROFILE_FILE passthrough is exercised only when the host sets the var; the test silently no-ops under normal cargo test and is covered only by instrumented runs. That matches the PR claim boundary but means the propagation path is not asserted in the always-on matrix.
  • Confirm lLVM_PROFILE_FILE is now propagated to measured subprocesses through Fixture::command, but only when instrumentation is active (env var present); assertion in new test verifies child sees the same encoded bytes and that default_*.profraw / unrelated unrequested.txt stay on disk and out of history.

Refuted

  • Fixture::change adding git add -- <path> before commit could accidentally re-stage stray tracked files via path collision; refuted because: git add -- <path> only operates on the literal path argument; path is supplied by caller as intentional.rs or LEDGER, no glob/--all used; --update on commit() still won't pick up unrelated untracked files.
  • The new regression is tautological and would pass even if commit() reverted to git add --all, because the profraw and unrequested.txt are never staged so they would not appear in the diff either way.; refuted because: change() was extended with git add -- <path>, so the ledger and intentional.rs are explicitly staged; if commit() regressed to --all, those intentionally-staged paths would still be the only additions, but more importantly the diff assertion checks exact equality of --name-only output against the two intended paths. A --all regression would still be caught if any other untracked file existed, but the new profraw+unrequested.txt written into the working tree right before the second change() would NOT be committed by --all in this sequence either since they are untracked. So the test as written would NOT actually catch a --all regression here. The test does, however, catch a regression in change() losing the explicit git add -- <path> (it would still pass via the prior --all on the previously committed content, but the new path wouldn't show up). The real protection is the staged-explicit-inputs + untracked-on-disk invariant pair, not the diff exactness alone.
  • Allocation-failure in to_vec/add or env propagation returns recoverable fallback, producing silent loss of coverage profile or staged paths.; refuted because: The change uses Vec::extend plus fixture.git which returns Result; no Box::from conversions are introduced or relevant. Failure surfaces as Err via TestResult, not as silent fallback. Diff does not touch allocation-failure paths.
  • Adding a new inputs local plus a second git add in new() and switching commit() to --update violates smallest-complete-fix by introducing extra staging surface.; refuted because: Staging happens at exactly the two natural entry points (initial fixture, intentional change); commit() now only commits already-staged intent. No filename filter or ignore rule added; no policy/workflow change. The surface area added is the minimum needed to satisfy the merge-base assertion without filename filtering.

Parked follow-ups

  • Profile path collision: regression writes default_regression.profraw but the original RED repro produced default_1288539452804724987_0_92731.profraw (PID/timestamp). The static name in the test will not collide with cargo's instrumentation naming, so the test is stable but is not exercising the exact original failure artifact.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Independent exact-head review: no substantive blocker found at731dc35fa96bf58a23b77212f760eb2c521597ed, tree6b44efb0a2b1715f66f7c0a45dd879cdf400388c, parent/base6bd224b5. Candidate identity verified before/after testing. Scope is the two-file fixture/changelog repair; analyzer, wheel runtime, workflows and gates are unchanged.

Normal and real -Cinstrument-coverage python_wheel_workflow suites each pass12/12. An independent staging control passes normally and instrumented: explicit new input, tracked modification and tracked deletion are recorded exactly; an unrequested nested profile and unrelated file remain untracked and intact. Restoring Fixture::commit to add --all makes the regression fail101 with BOTH accidental paths in the exact diff, so this is not a filename filter or weakened path assertion.

Coverage is measured, not merely tolerated. Matching Rust1.95/LLVM22.1.2 tools merge58 fresh nonempty final profiles and export LCOV including fixture source without warnings. Exported counts show42 executions of repo_policy::python_wheel::command in the actual instrumented child and531 Fixture::command calls. Removing only LLVM_PROFILE_FILE forwarding in an isolated experiment fails the environment controls and reduces measured child-command coverage to0 while11 other tests still pass. Restoring the submitted source returns pristine instrumented12/12. Experimental edits stayed in the review-owned tree; submitted candidate unchanged.

The original Coverage job114636587184 is confirmed to have failed the merge-base path assertion with default_...profraw beside the ledger. Current main80094e5b advances the base without changing the affected package/workflow/Cargo inputs; read-only composition is conflict-free and the isolated combination's narrow normal suite passes12/12. No unrelated broad validation or #7409 analyzer work is reopened.

This supports bounded source clearance and package-scoped instrumentation repair. Full workspace Coverage and current required hosted CI remain separate qualification; no Ready, merge, release or unchanged runtime/package readiness is claimed.

Copy link
Copy Markdown
Member Author

Current-main integration identity reconciled without candidate rewrite: frozen main4d0895ba0eab38ea360f6d8ed4b25fb432c25638 +candidate731dc35fa96bf58a23b77212f760eb2c521597ed produce conflict-free full tree01dfb2c48f48f9533f3a095b9aa608761e96e25b. Entire affected tools/repo-policy treeb06613a0434aae59cf64696f18e764f65d4d70fb, Cargo manifest/lock/toolchain/config, Coverage and wheel workflow blobs exactly match reviewed/instrumented candidate; no affected check rerun needed for unchanged inputs.

Coverage admission investigation: fresh read remains draft, labels empty; exact-head Coverage38197353496 is completed/skipped, and all-event exact-SHA lookup finds no additional Coverage run. Ready alone does not trigger coverage.yml (ready_for_review is absent); PR job requires coverage/full-ci. Supported narrow nonpublishing admission is existing coverage label -> labeled event, executable even on draft. Existing manual workflow_dispatch on candidate branch is also supported by workflow. An unchanged rerun would retain false admission. No label/dispatch/rerun/Ready action executed by this lane; parent owns that action and no duplicate is queued. Full-workspace result remains unestablished until admitted and completed.

@EffortlessSteven EffortlessSteven added the coverage Run coverage lanes and upload coverage artifacts. label Oct 12, 2026 — with ChatGPT Codex Connector
@codecov

codecov Bot commented Oct 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 12, 2026 04:18
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@devin-ai-integration devin-ai-integration Bot 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.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

coverage Run coverage lanes and upload coverage artifacts.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant