chore: Self healing release - #533
brunomenezes wants to merge 3 commits into
Conversation
|
|
I think this adds even more complexity because of a bug in npm that is already fixed |
endersonmaia
left a comment
There was a problem hiding this comment.
I found the workflow confusing, but sent my 2 cents on review.
| description: "Git ref to build the images from, e.g. refs/tags/@cartesi/sdk@0.12.0-alpha.42 (default: triggering commit)" | ||
| type: string | ||
| required: false | ||
| default: "" |
There was a problem hiding this comment.
default: "" and the comment says it's the triggering commit
There was a problem hiding this comment.
empty will be the commit that triggered the action.
| - name: Install Foundry | ||
| uses: foundry-rs/foundry-toolchain@908c540300062bd5a7e473851cdb4282204cee09 # v1.9.1 | ||
| with: | ||
| version: v1.4.3 |
There was a problem hiding this comment.
shouldn't it be 1.5.1 already? to match what's used on cartesi/rollups-contracts
There was a problem hiding this comment.
I mentioned in the PR description why it is here. It will be removed afterwards.
What is confusing, could you explain? We have a bunch of automation, but it is not considering situations as the problem that happen this Saturday demonstrated. The SDK release and tags exist, but the publishing of the SDK images don't unless @tuler or whoever has authorisation on docker hub published it manually from that point onwards. That is not a good solution in my opinion. Let me know what in the PR description is confusing |
I'm a little away from this code for some time, and I may have lost some context, but I think I'm spoiled by the changesets tool. Instead of this PR, can't we just bump packages versions that are failing and move on? Would that work? |
|
I think this is more machinery than the problem needs. What happened on Saturday was a one-off: a tooling bug, already fixed in #532, failed the publish step after the tags were pushed. A rare partial failure calls for a simple manual recovery, not checks that run on every push. This approach adds ongoing cost and risk:
A simpler fix: add a manual trigger to on:
workflow_dispatch:
inputs:
ref:
description: Tag to build, e.g. refs/tags/@cartesi/sdk@0.12.0-alpha.42
required: trueKeep the For CLI binaries, a matching The recovery becomes: something failed → run the workflow once with the tag. It's explicit, easy to see, and adds nothing to the normal release path. Generated by Claude Code |
That would work. I approved the changes anyway. |
Summary
The current state is a blocker to me as per description I am adding below. Therefore I will continue aligning my PRs using the temporary commits some of the branches have to be able to continue development with the latest SDK. However, I need the published SDK on docker hub to be able to get those PRs merged and the current mechanism does not allow that after a partial failure. Also, I am adding foundry to that new reusable workflow because is needed to what is in prerelease/v2-alpha, but it will be removed on #529 which already contains changes from #520 that remove the use of
cartesi/devnetfrom theapps/cliWhat happened on 2026-10-03
The
2.0.0-alpha.36release failed partway through.changeset publishbroke under npm 12 (fixed in #532) after it had already:@cartesi/cli@2.0.0-alpha.36and@cartesi/devnet@2.0.0-alpha.15to npm@cartesi/sdk@0.12.0-alpha.42Because the step failed,
changesets/actionnever set itspublished/publishedPackagesoutputs. Those outputs are the only thing that triggers the SDK image build and the CLI binary upload, so both were skipped:cartesi/{sdk,rollups-runtime,rollups-database}:0.12.0-alpha.42were never pushed to Docker Hub or GHCR@cartesi/cli@2.0.0-alpha.36pre-release has no binariesRe-running doesn't help. Every later run finds nothing new to publish, so the outputs stay false, and nothing in Actions can rebuild a release that's already tagged.
What this PR changes
Publishing artifacts is now decided by what exists, not by what this run just published.
artifactsjob inrelease.yaml. It runs afterrelease, even ifreleasefailed, and checks the current SDK and CLI versions:@cartesi/sdk@<version>tag exists and any of the 3 images is missing from Docker Hub or GHCR, the images are rebuilt.@cartesi/cli@<version>GitHub release exists and has fewer than 4cartesi-*.tar.gzbinaries, they're rebuilt. Only those tarballs are counted, so other files on the release can't hide a missing binary.sdk.yamltakes an optionalrefinput. When it's empty, checkout behaves as before, so PR builds are unchanged.cli-binaries.yamlchecks out the tag and cross-compiles all 4 targets (darwin and linux, arm64 and x64) with Bun on one runner. It then uploads them to the existing release withgh release upload --clobber.--clobberreplaces only assets with the same name, such as tarballs left by a partial upload, so a retry doesn't fail with "asset already exists". Other files on the release are kept.build_sdkandcli_binariesrun only whenartifactsfinds something missing. The old checks based onchangesets/actionoutputs are removed.Why
build_sdkandcli_binariesare skipped.Just a note not a limitation: this only covers the current version of each package, not versions that were missed and have since been superseded.