Repository navigation
fix(ci): tag and upload each Conda Update bump exactly once (#1632) - #1641
Conversation
|
Verdict: GOOD TO GO at |
|
Coverage: 89.66% (unit tier, Python 3.14,
Per-file detail: the |
|
Holding #1641: the label is now |
…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
9303afe to
9ac44a0
Compare
|
Verdict: GOOD TO GO at
I re-ran both test files myself: |
Please follow the guide below
You will be asked some questions, please read them carefully and answer honestly
Put an
xinto 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 lintpcapkit, and nopcapkit/file changedmake testpasses, and a test case covers the change — ran the affected test files, not the whole suiteAdded a changelog entry under
docs/source/changelog/and regeneratedCHANGELOG.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) #657What is the purpose of your pull request?
Tick the commit type your subject line carries.
fix— corrects a defectfeat— adds a featureperf— changes performance, not behaviourrefactor— changes neither behaviour nor performancetest— tests onlydocs— documentation onlyci— workflows or build toolingrelease— bumps the version or rolls up a distributionchore— anything elseDescription 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-tagandconda-distcalled no status-check function. "A default status check ofsuccess()is applied unless you include one of these functions" (GitHub, Evaluate expressions), so both were skipped behind theunit-testsgate, which skips onworkflow_run(#731). Run 38325136710 pushedf4f94bcad, and both jobs reportedskipped. 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 writespushed=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 tagsCONDA_COMMIT, the sha that was pushed (:333,:368), with nogit 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_CHANGEDis now Push Changes'pushedoutput (:278). It is 'true' only whileconda/buildstill 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 labelled2e941bbb7, main's tip at the time. The 2026-10-10 pair on9f37fb051, 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 aworkflow_run, or a re-run.Tests.
test_release_gates.py(115 OK) addsCONDA_ROWSfor both rebase cases (:1705,:1711).TestCondaPushReportsWhatLanded(:3913) andTestCondaTagTagsWhatWasPushed(: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. Withgit pull --rebaseforgit rebase "$tip", that merge is pushed under the bump (:4067). With 9303afe'scron-conda.ymlswapped in, unittest reportsfailures=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-diststill has noenvironment:.