Skip to content

ci: let docs-only and test-only pull requests skip the heavy matrices (#2243) - #2244

Merged
JarryShaw merged 1 commit into
mainfrom
ci/2243-light-prs-skip-matrices
Oct 26, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
ci/2243-light-prs-skip-matrices

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

What is the purpose of your pull request?

  • ci — CI configuration

Description

Closes #2243 (option B). Docs-only and test-only pull requests skip the heavy matrices. Nothing is cancelled: every gate skips through if:.

  • Classification: util/classify_changes.py adds test-only. That is a diff of only tests/ (including conftest.py, _tiers.py and fixtures) plus docs. Workflows, util/, examples/ and pyproject.toml are never test-only. Pushes, other events and an unreadable diff are always code.
  • Gating:
Job Docs-only Test-only
Unit Tests test, integration skipped latest leg only
KTLO, engine-tests, pypcap-parity, experimental, windows skipped skipped
project-tests, Lint run run
Compat legs run, steps skipped same
CodeQL paths-ignore same
Docs build runs only if docs changed
  • Required checks:
    • A workflow skipped by a path filter leaves its required checks pending. A skipped job counts as success (GitHub docs, Troubleshooting required status checks, "Handling skipped but required checks"). So unit-tests.yml, python-compatibility.yml and lint.yml have no path filters, and a test enforces that.
    • A matrix job skipped by if: reports one check under its template name (run 40238795866 shows Python ${{ matrix.python-version }}). So the required Compat Python 3.11–3.15 legs still run on light PRs under their real names, skip their steps and pass.
    • Required checks passed accepts each skip only on the matching class, and never counts cancelled.
  • Unchanged: main pushes and scheduled runs always take the full path.
  • Fail-without-fix: the new and updated tests give 58 failed on origin/main.
  • Tests run: the 92 workflow-reading tests/project files, the tier guard and the docstring contract give 1718 passed. actionlint is clean.

…#2243)

Problem: every pull request queued the full matrices, so a batch of small
docs or test PRs starved the lightweight workflows of runners.

Fix, the owner's option B:
- util/classify_changes.py writes `test-only`, true on a diff of tests/
  and docs alone; anything else stays code.
- Unit Tests: on test-only, `test` and `integration` run their `latest`
  leg alone; the KTLO jobs, `engine-tests` and `pypcap-parity` skip, as do
  experimental.yml's legs. `required-checks` accepts those skips only on
  the class that allows them.
- Python Compatibility classifies too: on a light diff its required legs
  run by name with every check step skipped, as a skipped matrix job would
  leave the required contexts pending.
- CodeQL and the docs build, which nothing requires, skip by a
  pull_request path filter. Pushes and schedules are unchanged.

Test: tests/project/test_light_pull_requests_2243.py evaluates every gate
and matrix on each class; test_unit_tests_queue.py runs the classifier and
the gate step on test-only diffs. Both fail on main.
@JarryShaw JarryShaw added ci Pull requests that change CI or workflow configuration (ci: subject prefix) review: running A cross-review is in flight against the current head - no verdict yet labels Oct 26, 2026
@JarryShaw JarryShaw added this to the PyPCAPKit v1.5 milestone Oct 26, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Review: GOOD TO GO at cdaba22de (Sonnet).

  • Required checks:
    • No required workflow (unit-tests.yml, python-compatibility.yml, lint.yml) has a path filter; only CodeQL and deploy-pages, which nothing requires, do.
    • Run 40238795866 confirms a skipped matrix job reports under its template name. So Compat skips at step level, and compatibility-supported expands exactly 3.11–3.15.
  • No red X:
    • A failed changes job means the full matrix runs and required-checks fails.
    • required-checks accepts each skip only on its class, and never cancelled. A contradictory classification fails the gate.
  • Classification: .github/, util/, examples/, pyproject.toml and root files are all code. Renames list both sides, and an empty diff counts as code. Pushes, schedules, dispatch and workflow_call always take the full path.
  • Test-only coverage: the latest leg, integration latest and project-tests between them run any changed test.
  • Fail-without-fix: 58 failed on origin/main. On the head, the workflow-reading selection gives 1886 passed.
  • Follow-up, by design of the ruling: a test-only PR runs on latest only, so a 3.8–3.10 or PyPy-only break in a test first shows on main.

@JarryShaw JarryShaw added review: good-to-go Cross-review at the current head says ready; CI state is separate and removed review: running A cross-review is in flight against the current head - no verdict yet labels Oct 26, 2026
@JarryShaw JarryShaw moved this to In review in PyPCAPKit Oct 26, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Ready to merge at cdaba22de. Closes #2243 (option B; no cancellation, per the owner).

  • Review: Sonnet GOOD TO GO, first round.
  • CI: all checks complete, Required checks passed SUCCESS, 0 failed.
  • KTLO: no warnings.
  • Ordering: merged into main and run. project leg: 2388 tests, 0 failures.
  • Conflicts: none against the current main.
  • After merge: the next docs-only or test-only PR is the first live run of the light path. Its Compat Python 3.11–3.15 legs should report success with their steps skipped.

@github-actions

Copy link
Copy Markdown
Contributor

Coverage: 91.56% (unit tier, Python 3.15, cdaba22de, Unit Tests run success)

Package Statements Missed Branches Partial Cover
pcapkit (top level) 104 4 20 2 95.16%
pcapkit/const 19599 881 2618 867 92.11%
pcapkit/corekit 2589 74 816 37 96.51%
pcapkit/dumpkit 282 3 102 3 98.44%
pcapkit/foundation 2994 23 1038 25 98.81%
pcapkit/interface 138 4 52 3 96.32%
pcapkit/protocols 17433 218 4584 185 98.15%
pcapkit/toolkit 869 36 298 10 95.20%
pcapkit/utilities 504 7 146 5 98.15%
pcapkit/vendor 4432 1988 1018 167 51.87%

Per-file detail: the coverage-html artifact of this run.

@JarryShaw
JarryShaw merged commit 733749b into main Oct 26, 2026
69 checks passed
@JarryShaw
JarryShaw deleted the ci/2243-light-prs-skip-matrices branch October 26, 2026 14:50
@github-project-automation github-project-automation Bot moved this from In review to Done in PyPCAPKit Oct 26, 2026
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 26, 2026
JarryShaw added a commit that referenced this pull request Oct 26, 2026
…2265)

- #876 item 3: state why the no-else-raise pragma stays, not "the belief"
- #652: the flagless HTTP/2 dump reads "Flags::0 [0]", as #648 renders it
- #2172: section_context raises only on a block holding no section
- add the missing #2222/#2232 MAC/EUI maker entry; cite #2257 on ARP
- add the #1055/#2244 engine-tests and required-checks entry that #849's
  and #856's job descriptions now need
- #800 names HTTP._guess_version, where the method lives; #631 states the
  old MANIFEST.in in the past tense
- drop mentions of never-released names (pcapkit.utilities.timestamp, a
  test constant)
- citation range runs to #2257; CHANGELOG.md regenerated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Pull requests that change CI or workflow configuration (ci: subject prefix)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

design(ci): small PRs queue the full matrix and starve lightweight workflows

1 participant