Skip to content

Commit fcda765

Browse files
authored
ci: keep workflow and release-doc comments in step with the ruleset and pins (#2231) (#2249)
- cron-vendor.yml: the "Install and Setup" and "Commit changes" comments state the current behaviour instead of change-relative history, keeping #910 and #1685 as references. - unit-tests.yml: the comment above `required-checks` lists `Lint`, which ruleset 23497679 also requires. - action-gh-release citations name 3.0.3, the pinned version (its src/github.ts differs from 3.0.2 only in error handling), or no version where the pin sits in the same file. Also covers the releasing.rst item of #2228: the `:631-647` third-party line citation becomes `release()`, and its BARE_ELSEWHERE entry in test_unit_tests_queue is dropped. Comments and docstrings only; every workflow loads to the same data (modulo shell comment lines in cron-vendor's run blocks). tests/project and test_docstring_contract pass; actionlint is clean.
1 parent b1405a6 commit fcda765

7 files changed

Lines changed: 28 additions & 30 deletions

File tree

‎.github/workflows/create-release.yml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ jobs:
442442
# release upload``, which never calls Update a release; cron-conda.yml's
443443
# upload does, naming the default branch: see releasing.rst.
444444
target_commitish: ${{ github.event_name == 'workflow_run' && github.sha || '' }}
445-
# "A non-empty explicit token overrides GITHUB_TOKEN" (3.0.2's
445+
# "A non-empty explicit token overrides GITHUB_TOKEN" (the action's
446446
# ``action.yml``), so no ``env:`` names one.
447447
token: ${{ steps.app_token.outputs.token || secrets.GITHUB_TOKEN }}
448448

@@ -673,10 +673,10 @@ jobs:
673673
attestations: false
674674

675675
# #1634: ``gh release upload``, not ``action-gh-release``, which calls
676-
# Update a release before every upload (3.0.2's ``src/github.ts``), where
677-
# GitHub re-checks the release's target against the workflow-file rule: a
678-
# workflow change reaching ``main`` after ``github`` ran would fail this
679-
# after PyPI had published. #1640: a file already ``uploaded`` is left
676+
# Update a release before every upload (``release`` in its
677+
# ``src/github.ts``), where GitHub re-checks the release's target against
678+
# the workflow-file rule: a workflow change reaching ``main`` after
679+
# ``github`` ran would fail this after PyPI had published. #1640: a file already ``uploaded`` is left
680680
# alone, as a rebuild is not byte-identical; after a 502 an asset "may
681681
# leave an empty asset with a state of starter", which ``--clobber``
682682
# replaces. A missing release fails ("release not found") where the action

‎.github/workflows/cron-conda.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ jobs:
736736
# main's tip and fail Create Release's tag check. It also retargets a
737737
# draft at ``commit`` (``updateDraftOrCreateRelease`` and
738738
# ``updateRelease``), though Create Release's ``workflow_run`` run resets
739-
# a draft's target to its sha (softprops/action-gh-release v3.0.2,
739+
# a draft's target to its sha (softprops/action-gh-release v3.0.3,
740740
# ``release`` and ``findTagFromReleases`` in src/github.ts); skipping a
741741
# draft is a precaution. Only the GitHub upload is skipped; the build is
742742
# on anaconda.org regardless.

‎.github/workflows/cron-vendor.yml‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,10 @@ jobs:
115115
python -m pip install -U pip setuptools wheel packaging
116116
python -m pip install -U isort
117117
118-
# `vendor` for `requests` and `beautifulsoup4`, which `all` lacks
119-
# since #910: `pcapkit-vendor` with no target runs every crawler, and
120-
# some import them at module scope (#507). See the `vendor` extra's
121-
# comment in pyproject.toml.
118+
# `vendor` for `requests` and `beautifulsoup4`, which `all` does not
119+
# carry, as it holds core addons only (#910): `pcapkit-vendor` with no
120+
# target runs every crawler, and some import them at module scope
121+
# (#507). See the `vendor` extra's comment in pyproject.toml.
122122
python -m pip install -e '.[all,vendor]'
123123
124124
- name: Update Vendor
@@ -271,9 +271,10 @@ jobs:
271271
run: |
272272
git config --local user.email "github-actions[bot]@users.noreply.github.com"
273273
git config --local user.name "github-actions[bot]"
274-
# #1685: `-a` skips untracked files, so a new module was bumped for but
275-
# never committed, and every later crawl bumped again. Quoted, so git
276-
# matches at any depth; `.py` only, so a leftover backup stays out.
274+
# #1685: `-a` skips untracked files, so a new module is staged here;
275+
# left out, it would stay uncommitted and every later crawl would bump
276+
# for it again. Quoted, so git matches at any depth; `.py` only, so a
277+
# leftover backup stays out.
277278
git add -A -- 'pcapkit/const/*.py'
278279
git commit -am"Bumped version to $(python -c 'import pcapkit; print(pcapkit.__version__)')
279280

‎.github/workflows/unit-tests.yml‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1419,12 +1419,13 @@ jobs:
14191419
run: python util/cap_file_size.py python -m pytest -q -n auto --dist load
14201420

14211421
# Ruleset 23497679's required_status_checks requires these contexts: this
1422-
# job's `Required checks passed`, and a `Compat Python` one per supported version,
1423-
# from the `compatibility` job in `.github/workflows/python-compatibility.yml`.
1422+
# job's `Required checks passed`, a `Compat Python` one per supported version,
1423+
# from the `compatibility` job in `.github/workflows/python-compatibility.yml`,
1424+
# and `Lint`, from the `lint` job in `.github/workflows/lint.yml`.
14241425
# Rulesets match check names literally and support no wildcard, so this job
14251426
# aggregates the gating jobs its `needs:` lists rather than the ruleset naming
1426-
# each matrix cell. The `Compat` legs are required on their own because a job
1427-
# cannot `needs:` a job in another workflow file.
1427+
# each matrix cell. The `Compat` legs and `Lint` are required on their own
1428+
# because a job cannot `needs:` a job in another workflow file.
14281429
#
14291430
# `if: ${{ always() && inputs.gate-only != true }}` and the explicit
14301431
# per-job check below are both required, not decorative:

‎docs/source/contributing/releasing.rst‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ the default branch, and ``tag`` pulls ``main`` before tagging.
173173
build, by Conda Update's ``publish`` dispatch (see `Recovery`_).
174174
* ``pypi`` and ``conda`` attach their files with ``gh release upload``, in
175175
their "Upload package to GitHub Release" steps, not ``action-gh-release``,
176-
which calls Update a release before every upload (3.0.2's ``release()`` in
176+
which calls Update a release before every upload (3.0.3's ``release()`` in
177177
``src/github.ts``, on a release that exists). A file
178178
the release already has is left alone
179179
(:issue:`1640`): the action
@@ -253,7 +253,7 @@ tag the pending version at ``main``'s tip and fail Create Release's tag check.
253253
The action would also retarget a draft at ``commit``
254254
(``Action.updateDraftOrCreateRelease()`` and ``Action.updateRelease()``), which ``omitDraftDuringUpdate`` keeps a
255255
draft, but Create Release's ``workflow_run`` run finds the draft and resets
256-
its target to the run's sha (``action-gh-release`` 3.0.2's ``release()`` and
256+
its target to the run's sha (``action-gh-release`` 3.0.3's ``release()`` and
257257
``findTagFromReleases()``), so skipping a draft is a precaution
258258
against retargeting a release Create Release owns.
259259
Either way the build goes to anaconda.org only, with a ``::notice``. The
@@ -319,7 +319,7 @@ final release, first delete any draft ``v<version>`` the refused run left:
319319
``action-gh-release`` creates a non-prerelease as a draft and publishes it
320320
with Update a release in the same step (``createRelease()`` in
321321
``src/github.ts``), and the next run would reuse that draft and its target
322-
(``:631-647`` there). Then re-run
322+
(``release()`` there). Then re-run
323323
the job; that a re-run reads variables and secrets set since is unmeasured.
324324

325325
Per-Job Evidence, Not a Shared Proxy

‎tests/project/test_release_tags_the_run_sha_1634.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ def releases(self) -> 'list[tuple[str, dict[str, Any]]]':
318318
def test_only_github_runs_the_release_action(self) -> None:
319319
"""``pypi`` and ``conda`` used it to upload, which re-checked the target.
320320
321-
``action-gh-release`` 3.0.2 calls Update a release on an existing
321+
``action-gh-release`` 3.0.3 calls Update a release on an existing
322322
release before uploading anything (``release`` in ``src/github.ts``), passing
323323
the release's own ``target_commitish`` when the input is unset, and
324324
GitHub's REST docs apply the workflow-file rule there to "the new value
@@ -401,7 +401,7 @@ def test_it_is_minted_straight_before_create_release(self) -> None:
401401
self.assertEqual(self.index('github', MINT_STEP) + 1, self.steps['github'].index(self.create_release()))
402402

403403
def test_only_create_release_spends_it(self) -> None:
404-
"""The ``token:`` input, with no ``env:`` beside it: 3.0.2's ``parseToken``
404+
"""The ``token:`` input, with no ``env:`` beside it: 3.0.3's ``parseToken``
405405
prefers a non-empty ``INPUT_TOKEN`` and falls back to ``GITHUB_TOKEN``
406406
(``src/util.ts``), so an ``env:`` token would only ever be a
407407
second credential handed to the action."""
@@ -1642,7 +1642,7 @@ def test_a_new_release_gets_every_file_in_order(self) -> None:
16421642

16431643
def test_a_pattern_matching_nothing_fails(self) -> None:
16441644
"""A change from the action, which only warned: ``fail_on_unmatched_files``
1645-
is unset here, so 3.0.2's ``run`` in ``src/run.ts`` logs "🤔 Pattern '…' does
1645+
is unset here, so 3.0.3's ``run`` in ``src/run.ts`` logs "🤔 Pattern '…' does
16461646
not match any files." and carries on."""
16471647
self.published()
16481648
result = self.upload('pypi')
@@ -1652,7 +1652,7 @@ def test_a_pattern_matching_nothing_fails(self) -> None:
16521652

16531653
def test_a_missing_release_fails_before_any_upload(self) -> None:
16541654
"""A change from the action, which made one: with no release for the tag,
1655-
3.0.2 calls ``createRelease`` (from ``release`` in ``src/github.ts``) with
1655+
3.0.3 calls ``createRelease`` (from ``release`` in ``src/github.ts``) with
16561656
no notes and ``target_commitish`` unset (``parseConfig`` in ``src/util.ts``), which
16571657
Create a release defaults to "the repository's default branch". Making
16581658
the release is ``github``'s job, at the run's commit."""
@@ -1706,7 +1706,7 @@ class TestCondaUpdateNeverMakesTheRelease(CondaDistMixin, unittest.TestCase):
17061706
(``omitDraftDuringUpdate``, through ``CoreInputs.updatedDraft`` in
17071707
``src/Inputs.ts``) but is retargeted at ``commit``; Create Release's
17081708
``workflow_run`` run finds the draft and resets its target to the run's sha
1709-
(``action-gh-release`` 3.0.2's ``release`` and ``findTagFromReleases`` in
1709+
(``action-gh-release`` 3.0.3's ``release`` and ``findTagFromReleases`` in
17101710
``src/github.ts``), so skipping a draft is a precaution against retargeting
17111711
a release Create Release owns. On an existing release it calls Update a
17121712
release with ``target_commitish: commit`` (``Action.updateRelease`` in

‎tests/project/test_unit_tests_queue.py‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -758,11 +758,7 @@ def test_the_scan_is_not_blind(self) -> None:
758758
#: A document that names one of :data:`BY_NAME` may still cite another file bare,
759759
#: as ``:N``; each such citation is listed here with the file it does cite, and
760760
#: any other bare citation there reads as a line of the named workflow.
761-
BARE_ELSEWHERE: 'dict[str, dict[str, str]]' = {
762-
'docs/source/contributing/releasing.rst': {
763-
'631-647': "softprops/action-gh-release 3.0.2's src/github.ts",
764-
},
765-
}
761+
BARE_ELSEWHERE: 'dict[str, dict[str, str]]' = {}
766762

767763
#: A line-number citation: ``N``, ``N-M``, or several joined by commas.
768764
SPANS = r'(\d+(?:-\d+)?(?:,\d+(?:-\d+)?)*)'

0 commit comments

Comments
 (0)