Skip to content

ci(release): run the tag checks and the release upload from util/ scripts (#1967) - #2065

Merged
JarryShaw merged 1 commit into
mainfrom
ci/1967-release-scripts-1
Oct 23, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
ci/1967-release-scripts-1

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

What is the purpose of your pull request?

  • ci — changes to CI configuration files and scripts

Description of your pull request and other information

The first batch of step 2's remainder in #1967: create-release.yml's repeated inline shell moves into util/. Only the run: lines change; every env:, if:, shell: and continue-on-error is untouched.

  • util/release_tags.py check: replaces the three identical copies of Check the release tags name this run's commit in github, pypi and conda.
  • util/release_tags.py owner: replaces Check which commit the version's tag names in version_check. It shares the same tag lookup, so the two can't read a tag differently.
  • util/release_upload.py: replaces the two copies of Upload package to GitHub Release in pypi and conda.
  • Script properties: both are standard library only, Python 3.7-parseable, and use _actions. Each job checks out the whole tree before the step, and a test pins that.
  • Behaviour preserved:
    • Exit codes: a failing git/gh exits with its status, a signal as 128+N, a missing binary as 127, and an unset variable as 1.
    • Output: annotations are written unescaped, exactly as echo wrote them. $GITHUB_OUTPUT keys are the same, and output is flushed before every call.
    • Upload globbing: it splits like the shell's unquoted $pattern, including the no-match fallback.
    • The one dropped case: the old ${PCAPKIT_TAGS} also glob-expanded *?[. A tag is v or conda- plus a PEP 440 version, so it never contains those characters.
  • Same output as the old shell: the new tests/project/test_release_scripts_1967.py embeds main's shell verbatim and runs it under bash -eo pipefail next to each script, using stand-in git/gh. It requires the same status, stdout, stderr, $GITHUB_OUTPUT and calls across 9 tag-check, 6 owner and 15 upload cases. A guard confirms those cases reach every exit path.
  • Updated tests:
    • test_release_tags_the_run_sha_1634 runs the scripts.
    • test_release_gates' PUBLISHING_MARKERS now matches util/release_upload.py, so the environment gate still sees the upload.
    • test_actions_helper_2047 lists both scripts.
  • Docs: workflows.rst gains both scripts' rows and a sentence on their interpreter.
  • Results: the release, gate, helper and docs tests give 302 passed. Without the scripts, 64 tests fail.

@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

Copy link
Copy Markdown
Owner Author

GOOD TO GO at 4ccea5ad6 (Sonnet cross-review).

  • Workflow diff: a YAML-level diff of create-release.yml shows exactly six run: values changed. Every env:, if:, shell:, continue-on-error, permission, environment: and comment is identical.
  • Checkout first: each job using a new script checks out github.sha in full before the step.
  • Old vs new: the reviewer ran its own 49 cases of main's shell against the scripts (CRLF, empty input, unset variables, failing git/gh, extra gh columns, duplicate names, spaces and non-ASCII in filenames). Status, stdout, $GITHUB_OUTPUT and calls all match. Only the stderr wording differs on an unset variable.
  • The equivalence test: it embeds main's shell byte for byte, and it went red under all six breakages the reviewer planted.
  • Not reachable by the release: two glob edge cases differ, [^a] and a leading-. pattern. The workflow's patterns are dist/* and the conda output paths, so neither can fire.
  • Unconfirmed: python3 on the macos-26-intel image before setup-python, though the job already relies on it on macos-latest.

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

Copy link
Copy Markdown
Contributor

Coverage: 91.52% (unit tier, Python 3.15, 4ccea5ad6, 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.

@JarryShaw

Copy link
Copy Markdown
Owner Author

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

…ipts (#1967)

Step 2 of #1967, first batch for create-release.yml: the shell its jobs
repeated moves into two stdlib-only scripts, with each step's env:, if:,
shell: and continue-on-error unchanged.

* util/release_tags.py check: "Check the release tags name this run's
  commit" in github, pypi and conda; release_tags.py owner: "Check which
  commit the version's tag names" in version_check. Both resolve the tag
  through one function.
* util/release_upload.py: "Upload package to GitHub Release" in pypi and
  conda.
* workflows.rst lists both scripts, and the interpreter each runs on.

tests/project/test_release_scripts_1967.py runs both against stand-in git
and gh, and runs the former shell on the same cases, requiring the same
status, output, $GITHUB_OUTPUT and calls. The #1634 tests now run the
steps' commands, and PUBLISHING_MARKERS matches the upload script.
@JarryShaw

Copy link
Copy Markdown
Owner Author

Rebased onto main (d7581ebb1), 4ccea5ad6 → a16fe51d6, to resolve the conflict with #2063. The only conflict was SCRIPTS in test_actions_helper_2047, where both sides added names; the resolution keeps both (ci_timing and vendor_test_gate from #2063, release_tags and release_upload from here). git patch-id --stable is identical outside that file. On the rebased tree, the release, helper, workflow-script, KTLO-guard, actionlint and docs-claims tests all pass. The old head's CI was green (56 passed, 0 failed), with 0 KTLO failures. Only that test tuple changed, so you can bypass checks and merge.

@JarryShaw
JarryShaw force-pushed the ci/1967-release-scripts-1 branch from 4ccea5a to a16fe51 Compare October 23, 2026 01:53
@JarryShaw
JarryShaw merged commit fd0d2e7 into main Oct 23, 2026
20 checks passed
@JarryShaw
JarryShaw deleted the ci/1967-release-scripts-1 branch October 23, 2026 01:55
@github-project-automation github-project-automation Bot moved this from In review to Done in PyPCAPKit Oct 23, 2026
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 23, 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) 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