Skip to content

refactor(util): move ci_timing and vendor_test_gate onto the Actions helper (#2047) - #2063

Merged
JarryShaw merged 1 commit into
mainfrom
refactor/2047-actions-helper-3
Oct 23, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
refactor/2047-actions-helper-3

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

What is the purpose of your pull request?

  • refactor — restructures code without changing behaviour

Description of your pull request and other information

The third batch for #2047: util/ci_timing.py and util/vendor_test_gate.py move onto util/_actions.py, with byte-identical output.

  • ci_timing.py: annotations go through _actions.annotate. The three that carry outside text keep escape=False, since escaping them would change output.
  • vendor_test_gate.py: annotations, the per-run ::group::, the step summary and the verdict output use the helper. Its local escape() is gone, because the helper gives the same bytes.
  • Left out: util/python_versions.py. Sparse checkouts in three workflows fetch that file alone, and create-release.yml runs an old release's copy extracted with git show, so there is no _actions.py beside it.
  • Byte-identical against main's copies:
    • vendor_test_gate: 22 adversarial cases, each on 3.7 and 3.14, comparing exit code, stdout, stderr, outputs, summary and git status. The only difference is the line numbers in a SIGINT traceback.
    • ci_timing: 16 cases on 3.14, since both copies need tomllib.
  • ci: a failed KTLO leg turns main and pull requests red; report it as a warning and exit 0 #1672's KTLO guard: neither script runs in a KTLO or experimental step, and the guard still reads every annotation.
  • Tests: both scripts join SCRIPTS and RUNS in test_actions_helper_2047, rebased onto ci: post the CodeQL report to Discussions (#2030) #2058's codeql_report entry. That file plus test_ci_timing, test_vendor_test_gate_1853, test_codeql_report_2030 and test_ktlo_legs_stay_green_1672: 163 passed.

…helper (#2047)

- util/ci_timing.py: its annotations go through util/_actions.py. Those
  that carry text from elsewhere (an API error, the stopped-early note, a
  finding) stay unescaped, escape=False, as before; output is unchanged.
- util/vendor_test_gate.py: annotations, the per-run ::group::, the step
  summary and the verdict output go through the helper; its own escape()
  goes, the helper's escaping being the same. Output is unchanged.
- tests/project/test_actions_helper_2047.py lists both scripts.
- util/python_versions.py stays as it is: several workflows check it out
  alone, and create-release.yml runs a released copy of it by itself, so
  it cannot import the helper.
@JarryShaw JarryShaw added ci Pull requests that change CI or workflow configuration (ci: subject prefix) refactor Restructuring for its own sake — neither a fix nor a new capability (refactor: 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 92a06a8ef (Sonnet cross-review).

  • vendor_test_gate: byte-identical on 48 cases each under 3.14 and 3.7. These cover special module names (%, ,, :, \n, \r), failing and nonexistent commands, and the output and summary files unset, empty, set or missing. The removed local escape() is the same replace chain as the helper's escape_data.
  • ci_timing: 26 stubbed cases with nasty error and finding text are identical apart from a one-second timestamp.
  • Invocations: both workflows run the scripts from a full checkout, so _actions resolves.
  • Tests: 163 passed.

Pre-existing, not changed here: ci_timing writes three outside strings unescaped (escape=False, to keep the output byte-identical), so a newline in them would split an annotation, as it does 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 22, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Ready to merge at 92a06a8ef: the review is GOOD TO GO and CI is complete (56 passed, 0 failed). The ordering leg ran 1945 tests with 0 failures. The 3.8–3.10 KTLO legs show 0 failing tests, and the PR is based on current main (c98541f84).

@github-actions

Copy link
Copy Markdown
Contributor

Coverage: 91.52% (unit tier, Python 3.15, 92a06a8ef, 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 2565 71 812 37 96.56%
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 17414 219 4574 185 98.14%
pcapkit/toolkit 869 36 298 10 95.20%
pcapkit/utilities 473 7 136 5 98.03%
pcapkit/vendor 4431 1995 1018 167 51.73%

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

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) refactor Restructuring for its own sake — neither a fix nor a new capability (refactor: prefix)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant