Repository navigation
Retry CLI release asset uploads and verify the release has every platform - #11426
igorlukanin wants to merge 4 commits into
Conversation
|
Claude finished @igorlukanin's task in 2m 45s —— View job Review complete — sound fix, worth landing. 2 medium, 3 low; the notable one is that the new guard job is skipped in exactly the failure mode it was written for. 5 inline comments posted. Full reviewTasks
What's good
Findings
Finding #2 is the only one I'd want answered before merge — it's a plausible regression rather than a style point, and I couldn't resolve it from the repo alone (I don't have API access to inspect who authored the v1.7.14 release object). Notes on the other review dimensions
|
|
Claude finished @igorlukanin's task in 2m 7s —— View job Re-review of Full reviewTasks
How the prior findings landed
New findings
Only #1 would I fix before merge — it silently disarms the manual recovery you actually used last release. #2 and #3 are polish. Other dimensions
|
|
Claude finished @igorlukanin's task in 1m 52s —— View job Re-review of Full reviewTasks
The fix in
|
| Severity | Location | Issue |
|---|---|---|
| Medium | L872 | upload-artifact@v4 409s on a duplicate artifact name, and artifacts persist across attempts — so Re-run failed jobs (the v1.7.14 recovery path) dies at the marker step before retrying the release upload. Needs overwrite: true. Unchanged in 382dc5c; re-affirmed, not re-posted. |
| Low | L914 | grep -qx treats the asset name as a regex; -qxF is the exact-match intent. |
| Low | L848 | retry_on: error doesn't cover timeout_minutes expiry. Answered and consciously deferred to match file convention — non-blocking. |
overwrite: true is the one I'd still fix before merge; it's a one-line change and it disarms the manual recovery you actually used last release.
New finding
| Severity | Location | Issue |
|---|---|---|
| Low | L866 | The marker upload is a hard step with no retry, so an artifact-service blip on a leg whose release upload succeeded now reds an otherwise-complete release. Fails safe, but widens what can fail a release run; continue-on-error: true is the alternative if you'd rather it not gate. |
Other dimensions
- Correctness — the marker scheme reads clean end to end: per-target artifact names can't collide under
merge-multiple: true,sort -uis harmless,!cancelled()on both the marker steps and the guard job is the right choice in each place, and thestate == "uploaded" and .size > 0filter closes the stuck-asset hole. - Permissions —
download-artifact@v4for the current run goes through the Actions Results API with the runtime token, notGITHUB_TOKEN, so the guard'scontents: readnarrowing does not break the download. (Only cross-run downloads would needactions: read.) - Security — unchanged:
${{ matrix.target }}is the only expression reaching a shell and it's workflow-authored; tokens are passed viaenv:. - Performance — five tiny artifacts plus one short
ubuntu-24.04job per release. Negligible. - Testing — still not exercisable from a PR on a
push: tagsworkflow. The openoverwrite:finding in particular only surfaces during a re-run, i.e. when someone is already firefighting. - Documentation — the inline comments now carry the why for every non-obvious choice (
shell: bash, both!cancelled()sites, thestatefilter, the release-pre-exists assumption, and the empty-marker case). No user-facing docs change warranted.
|
Claude finished @igorlukanin's task in 1m 22s —— View job Re-review of Full reviewTasks
The changes in
|
| Prior | Status |
|---|---|
upload-artifact 409 breaks re-run |
Fixed via overwrite: true. Resolved. |
| marker upload can redden a complete release | Fixed via continue-on-error: true. Resolved. |
grep -qx treats name as regex |
Fixed via -qxF. Resolved. |
| unreachable "matrix did not run" diagnostic | Fixed in 382dc5c (find … -exec cat). Resolved earlier. |
retry_on: error vs any |
Unchanged, thread left open. Answered and deferred to match file convention — non-blocking. |
New finding
| Severity | Location | Issue |
|---|---|---|
| Low | L873–878 | overwrite: true is delete-then-upload; with continue-on-error swallowing a failure after the delete, that target silently drops out of the guard's expected set. Only reachable on a re-run — which is the recovery path for a failed upload, so it's the one case where losing verification reproduces the gap. Narrow; retrying the marker upload instead of swallowing it would get both properties, but not worth blocking on. |
Other dimensions
- Correctness end to end — the marker scheme holds: per-target artifact names can't collide under
merge-multiple: true, one clean line per marker viaecho,sort -uharmless, the<<< "$expected"loop guarded by the preceding-ztest,state == "uploaded" and .size > 0closes the stuck-asset hole, and!cancelled()is the right choice at all three sites (both marker steps and the guard job). - Permissions —
download-artifact@v4for the current run uses the Actions Results API with the runtime token, so the guard'scontents: readnarrowing doesn't break it.--repopassed explicitly since the guard has no checkout. Both correct. - Security — unchanged:
${{ matrix.target }}is the only expression reaching a shell and it's workflow-authored; tokens go throughenv:rather than argv. - Performance — five tiny artifacts plus one short
ubuntu-24.04job per release. Negligible. - Testing — still not exercisable from a PR on a
push: tagsworkflow. The remaining low only surfaces during a re-run; the main paths (retry, guard, marker) will be validated by the next tagged release. - Documentation — inline comments now carry the why for every non-obvious choice (
shell: bash, all three!cancelled()sites, thestatefilter, the release-pre-exists assumption, the empty-marker case, and both new flags). No user-facing docs change warranted —install-cli.shbehavior is unchanged.
…and match asset names literally
5c06a12 to
f6c36de
Compare
|
Claude finished @igorlukanin's task in 1m 13s —— View job No code changes in this push — DetailsTasks
What changedThe four commits carry the same messages and the same tree; only their parent and committer dates moved (all re-dated Re-verified in the file as it stands, since a rebase is exactly where a fix can quietly get dropped:
ThreadsAll 10 threads on this PR are resolved, including the three lows and the deferred Standing residuals, unchanged and consciously accepted:
Other dimensions
|
|
Closing in favour of #12435, which takes a different approach to CORE-694. Instead of making the upload more reliable, the installers, Generated by Claude Code |
…binary (#12435) **Check List** - [x] Tests have been run in packages where changes have been made if available - [x] Linter has been run for changed code - [x] Tests for the changes have been added if not covered yet - [x] Docs have been added / updated if required **Issue Reference this PR resolves** CORE-694. Replaces #11426. **Description of Changes Made** v1.7.14 shipped without `cube-aarch64-apple-darwin.tar.gz`, so `install-cli.sh` 404'd on every Apple Silicon Mac. The installers download from `releases/latest/download/…`, and `cube update` and the background update check read `/releases/latest`. All of them looked only at the single latest release. When that release lacks this platform's binary, they fail. That happens after a failed upload, and also briefly during every release: binaries are uploaded after the release is published. Now `install-cli.sh`, `install-cli.ps1` and the CLI (`update::latest_release`) list recent releases. Each picks the **highest stable version that lists this platform's asset**: - Drafts and prereleases are skipped. In the CLI, assets that are still uploading (`state != "uploaded"`) are skipped too. - The pick is by version, not by list position. Maintenance releases such as v1.6.75 are published between v1.8.x releases. - If a download fails, the installers try up to 3 candidates. If the API is unreachable or rate limited, they fall back to `releases/latest`. - `GITHUB_TOKEN`, when set, is sent only to `api.github.com`. It never goes to a `CUBE_RELEASES_URL` mirror or to download URLs. - `CUBE_VERSION` pinning is unchanged. - Response size: the list of 30 releases is about 2 MB raw. It is now requested gzip-compressed, which brings it to about 160 KB: `curl --compressed` in the installer, and reqwest's `gzip` feature in the CLI. The per-command background check reads only 10 releases (about 54 KB). - `cube update` and the background check now share one version comparison. - Docs: `reference/cli.mdx` describes how a release is picked, plus `CUBE_RELEASES_URL` and `GITHUB_TOKEN`. **Tests** - `rust/cube-cli/tests/installers.sh` runs both installers against a local fake of the releases API. The fake has: - a higher-versioned draft; - a newest release with no CLI assets; - a maintenance release published later; - a prerelease; - a release whose download 404s. The test checks that each installer installs the right release. It fails on master (installs the real latest) and passes here. It runs in a new `installers` job in Cube CLI CI on Ubuntu and macOS, and both images have `pwsh`, so the PowerShell installer is covered too. - Unit tests for `newest_installable` cover a missing platform asset, an asset still uploading, a maintenance release published later, prereleases and drafts, and an unsupported platform. - Checked by hand: `cube update --check` and `install-cli.sh` against the real API both resolve v1.8.13. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01TgekqDHTbR46jimJ7dY77N --------- Co-authored-by: Claude <noreply@anthropic.com>
The v1.7.14 release shipped without
cube-aarch64-apple-darwin.tar.gz, so the documented install command404'd on every Apple Silicon Mac. The binary built fine — only the upload step failed, with a one-off
Connect Timeout Error (attempted address: api.github.com:443, timeout: 10000ms). Becausecube-clirunsfail-fast: falseand nothing depends on it, the rest of the release published normally and the gap was invisible until someone tried to install.Two changes:
nick-fields/retry@v3(the convention already used elsewhere in this workflow), 5 attempts with a 30s wait, so a single API blip no longer drops a platform. It now shells out togh release upload --clobberrather thansvenstaro/upload-release-action, since that action has no retry input of its own.shell: bashis set explicitly — the retry action defaults to powershell on Windows, where${GITHUB_REF_NAME}would not expand.cube-cli-assets-completejob runs after the matrix and fails the release if any of the five targets is missing from the release. A release that is missing a platform is now a red run instead of a silent 404.The missing v1.7.14 asset has been re-uploaded separately by re-running the failed job, so the install works on Apple Silicon again.
Only the
cube-cliupload path is touched here; the other fivesvenstaro/upload-release-actioncall sites (cubestored, native) have the same exposure but are left alone to keep this reviewable.CORE-694