Repository navigation
Desktop release: start the publish job alongside the build matrix - #8193
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 476400323a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # The three matrix legs, by their `name:` (Build <matrix.label>). | ||
| LEGS=('Build macOS (Apple Silicon)' 'Build Linux (x64)' 'Build Windows (x64)') | ||
| POLL=30 | ||
| DEADLINE=$(( $(date +%s) + 75 * 60 )) |
There was a problem hiding this comment.
Size the wait for the entire serial matrix
When the three build legs cumulatively take more than 75 minutes, this deadline fails the publish job even though the builds are still legitimately running. The build strategy uses max-parallel: 1, and each of its three matrix jobs has a 60-minute timeout, so the matrix can take up to 180 minutes, plus runner queueing; the former needs: build gate imposed no 75-minute aggregate limit. Increase both this deadline and the publish job timeout to cover the whole serial matrix and the remaining publish steps.
Useful? React with 👍 / 👎.
|
|
||
| while :; do | ||
| if ! JOBS="$(gh api --paginate \ | ||
| "repos/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}/jobs?per_page=100" \ |
There was a problem hiding this comment.
Include prior job attempts when retrying publish
When publish-release alone is rerun after a transient publish or jobs-API failure, this request uses the jobs endpoint's default filter=latest, so the successful build jobs from the earlier execution are omitted and all three names remain MISSING until the 15-minute failure. GitHub documents that latest returns jobs from the most recent execution while all includes old executions in the List jobs for a workflow run endpoint. Query all attempts and select the newest record for each build leg so the normal “re-run failed jobs” recovery path can reuse the already-successful builds.
Useful? React with 👍 / 👎.
|
Validated on real CI, not just a stub. The waiter step from this branch was extracted verbatim and run in a harness that models the release job graph with stubbed builds, at danielhanchen/release-graph-test. Success path (run 31268015946):
Publish started on the same second as the first build leg, which is the whole point of the change. The waiter then polled and released cleanly: It proceeded 24s after the last leg finished, consistent with the 30s poll. Failure path (run 31268196463, Linux leg made to fail):
Local stub tests also covered: a |
…ld pre-flight one (#8240) The desktop release workflow no longer runs a VirusTotal step inside publish-release. #8194 moved it into its own virustotal-scan job that runs after the release is published, and #8193 replaced publish-release's `needs: build` with a "Wait for the build matrix" step so the job can queue for its runner during the build. Five tests still encoded the old shape and fail on main for every PR: TestWorkflowOrdering::test_scan_runs_after_the_release_is_validated TestWorkflowOrdering::test_release_creation_is_deferred_until_after_the_scan TestWorkflowOrdering::test_scan_runs_before_the_assets_are_published TestWorkflowOrdering::test_the_scan_script_is_checked_out_first test_build_matrix_hands_off_assets_without_release_credentials Rewrite them against the current layout rather than dropping the assertions. The scan is a post-publish sweep and is advisory by design, so what is worth pinning is that it cannot be quietly lost: - virustotal-scan exists and `needs: [publish-release]`, so deleting the job or the dependency is red, - the job carries no `if:`, and no step does either except the summary, which is `if: always()` so the verdict survives a failed scan, - the sparse checkout of scripts/virustotal_scan.py is asserted by mechanism rather than by step name, along with the guard that exits 1 when the script is absent, - the scan step does not swallow the script's exit status: no continue-on-error, no `|| true`, no `exit 0`, and no `--fail-threshold` pinned to a value the script treats as never-fail, - continue-on-error appears on exactly one job and on no step of any job that handles a bundle, - the downloaded artifact pattern matches what the build matrix uploads, - publish-release does not re-inline the scan. For the permissions test, the build-to-publish handoff is now gated by the waiter, so assert that instead of `needs: build`: it covers every matrix leg by name, refuses to publish a leg that did not succeed, and refuses to publish a leg whose job record never appeared. Add a check that the new scan job holds no release credentials, since it handles the bundles and uploads them off-box. Docstrings say plainly that this is a post-publish sweep, so a future reader does not go looking for a pre-publish gate that is not there. Co-authored-by: danielhanchen <[email protected]>
Summary
publish-releasenow declaresneeds: [prepare-version]instead ofneeds: [prepare-version, build], so it starts with the build matrix and spends the build queueing for its runner instead of queueing only after the last leg goes green. A new "Wait for the build matrix" step restores the gate thatneeds: buildprovided.Why
On the
v0.1.526-betarelease, all three legs finished at 16:33:08 andPublish desktop releasethen sat withrunner_name=nullfor about two minutes short of half an hour, waiting for anubuntu-latestslot behind 56 queued runs, to then do 17 to 40 seconds of work. The queue wait is pure latency bolted onto the end of every release.This is the same fix, and the same reasoning, as
assemblein unslothai/llama.cpp'sunsloth-prebuilt.yml, which records the problem it solved:The gate
Dropping
needs: buildgives away the success check, so the waiter has to be at least as strict. Publishing a partial release is much worse than publishing late. It polls this run's job list every 30s and:completedsuccess, rather than holding a runner to reach the same answer latertimeout-minutesgoes from 20 to 90 because the job now spans the build, whose legs cap at 60.actions: readis added because the job-levelpermissionsblock replaces the workflow-level one and the waiter needs to read the run's job list.Behaviour change worth knowing
If a build leg fails,
publish-releasepreviously showed as skipped. It will now show as failed, with the failing leg named in the log. Nothing is published in either case. llama.cpp made the same trade.Test plan
The waiter was extracted and run against a stubbed jobs API:
success-> exits 0, "all 3 build legs finished and succeeded"failure-> exits 1, names the legcancelled-> exits 1, names the legin_progress-> keeps polling, does not proceedEvery
run:block in the workflow was also shell-parsed; the only parse error is a pre-existing PowerShell step on the Windows leg, untouched here.Note
Independent of #8191 and touches a different part of the file. #8191 shortens the build phase; this removes the queue wait that follows it. Either can merge first.