Repository navigation
ci: let the SDK release workflows rebuild tags older than v4.2.0-beta.5 - #5107
Conversation
The documented fallback for re-releasing an older tag's Kotlin or Swift SDK is to dispatch the workflow from the dev branch with the older tag. The build job checks out the tag and then ran the local composite action release-cargo-target-cache, which GitHub loads from the checked-out tree. Tags before v4.2.0-beta.5 do not contain it, so the job stopped there. Both workflows now carry the action's step inline, with the same cache name, size cap and free-space floor. The action stays for the npm build, with a note to keep the copies in sync. The Swift job also links the workspace target/ to the release cache. build_ios.sh before v4.2.0-beta.5 ignores CARGO_TARGET_DIR and reads its libraries and headers from target/, while cargo builds into the cache. The link is removed at the end of the job so PR jobs sharing the workspace never build into the release cache. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing (2)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: dashpay/platform/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe Kotlin and Swift release workflows now prepare Cargo target caches inline. The Swift workflow also links workspace ChangesSDK release cache workflows
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~12 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to No actionable release-workflow issue remains in the reviewed change; it is ready for normal merge checks. Architecture SummaryArchitecture risk: 🔵 Low · up to The changed surface does not map to a changed system, dependency edge, entrypoint, or external dependency. Changed systems: None identified. Architecture concerns Review detailsBefore / after behavior
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
✅ Final review complete — no blockers (commit 6bb0c65) · triage: low |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
Verified the supplied review evidence against exact head 6bb0c65; no actionable in-scope findings remain. Both inline cache scripts preserve the shared action's implementation, effective inputs, and shell, and local checks confirmed Swift link creation, directory guarding, and cleanup preserve cached contents. YAML parsing, cache-script syntax checks, and git diff --check passed; SDK builds and GitHub workflow runs were not performed.
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: muse-spark-1.3-contributor (agent: phase1-reviewer, role: architecture-layering); reviewer 3: gpt-6-astra (agent: phase2-reviewer, role: general); reviewer 4: gpt-6-astra (agent: phase2-reviewer, role: architecture-layering); final verifier: gpt-6-astra (agent: astra-verifier, role: final-verifier)
- Triage:
lowbygpt-6-astra(effort low) — This is a small, contained CI fix that inlines existing cache setup and adds a guarded Swift target-directory symlink with cleanup, without changing SDK implementation or any critical surface. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort high); agentphase1-reviewer,muse-spark-1.3-contributor— architecture-layering (completed, effort high); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity below 15% reserve: weekly 13% left, 5h 100% left),glm-5.3-flash(zai below 15% reserve: 5h 87% left, weekly 13% left) - Fresh verifier:
gpt-6-astra— final-verifier; agentastra-verifier - Phase 2 reviewers:
gpt-6-astra— general (completed, effort medium); agentphase2-reviewer,gpt-6-astra— architecture-layering (completed, effort medium); agentphase2-reviewer
|
Bots are done — your move: post |
llbartekll
left a comment
There was a problem hiding this comment.
Non-blocking: the cache script now lives in three places with a keep-in-sync note; a sparse checkout of ${{ github.workflow_sha }} into a subdirectory and a uses: from there would keep a single copy.
Basic explanation
To re-release the Kotlin or Swift SDK for an older platform tag, the docs say to start the SDK release workflow from the dev branch and pass the older tag. That path was broken. The workflow checks out the old tag and then calls a helper step that lives in a file only newer tags have, so the run stopped before building anything. This PR writes that helper step directly into both workflows, so it no longer depends on the old tag's files. For Swift it also bridges one more difference in the old build script.
Example:
release-swift-sdk.ymlfromv4.2-devwithtag=v4.1.2failed at "Prepare release Cargo target cache": that step wasuses: ./.github/actions/release-cargo-target-cache, and that action does not exist in v4.1.2's tree.release-kotlin-sdk.ymlfailed the same way.build_ios.shstill looks for its libraries under./target, and now finds them through atargetlink to the release cache.Value: The documented recovery path for an older tag works again: every v4.1.x tag, and v4.2.0 dev and beta tags before beta.5 dispatched from
v4.2-dev.Risks: Low. The inline step runs the action's own script with the same inputs, so new tags behave exactly as before. The failing runs stopped in the build job, before the attach and Maven jobs, so they published nothing. The failure was safe, but it blocked recovery. The
targetlink exists only in the Swift build job and is removed at its end, even when the job fails.Issue being fixed or feature implemented
#4562 moved the release SDK builds to self-hosted runners and added the local composite action
.github/actions/release-cargo-target-cache. Both SDK release jobs check outrefs/tags/<tag>and then run that action. GitHub loads a./action from the workspace when the step runs, and the workspace holds the tag's tree. The action exists only from v4.2.0-beta.5 on.The fallback for tags that predate the workflows is to dispatch from the dev branch (
.claude/skills/release/SKILL.mdandpackages/kotlin-sdk/PUBLISHING.md). That checks out a tree without the action, so the fallback failed for every tag it exists to serve. Dispatching at the tag ref still worked for tags that already contain the action.Swift had a second problem. The action exports
CARGO_TARGET_DIR, butbuild_ios.shbefore v4.2.0-beta.5 hardcodesTARGET_DIR="$ROOT_DIR/target"(v4.1.2 line 23, v4.2.0-beta.4 line 24). Cargo writes the libraries and the OUT_DIR-derived headers to the release cache, and the old script then fails atMissing header: .../target/aarch64-apple-ios/release-ios/include/.... So inlining the step alone would not have fixed Swift. Kotlin'sbuild_android.shreads its output throughcargo ndk -o, which followsCARGO_TARGET_DIR, so Kotlin needs nothing more.What was done?
release-kotlin-sdk.ymlandrelease-swift-sdk.yml: replaceduses: ./.github/actions/release-cargo-target-cachewith an inlinerun:step. The script is copied verbatim. The inputs becomeCACHE_NAME,MAX_GIBandMIN_FREE_GIBenv vars with the values each workflow used before: its own cache name, 60 and 40. The shell is the action's quotedbash --noprofile --norc -e -o pipefail "{0}". Kotlin sets it on the step; the Swift job already has it as the default. A comment explains why the step is inline.release-swift-sdk.yml: two new steps.ln -sfn "$CARGO_TARGET_DIR" "$GITHUB_WORKSPACE/target". It refuses to run if a realtargetalready exists. That cannot happen after the job empties the workspace, sincetarget/is untracked in every tag. With a real directory there,lnwould put the link inside it. Newerbuild_ios.shreadsCARGO_TARGET_DIRand never touches the link.if: always()at the end of the job.swift-sdk-build.ymlandtests-rs-wallet.ymlreuse this workspace after aclean: falsecheckout and build intotarget/. They must never write into, or prune, the release cache through a leftover link..github/actions/release-cargo-target-cache/action.yaml: kept, because.github/actions/npm-release-buildstill uses it (git grep release-cargo-target-cache). A header comment points to the two inline copies and asks to keep them in sync.Other tree-dependent steps checked in both build jobs, for tags that have the SDKs:
build_android.shis byte-identical from v4.1.0 tov4.2-dev. The flags, the:sdkmodule, thejniLibsand AAR paths andndkVersion = "28.1.13356709"all match.cargo-ndk4.1.2 needs Rust 1.86, and v4.1.x pins 1.92.build_ios.shaccepts--target all --profile releasefrom v4.0.0 on, and therelease-iosCargo profile exists from v4.0.0-rc.2.Cargo.lockhashing, protoc and rustup steps do not depend on the tag.release-iosprofile, so neither can be rebuilt this way. A branch dispatch still skips the Maven deploy, and Maven for such tags still goes through the manual runbook inPUBLISHING.md.The symlink is safe for the rest of the job and the runner:
packages/swift-sdk/, nottarget/.xcodebuild -create-xcframeworkcopies the libraries into the framework.find ... -exec rm -rf {} +removes only the link, not the cache.git clean -ffdx -e target/ -e 'target/**'inswift-sdk-build.ymlremoves a leftover link without following it. Thetarget/pattern matches directories only.How Has This Been Tested?
No workflow runs were triggered.
actionlint(with shellcheck) on both workflows: clean.python3yaml.safe_loadon both workflows and the action: parses. A script compared the inline steps with the action. Therun:bodies are identical, and env keys, values and shell match the action's inputs and defaults.git diff --check: clean.Local dry run of the Swift job's cache, link, build and cleanup steps. The step scripts were extracted from the workflow YAML and run against each tag's real
build_ios.sh. Stubcargoandxcodebuildwrote the libraries and headers underCARGO_TARGET_DIRand checked that every-library/-headerspath exists:In every run the cleanup step removed the link and the cache kept its contents.
Scratch-repo checks of the symlink behaviour:
git cleanremoves the link but not its target,rm -rfon the link leaves the cache intact, andln -sfnonto a real directory nests the link inside it. The guard exists because of that last case.Breaking Changes
None.
Checklist:
structure.rs, regeneratedgrovedb-structure.json, and checked the structure viewer link posted on this pull requestFor repository code-owners and collaborators only
🤖 Generated with Claude Code
PR Hygiene ·
32b57e8/skip-botsproceeds without the ones not yet reported/self-reviewedgithub(.github/actions/release-cargo-target-cache/action.yaml,.github/workflows/release-kotlin-sdk.yml,.github/workflows/release-swift-sdk.yml) — ktechmidas or shumkovWhen every merge requirement is met, the
PR Hygienecheck passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.Summary by CodeRabbit