[SO-340] redeploy-contract: rebuild the deployment-manager when its sources change - #386
Open
ewitulsk wants to merge 1 commit into
Open
[SO-340] redeploy-contract: rebuild the deployment-manager when its sources change#386ewitulsk wants to merge 1 commit into
ewitulsk wants to merge 1 commit into
Conversation
…ources change The workflow caches the compiled binary as a release asset and downloads it unconditionally unless `rebuild_manager` is ticked. Nothing tied that asset to the code that produced it, so it went stale silently: SO-337 fixed the publish path, merged to staging, and the next redeploy still failed with the old JSON-RPC error because it ran the cached pre-SO-337 binary (run 30772017011). Hash the sources that feed the binary (Cargo.toml, Cargo.lock, crates/, tools/deployment-manager/) via `git ls-tree` on the checked-out commit, publish it beside the binary as `deploy-linux-x64.srchash`, and rebuild whenever it doesn't match. `rebuild_manager` stays as a manual override. The hash asset is uploaded after the binary, so a failed binary upload leaves no hash and the next run rebuilds rather than trusting a mismatched pair. The current release has no hash recorded, so the first run after this merges rebuilds on its own. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #383. Run 30772017011 failed with the same JSON-RPC error after SO-337 merged — because it never ran the fixed code.
What actually happened
The workflow caches the compiled deployment-manager as a release asset (
deployment-manager-bin/deploy-linux-x64) and downloads it unconditionally unlessrebuild_manageris ticked. Nothing tied that asset to the code that produced it.The run log proves it: the new workflow YAML executed (
GRPC_FROM_SECRET:andGRPC_URL:show up in the step env), but the binary loggedrpc=andbuilding Sui clientare the pre-SO-337 log strings — the migrated binary logsgrpc_host=andbuilding chain client. So: fixed workflow, stale binary.Fix
Hash the sources that feed the binary (
rust-backend/Cargo.toml,Cargo.lock,crates/,tools/deployment-manager/) withgit ls-tree -r HEAD, publish it beside the binary asdeploy-linux-x64.srchash, and rebuild whenever the recorded hash doesnt match the current one.rebuild_managerstays as a manual override.ls-treereads the checked-out commit, so it cant be fooled by index/worktree state the wayls-filescan. Verified it is stable across repeated runs and differs betweenHEADandHEAD~1.crates/, not just deployment-managers exact dependency set) only costs a rebuild. Under-invalidating is what caused this.Unblocking now
This PR makes it self-correcting, but you dont have to wait: re-run Redeploy Contract with
rebuild_manager: trueand the already-merged SO-337 fix will be compiled and used.Once this merges, the first run rebuilds on its own — the existing release asset has no
.srchash, so the mismatch branch fires — and after that the cache tracks the code.🤖 Generated with Claude Code