Skip to content

Fix: gate packaging and the profiling smoke off tests-only changes - #1635

Merged
ChaoWao merged 1 commit into
hw-native-sys:mainfrom
ChaoWao:ci/tests-only-axis
Aug 2, 2026
Merged

Fix: gate packaging and the profiling smoke off tests-only changes#1635
ChaoWao merged 1 commit into
hw-native-sys:mainfrom
ChaoWao:ci/tests-only-axis

Conversation

@ChaoWao

@ChaoWao ChaoWao commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

packaging-matrix ran on any diff that touched tests/ — a change confined to tests/ut/py/ (e.g. #1634) booked two packaging jobs that build, install, and smoke the same wheel it did not touch. The rules justified this with two claims; both were false:

  1. "tests/ is in the sdist include" — no sdist configuration exists in pyproject.toml. The entire packaging surface is wheel.packages = ["simpler_setup", "python/simpler"]; tests/ is not in the wheel at all.
  2. "verify_packaging.sh runs a tests/st/ file as its entry-point smoke" — true, but it is one fixed file (paged_attention_unroll/test_paged_attention_unroll.py --help, run from the source tree, not from the wheel). A changed payload file is exercised by the scene-test job that reads the same corpus.

This completes the symmetry #1607 left half-finished: it removed examples/ from both product jobs' reach (profiling's payload lives there), but tests/ stayed in with a reason that did not survive contact with the workflow.

The change

TESTS_ONLY='^(tests/)'           # same shape as EXAMPLES_ONLY='^examples/'
packaging-matrix:      !non_code_only && !examples_only && !tests_only
profiling-flags-smoke: (a2a3_changed || a5_changed) && !examples_only && !tests_only

New axis is fail-open like every other (unrecognized paths flip it on), and the empty-diff guard sets tests_only=false alongside the other corpus flag. Rules + docs/ci.md updated with the correction; the stale sdist claim is deleted from both.

Testing

  • Replayed the exact grep chain from the workflow against representative file sets (§7 of the rule — behavior first, before changing anything):
    • tests/ut/..., tests/st/..., mixed, and the payload file itself → both jobs skip (UT/ST jobs still run as before)
    • pyproject.toml, simpler_setup/, src/, root conftest.py, .github/workflows/ci.ymlboth run
    • docs-only / .gitignore-only → both skip
  • YAML parses; all seven detect-changes outputs consumed
  • This PR changes ci.yml, which is deliberately outside NON_CODE — the full matrix is expected and correct

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 523fcdad-fa24-4715-9fbd-22251a71cf57

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

CI change detection now reports tests_only alongside examples_only. Packaging and profiling smoke jobs skip changes limited to either corpus. CI guidance and documentation describe the updated classification, fixed payloads, package partitioning, and empty-diff defaults.

Changes

CI corpus-axis gating

Layer / File(s) Summary
Test-only change detection
.github/workflows/ci.yml
The workflow exposes and computes tests_only. Fail-open detection sets it to false when file attribution is unavailable.
Packaging and profiling gates
.github/workflows/ci.yml, .claude/rules/ci-change-detection.md
Packaging and profiling smoke jobs skip example-only and test-only changes. Guidance documents their fixed payloads and corpus partitions.
CI documentation alignment
docs/ci.md, .claude/rules/ci-change-detection.md
Documentation describes both corpus axes, package partitioning, gate conditions, and empty-diff defaults.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ChangeDetection
  participant packaging-matrix
  participant profiling-flags-smoke
  ChangeDetection->>packaging-matrix: Pass examples_only and tests_only outputs
  ChangeDetection->>profiling-flags-smoke: Pass examples_only and tests_only outputs
  packaging-matrix-->>ChangeDetection: Skip corpus-only changes
  profiling-flags-smoke-->>ChangeDetection: Skip corpus-only changes
Loading

Possibly related PRs

Poem

A rabbit checks the CI gate,
“Tests-only changes can now wait.”
Examples hop outside the wheel,
Fixed payloads keep checks real.
Two corpus flags now guide the way—
No needless runs for paths that stray.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes gating packaging and profiling smoke jobs for tests-only changes.
Description check ✅ Passed The description directly explains the tests_only axis, workflow conditions, documentation updates, and validation performed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.claude/rules/ci-change-detection.md:
- Around line 75-90: Update ci-self-cpu.yml’s detect-changes job to export
examples_only and tests_only outputs matching .github/workflows/ci.yml, then add
both gates to the packaging and profiling-flags-smoke job conditions so diffs
confined to examples/ or tests/ are skipped consistently with main CI.

In @.github/workflows/ci.yml:
- Around line 842-850: Update the CI path-filter logic that sets tests_only and
controls packaging-matrix and profiling-flags-smoke so changes to the fixed
smoke payloads under
tests/st/a2a3/tensormap_and_ringbuffer/paged_attention_unroll and the relevant
profiling SIMPLER_* payload paths do not skip both smoke jobs. Add explicit
exceptions while preserving the existing behavior for unrelated tests-only
changes.

In `@docs/ci.md`:
- Around line 136-139: The earlier detect-changes output summary in docs/ci.md
lists only examples_only; update it to include tests_only as well. Ensure the
summary presents both corpus-axis outputs consistently with the documented
detect-changes contract, without changing the surrounding behavior or
explanations.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c13eeb80-48f8-409f-b5a8-43e931016699

📥 Commits

Reviewing files that changed from the base of the PR and between f0e5cba and 878cc54.

📒 Files selected for processing (3)
  • .claude/rules/ci-change-detection.md
  • .github/workflows/ci.yml
  • docs/ci.md

Comment thread .claude/rules/ci-change-detection.md
Comment thread .github/workflows/ci.yml
Comment thread docs/ci.md
@ChaoWao
ChaoWao force-pushed the ci/tests-only-axis branch from 878cc54 to 5c5c786 Compare August 2, 2026 08:17
`packaging-matrix` ran on any diff that touched `tests/` — a change confined
to `tests/ut/py/` booked two packaging jobs that build, install, and smoke the
same wheel it did not touch. That was justified in the rules by two claims,
and both were false:

- "`tests/` is in the sdist `include`" — no sdist configuration exists in
  `pyproject.toml`; `wheel.packages = ["simpler_setup", "python/simpler"]` is
  the entire packaging surface.
- "`tools/verify_packaging.sh` runs a `tests/st/` file as its entry-point
  smoke" — true, but it is one fixed file
  (`paged_attention_unroll/test_paged_attention_unroll.py --help`), and the
  smoke runs it from the source tree, not from the wheel; a changed payload
  file is exercised by the scene-test job that reads the same corpus.

This completes the symmetry that hw-native-sys#1607 left half-finished: it removed
`examples/` from both jobs' reach (profiling's payload lives there), but
`tests/` stayed in with a reason that did not survive contact with the
workflow. Both product jobs now take the same corpus axis on both sides:

```yaml
TESTS_ONLY='^(tests/)'          # same shape as EXAMPLES_ONLY='^examples/'
packaging-matrix:     !non_code_only && !examples_only && !tests_only
profiling-flags-smoke: (a2a3_changed || a5_changed) && !examples_only && !tests_only
```

New shape is fail-open like every other axis (unrecognized paths land in
`REMAINING` and flip the flag on), and the empty-diff guard sets
`tests_only=false` alongside the other corpus flag. The gate table in
`.claude/rules/ci-change-detection.md` and the corpus-axis section of
`docs/ci.md` are updated with the same correction, and the stale sdist claim is
gone from both.

The vocabulary exists twice, and the lane was the other half of the defect:
`ci-self-cpu.yml` runs a lane-local `detect-changes` whose header says the two
must stay in sync, but its `packaging` gate was still bare
`non_code_only != true` — it had never received `examples_only` (hw-native-sys#1607), let
alone `tests_only` — and its `profiling-flags-smoke` still gated on
`st_affected`. Both lanes' `detect-changes` now export the same corpus outputs,
fail-open the same way, and gate the two product jobs identically. The rule's
§4 now states the dual-vocabulary invariant explicitly, and §7's verification
gains an outputs-consistency grep across both workflows.

Verified by replaying the exact grep chain against representative file sets
before changing anything (per the rule's §7): `tests/`-confined diffs — UT,
ST, or mixed, payload file included — skip both jobs; `pyproject.toml`,
`simpler_setup/`, `src/`, `conftest.py`, and `ci.yml` itself still run them.
A change to the gates must run everything, so this PR books the full matrix.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ChaoWao
ChaoWao merged commit bba52c9 into hw-native-sys:main Aug 2, 2026
32 of 33 checks passed
@ChaoWao
ChaoWao deleted the ci/tests-only-axis branch August 2, 2026 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant