Skip to content

ci: regenerate sample captures through util/regenerate_samples.py (#1967) - #2029

Merged
JarryShaw merged 2 commits into
mainfrom
ci/1967-step2-regenerate-samples
Oct 22, 2026
Merged

JarryShaw merged 2 commits into
mainfrom
ci/1967-step2-regenerate-samples

Conversation

@JarryShaw

@JarryShaw JarryShaw commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

What is the purpose of your pull request?

  • ci — workflows or build tooling

Description of your pull request and other information

#1967 step 2, item 2. Stacked on #2027, so review only the second commit.

  • util/regenerate_samples.py replaces the inline shell in the Regenerate sample captures step of integration, pypcap-parity and gate. It runs make_samples.py, tees its output to $RUNNER_TEMP/make-samples.log, and writes the same fixture-failure annotation, degraded-capture warning and upstream line as before. It uses only the standard library.
  • gate used a literal ::error. It now sets ANNOTATION_LEVEL: error on the step, so every caller states its level.
  • workflows.rst lists the script under Workflow Scripts.

The new pin fails on #2027's unit-tests.yml (5 failed) and passes here (12 passed). A parity test runs the old inline shell and the new script against the same stand-in generators and requires identical stdout, exit status and log. The test files that read unit-tests.yml give 792 passed.

Two differences, both on a misconfigured runner only: an unset RUNNER_TEMP now fails with a traceback rather than through tee, and an unknown ANNOTATION_LEVEL exits 2.

@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 22, 2026
@JarryShaw JarryShaw moved this to In review in PyPCAPKit Oct 22, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

GOOD TO GO at 328b09604 (Sonnet cross-review). The old shell and the new script behave the same on 19 of 20 adversarial inputs, covering CRLF, no trailing newline, invalid UTF-8 and large lines. The one difference is NUL bytes plus a marker: grep prints Binary file … matches, while the script prints the line. make_samples.py never emits NUL. The KTLO twins pick the change up through *integration-steps and *pypcap-parity-steps, and the pin fails on #2027's workflow (5 failed).

@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 22, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

resolve conflicts

- releasing.rst, workflows.rst: replace every `unit-tests.yml:N`
  citation with the job, step `name:`, or comment it pointed at.
- TestWorkflowsCitedByName: add `unit-tests.yml` to `BY_NAME`, so a
  line citation of it, or a bare `:N` beside it, fails.
- Drop `CITATIONS` and `TestDocCitationsResolve`, the line anchors
  the by-name rule replaces.
)

- util/regenerate_samples.py: runs examples/generators/make_samples.py,
  tees its merged output to $RUNNER_TEMP/make-samples.log, and writes the
  same fixture-failure annotation at ANNOTATION_LEVEL, the same degraded
  warning with the marked lines, or the same upstream line as the shell did.
- unit-tests.yml: `Regenerate sample captures` in integration,
  pypcap-parity and gate runs the script; gate passes ANNOTATION_LEVEL:
  error on the step, keeping its level. id, if, continue-on-error and
  shell: bash are unchanged.
- tests/project/test_regenerate_samples_1967.py: the script's outcomes and
  failure paths, a parity run against the former shell, and a pin that
  every site calls the script and no workflow keeps the inline shell.
- workflows.rst: the script joins the Workflow Scripts table.
@JarryShaw
JarryShaw force-pushed the ci/1967-step2-regenerate-samples branch from 328b096 to 87dd51d Compare October 22, 2026 02:42
@JarryShaw

Copy link
Copy Markdown
Owner Author

Rebased with #2027 onto main 8d9b69ec5 as 87dd51d8e. The tree is byte-identical to 328b09604, so the verdict holds. Still stacked on #2027.

@github-actions

Copy link
Copy Markdown
Contributor

Coverage: 91.54% (unit tier, Python 3.15, 87dd51d8e, Unit Tests run success)

Package Statements Missed Branches Partial Cover
pcapkit (top level) 104 4 20 2 95.16%
pcapkit/const 19597 881 2618 867 92.11%
pcapkit/corekit 2567 71 816 37 96.57%
pcapkit/dumpkit 282 3 102 3 98.44%
pcapkit/foundation 2930 23 1022 25 98.79%
pcapkit/interface 138 4 52 3 96.32%
pcapkit/protocols 17436 219 4582 185 98.15%
pcapkit/toolkit 872 36 298 10 95.21%
pcapkit/utilities 529 7 160 5 98.26%
pcapkit/vendor 4431 1995 1018 167 51.73%

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

@JarryShaw

Copy link
Copy Markdown
Owner Author

Ordering check on 87dd51d8e, which contains #2027: python util/run_unittest_leg.py project on this tree gave Ran 1696 tests in 536s, OK (skipped=71), exit 0. KTLO failing test ids: 0 on all 11 legs here, and 0 on #2027's.

@JarryShaw
JarryShaw merged commit da85964 into main Oct 22, 2026
59 checks passed
@JarryShaw
JarryShaw deleted the ci/1967-step2-regenerate-samples branch October 22, 2026 03:45
@github-project-automation github-project-automation Bot moved this from In review to Done in PyPCAPKit Oct 22, 2026
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 22, 2026
@JarryShaw JarryShaw added this to the PyPCAPKit v1.5 milestone Oct 26, 2026
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.

1 participant