-
Notifications
You must be signed in to change notification settings - Fork 150
feat: enable forc-wallet migration from standalone repo to forc monorepo
#807
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add support for components to migrate between repositories while maintaining backward compatibility for older versions. This enables components like forc-wallet to move from standalone repos to monorepos. - Add legacy_repository_name and legacy_before fields to Component struct - Implement repository_for_version() method with semver-based selection - Configure forc-wallet migration from forc-wallet repo to forc monorepo - Add comprehensive tests for migration logic - Add semver dependency for version handling The version boundary is set at 0.16.0: versions < 0.16.0 use the legacy forc-wallet repository, while versions >= 0.16.0 use the forc monorepo.
Update download and channel building logic to use the new repository migration
and tag formatting functionality. This completes the forc-wallet transition
to the forc monorepo.
- Update build-channel to use repository_for_version() and tag_for_version()
- Update download logic to use new URL generation methods
- Add github_releases_download_url_with_tag() helper function
- Update documentation with comprehensive field descriptions
- Add forc-wallet migration examples to developer guide
Channel files and downloads now correctly route forc-wallet requests:
- Versions < 0.16.0: FuelLabs/forc-wallet with v{version} tags
- Versions >= 0.16.0: FuelLabs/forc with forc-wallet-{version} tags
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the final PR Bugbot will review for you during this billing cycle
Your free Bugbot reviews will reset on December 7
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
Bug: forc-wallet migration not handled in fetch_fuels_version
The fetch_fuels_version function hardcodes the repository as forc-wallet and tag format as v{version} for all forc-wallet versions. This breaks for versions >= 0.16.0, which are released from the forc monorepo with forc-wallet-{version} tags. The function needs to use Component::repository_for_version and Component::tag_for_version methods to correctly handle the repository migration, similar to how DownloadCfg::new was updated.
src/download.rs#L406-L411
Lines 406 to 411 in adf54aa
| ), | |
| "forc-wallet" => { | |
| format!( | |
| "https://raw.githubusercontent.com/FuelLabs/forc-wallet/v{}/Cargo.toml", | |
| cfg.version | |
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the final PR Bugbot will review for you during this billing cycle
Your free Bugbot reviews will reset on December 7
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
Bug: forc-wallet fuels version fetch uses wrong repository
The fetch_fuels_version function hardcodes the repository to FuelLabs/forc-wallet with a v{version} tag format for all forc-wallet versions. This breaks for versions >= 0.16.0, which are released from the forc monorepo with forc-wallet-{version} tags. The function needs to use Component::repository_for_version() and Component::tag_for_version() to determine the correct repository and tag format based on the version, similar to how DownloadCfg::new() handles this migration.
src/download.rs#L406-L411
Lines 406 to 411 in 038199a
| ), | |
| "forc-wallet" => { | |
| format!( | |
| "https://raw.githubusercontent.com/FuelLabs/forc-wallet/v{}/Cargo.toml", | |
| cfg.version | |
| ) |
Updates fetch_fuels_version to use Component::repository_for_version and Component::tag_for_version methods for proper handling of forc-wallet's migration from forc-wallet repo to forc monorepo at version 0.16.0. Also enhances fuels_version_from_toml to support workspace.dependencies in addition to regular dependencies tables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the final PR Bugbot will review for you during this billing cycle
Your free Bugbot reviews will reset on December 7
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
Bug: Incorrect version fetching for monorepo components
The get_version function fetches the latest release from component.repository_name without filtering by component-specific tags. For forc-wallet in the forc monorepo, this returns whichever component was released most recently (could be forc, forc-wallet, or others), not necessarily forc-wallet's version. Additionally, the function unconditionally strips the first character assuming a "v" prefix, which breaks for forc-wallet's forc-wallet-X.Y.Z tag format, producing invalid semver strings like orc-wallet-0.16.0.
ci/build-channel/src/main.rs#L119-L137
fuelup/ci/build-channel/src/main.rs
Lines 119 to 137 in 7a55699
| fn get_version(component: &Component) -> Result<Version> { | |
| let handle = ureq::builder().user_agent("fuelup").build(); | |
| let mut data = Vec::new(); | |
| let url = format!( | |
| "https://api.github.com/repos/FuelLabs/{}/releases/latest", | |
| component.repository_name | |
| ); | |
| let resp = handle.get(&url).call()?; | |
| resp.into_reader().read_to_end(&mut data)?; | |
| let response: LatestReleaseApiResponse = serde_json::from_str(&String::from_utf8_lossy(&data))?; | |
| let version_str = response.tag_name["v".len()..].to_string(); | |
| let version = Version::parse(&version_str)?; | |
Updates get_version function to properly handle component-specific tag filtering
for monorepo components. Fixes incorrect behavior where the latest release from
any component in the repository was returned instead of the specific component.
Also fixes tag prefix handling to support both legacy v-prefixed tags and
the new {component-name}-{version} format without breaking version parsing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the final PR Bugbot will review for you during this billing cycle
Your free Bugbot reviews will reset on December 7
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
2c5a5a8
PR SummaryAdds version-aware repository/tag resolution (with semver) to support forc-wallet’s move to the forc monorepo while preserving downloads for older versions.
Written by Cursor Bugbot for commit 2c5a5a8. This will update automatically on new commits. Configure here. |
…epo (#204) ## Summary Enable `forc-wallet` to be fetched from the new `FuelLabs/forc` monorepo for versions >= 0.16.0, while maintaining backward compatibility with the legacy `FuelLabs/forc-wallet` repository for older versions. ## Background `forc-wallet` has been migrated to the `forc` monorepo starting at v0.16.0. The legacy `FuelLabs/forc-wallet` repository is now archived. This PR updates `fuel.nix` to: - Fetch `forc-wallet` >= 0.16.0 from `FuelLabs/forc` with `forc-wallet-{version}` tags - Fetch `forc-wallet` < 0.16.0 from the legacy `FuelLabs/forc-wallet` with `v{version}` tags This mirrors the approach taken in fuelup: FuelLabs/fuelup#807 ## Changes ### Core Infrastructure (`script/refresh-manifests.sh`) - Added `forc` repo and renamed legacy to `forc-wallet-legacy` - Added `legacy_repo` and `legacy_before` fields to package definitions - New `refresh_published_from_repo` function handles version-based routing and different tag formats - Updated nightlies to use correct tag patterns for monorepo ### Milestone Tool (`ci/update-milestones/src/main.rs`) - Changed forc-wallet source from `FuelLabs/forc-wallet` to `FuelLabs/forc` - Added `normalize_tag()` for tag format conversion between repos - New `fetch_latest_release_for_component()` finds component-specific releases in monorepos - Added unit tests for tag normalization logic ### Nix Patches (`patches.nix`) - Added patch to set `buildAndTestSubdir = "forc-wallet"` for builds from forc monorepo ### CI (`.github/workflows/ci.yml`) - Added `rust-tests` job to run update-milestones unit tests ### Documentation - Updated repo links in `packages.md` and `adding-packages.md` - Updated examples in `ci/update-milestones/README.md` ### Milestones (`milestones.nix`) - Updated forc-wallet to 0.16.1 from the forc monorepo for testnet, ignition, and mainnet ## Testing - ✅ `nix-instantiate --parse patches.nix` - Nix syntax valid - ✅ `nix-instantiate --parse milestones.nix` - Nix syntax valid - ✅ `nix build .#fuel-testnet` - New 0.16.x forc-wallet from forc monorepo works - ✅ `nix build .#fuel-mainnet` - Mainnet builds successfully - ✅ `nix build .#forc-wallet-0-15-2` - Old version from legacy repo still works - ✅ `cargo test` - Rust unit tests pass ## Note This implementation uses `legacy_repo` and `legacy_before` fields on package definitions, making it extensible for future sway tool migrations to the forc monorepo (as outlined in the [tooling monorepo RFC](https://github.com/FuelLabs/sway-rfcs/blob/73511cfa579d787927289145a58224b92500374d/rfcs/0017-tooling-monorepo.md)). --------- Co-authored-by: GitHub Action <action@github.com>
Summary
This PR implements support for component repository migrations, specifically enabling forc-wallet to transition from its standalone repository (
FuelLabs/forc-wallet) to the forc monorepo (FuelLabs/forc) while maintaining backward compatibility for all existing versions.Background
As of forc-wallet v0.16.0, the component has been migrated from its standalone repository to the forc monorepo as an independent workspace member with its own release cycle. However, fuelup needs to continue supporting downloads of older versions from the original repository while correctly routing new versions to the monorepo.
Changes
Core Infrastructure
legacy_repository_nameandlegacy_beforefields to theComponentstruct to support version-based repository routingtag_for_version()method to handle different git tag conventions between repositoriesComponent Configuration
repository_name = "forc"(new default for v0.16.0+)legacy_repository_name = "forc-wallet"(for versions < v0.16.0)legacy_before = "0.16.0"(migration cutoff point)related to FuelLabs/sway-rfcs#49
Note
Add version-based repo/tag routing to handle forc-wallet moving from
forc-walletrepo toforc, while preserving older releases.semverand extendComponentwithlegacy_repository_nameandlegacy_before.repository_for_version()andtag_for_version()to select repo and tag format per version.ci/build-channel)Componentrepo/tag helpers when generating download URLs; minor refactor using.get(); add tests.src/download.rs)github_releases_download_url_with_tag().fetch_fuels_version()usesComponentrepo/tag helpers forforc-wallet; improve TOML fuels version lookup to includeworkspace.dependencies.components.tomlforforc-wallet:repository_name = "forc", pluslegacy_repository_name = "forc-wallet",legacy_before = "0.16.0".forc-walletand migration fields; spellcheck list updated.Written by Cursor Bugbot for commit c9accce. This will update automatically on new commits. Configure here.