Repository navigation
fix(generate): don't fall back to stale OZ examples when GitHub API fails - #649
Merged
Merged
Conversation
…ails `generate contract --from oz/...` asked the GitHub releases API for the pinned OZ tag before downloading. When that call failed (e.g. a 403 from the unauthenticated rate limit), it fell back to the newest *cached* release, which after upgrading the CLI is the old v0.6.0, so the generated contract again didn't compile against the 0.8.0 deps. - Drop the releases API call: the tag is pinned, so use it directly and skip the network entirely once it's cached - Remove the fallback to other cached versions; fail with the download error instead - Extract downloads to a temporary dir and rename on success, so an interrupted download can't leave a cache entry that looks complete - Replace the outdated environments.toml hint with how to add the contract to scaffold.yml Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jca3yR4pe5iqLYCw8bXqes
chadoh
approved these changes
Oct 25, 2026
pselle
pushed a commit
that referenced
this pull request
Oct 25, 2026
## 🤖 New release * `stellar-scaffold-cli`: 0.0.33 -> 0.0.34 (✓ API compatible changes) <details><summary><i><b>Changelog</b></i></summary><p> <blockquote> ## [0.0.34](stellar-scaffold-cli-v0.0.33...stellar-scaffold-cli-v0.0.34) - 2026-10-25 ### Fixed - *(generate)* don't fall back to stale OZ examples when GitHub API fails ([#649](#649)) ### Other - Fix --ls listing incorrect commands at the end ([#648](#648)) </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/). Co-authored-by: aha-release-plz[bot] <211513279+aha-release-plz[bot]@users.noreply.github.com>
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.
What
Follow-up to #647. In v0.0.33,
stellar scaffold generate contract --from oz/nft-royaltiescould still produce a contract that doesn't compile:Before downloading, the CLI called the GitHub releases API to look up the tag it had already pinned. When that call failed (403 is GitHub's response to the unauthenticated rate limit), it fell back to the newest release in the local cache. After an upgrade, that is the v0.6.0 cached by older CLI versions, so the 0.6.0 sources were copied into a 0.8.0 project.
Changes
github.com/.../archive/<tag>.tar.gz, which isn't subject to the REST API rate limit.v0.10vsv0.9and the soroban-examples commit hash). If the pinned examples can't be downloaded, the command fails with the download error.scaffold.yml(type: workspace,source: <package name>, constructorargs), matching the CLI docs. The--from-wizardinstructions get the same update.The
--lsusage lines (contract generate→generate contract) are left for a separate PR.Testing
nft-royaltiescompiles in the UI template workspace.cargo test -p stellar-scaffold-cli --lib(241 passed), clippy and fmt clean.