Skip to content

fix(ci): tag and upload each Conda Update bump exactly once (#1632) - #1641

Merged
JarryShaw merged 2 commits into
mainfrom
fix/1632-conda-bump-tag-and-upload
Oct 13, 2026
Merged

JarryShaw merged 2 commits into
mainfrom
fix/1632-conda-bump-tag-and-upload

Conversation

@JarryShaw

@JarryShaw JarryShaw commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

Please follow the guide below

  • You will be asked some questions, please read them carefully and answer honestly

  • Put an x into all the boxes [ ] relevant to your pull request (like that [x])

  • Use Preview tab to see how your pull request will actually look like

  • Searched for similar pull requests

  • Followed the coding style (make pylint, make mypy, make isort) — not run: all three lint pcapkit, and no pcapkit/ file changed

  • make test passes, and a test case covers the change — ran the affected test files, not the whole suite

  • Added a changelog entry under docs/source/changelog/ and regenerated CHANGELOG.md, if the change is user-visible — N/A — centralised in docs(changelog): shared 1.5.0 changelog — long-lived, merges last (#610, #616, #617, #618, #620) #657

What is the purpose of your pull request?

Tick the commit type your subject line carries.

  • fix — corrects a defect
  • feat — adds a feature
  • perf — changes performance, not behaviour
  • refactor — changes neither behaviour nor performance
  • test — tests only
  • docs — documentation only
  • ci — workflows or build tooling
  • release — bumps the version or rolls up a distribution
  • chore — anything else

Description of your pull request and other information

Closes #1632. Stacked on #1644, which lands first. Only the top commit is this PR's; the one below it is #1644's.

Cascade. conda-tag and conda-dist called no status-check function. "A default status check of success() is applied unless you include one of these functions" (GitHub, Evaluate expressions), so both were skipped behind the unit-tests gate, which skips on workflow_run (#731). Run 38325136710 pushed f4f94bcad, and both jobs reported skipped. Both jobs now start with !cancelled() and require their predecessors to have succeeded (cron-conda.yml:313, :393).

Unverified commits. Push Changes fetches the tip first. It pushes only if every commit a rebase onto that tip would bring in passes #1644's rule. The rule runs from this checkout's copy, via util/verdict_covers_checkout.py --head --exit-code (:230). If they don't pass, the step writes pushed=false, posts a notice, and the job stays green; the tip's own Unit Tests run raises the next bump. Conda Tag checks out and tags CONDA_COMMIT, the sha that was pushed (:333, :368), with no git pull. If the tag already exists on that sha, it is left alone and the job passes. If it exists on another sha, the job fails, the tag is not moved, and nothing is uploaded (:361).

Second runs. CONDA_CHANGED is now Push Changes' pushed output (:278). It is 'true' only while conda/build still differs from the tip after the rebase. I first said one Unit Tests run raised two triggers; that was wrong. Conda Update 38325136710 and 38325153882 were each raised 2 s after a different Unit Tests run completed: 38323045571 (9083163f5) and 38323026585 (01151b13f). Both were labelled 2e941bbb7, main's tip at the time. The 2026-10-10 pair on 9f37fb051, 38094603411 and 38094684143, came from 38093415347 and 38093432887 the same way. #1644 refuses all four runs. The guard still matters when two runs start from one checkout: the schedule plus a workflow_run, or a re-run.

Tests. test_release_gates.py (115 OK) adds CONDA_ROWS for both rebase cases (:1705, :1711). TestCondaPushReportsWhatLanded (:3913) and TestCondaTagTagsWhatWasPushed (:4154) run the real Push Changes, Create Tag and Push Tag against a local origin, with git's auto-maintenance off as in #1644 (guard at :4123). A git shim lands a merge between Push Changes' fetch and its rebase (:4046): the push is refused as a non-fast-forward, and the step fails having written nothing. With git pull --rebase for git rebase "$tip", that merge is pushed under the bump (:4067). With 9303afe's cron-conda.yml swapped in, unittest reports failures=16, errors=1; with #1644's, failures=24. I ran the 12 related test files one at a time on the previous head; on this one I re-ran test_release_gates, test_workflow_run_verdict, test_workflow_apt_timeouts, test_unit_tests_queue, test_conventions_doc_claims and test_tier_guard. All pass; I did not run the whole suite.

Not done. The five bumps #1632 lists stay unpublished, and conda-dist still has no environment:.

@JarryShaw JarryShaw added fix Pull requests that fix a defect (fix: subject prefix) ci Pull requests that change CI or workflow configuration (ci: subject prefix) review: good-to-go Cross-review at the current head says ready; CI state is separate labels Oct 13, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Verdict: GOOD TO GO at 9303afe11. Sonnet cross-review, two rounds. Round 1 found that a duplicate workflow_run would fail at git tag. Round 2 confirmed the fix by running the real Push Changes script against local origins, and checked it against the logs of runs 38325136710 and 38325153882. With the fix reverted, 12 tests fail on origin/main's workflow and 8 on round 1's. I re-ran both counts myself. Open, not blocking: why one Unit Tests run fires workflow_run twice is still unexplained.

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Coverage: 89.66% (unit tier, Python 3.14, 9ac44a063, Unit Tests run success)

Package Statements Missed Branches Partial Cover
pcapkit (top level) 104 3 20 3 95.16%
pcapkit/const 18858 954 2366 868 91.06%
pcapkit/corekit 2366 67 760 35 96.48%
pcapkit/dumpkit 275 3 100 3 98.40%
pcapkit/foundation 2884 145 1010 35 94.14%
pcapkit/interface 138 7 52 5 93.68%
pcapkit/protocols 17166 226 4580 191 98.06%
pcapkit/toolkit 1036 168 386 5 82.35%
pcapkit/utilities 494 4 146 4 98.75%
pcapkit/vendor 4409 2342 1006 157 43.25%

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

@JarryShaw

Copy link
Copy Markdown
Owner Author

Holding #1641: the label is now review: needs-changes. The #1643 review found a gap this PR opens. Once Conda Tag runs on workflow_run, Create Tag git pulls and tags HEAD (cron-conda.yml:262-263 here). If a human commit lands after the verified checkout, it can get tagged and uploaded without its own Unit Tests verdict. I'm folding the fix in here: tag the sha that Push Changes pushed, and refuse a rebase that brings in non-bot commits. This PR will be stacked on #1644, so please land that first.

@JarryShaw JarryShaw added review: needs-changes Cross-review at the current head says changes are required; see the verdict comment and removed review: good-to-go Cross-review at the current head says ready; CI state is separate labels Oct 13, 2026
…1643)

Conda Update, Vendor Update and GitHub Pages check out github.sha, main's
tip when the workflow_run is raised, not the commit the completed Unit Tests
run verified. In a merge wave an older commit's success authorised work on an
untested tip: Conda Update 38325136710 bumped 2e941bb under 9083163's
verdict.

- Add a `verdict` job to each, running util/verdict_covers_checkout.py. It
  accepts the tip when it is the verified commit, or that commit plus
  github-actions[bot] commits to conda/build and conda/requirements.txt only.
  The acting job's workflow_run clause now also needs `verified == 'true'`.
- Key the workflow-level concurrency group on the verdict's sha for a
  workflow_run, so a stale run that skips cannot cancel a pending run whose
  verdict matches. Other events keep their groups.
- workflows.rst: describe the check and what it leaves uncovered, and
  renumber the three `uses:` citations.

tests/project/test_workflow_run_verdict.py: 25 pass. With origin/main's three
workflows swapped in, 9 fail (failures=22, subtests counted); with the verdict
checkout at fetch-depth 1, 1 fails in all three workflows. A merge whose side
branch runs past the shallow checkout is refused with exit 0, not a crash.
Its throwaway repos run no git maintenance: since git 2.54 a commit's detached
auto repack raced their cleanup ("Directory not empty", git 2.55.0).

Closes #1643
- cron-conda.yml: `conda-tag` and `conda-dist` called no status-check
  function, so the implicit `success()` skipped them behind the `unit-tests`
  gate that skips on `workflow_run` (#731). Both now open with `!cancelled()`
  and require their predecessors to have succeeded explicitly.
- Push Changes fetches the tip and pushes only when the commits a rebase onto
  it brings in pass #1643's rule, run from the checkout through
  util/verdict_covers_checkout.py's new `--head`/`--exit-code`. Otherwise it
  writes `pushed=false` and a notice, and the tip's own run bumps.
- `CONDA_CHANGED` is that `pushed`, 'true' only while `conda/build` differs
  from the tip after the rebase, so a second run from the same checkout skips
  the tag instead of failing on it. `CONDA_COMMIT` is the sha pushed.
- Conda Tag checks out and tags `CONDA_COMMIT`, with no `git pull`. A tag
  already on it is left and the job passes; on another commit it fails.
- test_release_gates.py models the implicit check and its cascade, and runs
  Push Changes, Create Tag and Push Tag against a local origin with git's
  auto-maintenance off, including a merge that lands between Push Changes'
  fetch and its rebase.

test_release_gates: 115 OK; unittest failures=16, errors=1 with 9303afe's
cron-conda.yml, failures=24 with c2ee06a's. test_workflow_run_verdict: 26 OK.

Closes #1632
@JarryShaw
JarryShaw force-pushed the fix/1632-conda-bump-tag-and-upload branch from 9303afe to 9ac44a0 Compare October 13, 2026 06:08
@JarryShaw

Copy link
Copy Markdown
Owner Author

Verdict: GOOD TO GO at 9ac44a063. This head is stacked on #1644's c2ee06a1e, which should land first; only the top commit belongs to this PR. Sonnet cross-review, round 4.

I re-ran both test files myself: test_release_gates 115 OK, test_workflow_run_verdict 26 OK. Not blocking: a merge landing between the fetch and the push turns the run red rather than skipping it. That is tracked in #1649.

@JarryShaw JarryShaw added review: good-to-go Cross-review at the current head says ready; CI state is separate and removed review: needs-changes Cross-review at the current head says changes are required; see the verdict comment labels Oct 13, 2026
@JarryShaw
JarryShaw merged commit 2c46838 into main Oct 13, 2026
38 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in PyPCAPKit Oct 13, 2026
@JarryShaw
JarryShaw deleted the fix/1632-conda-bump-tag-and-upload branch October 13, 2026 16:04
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 13, 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) fix Pull requests that fix a defect (fix: subject prefix)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

fix(ci): conda build bumps have not been tagged or uploaded since #731

1 participant