Skip to content

feat: enable forc-wallet migration from standalone repo to forc monorepo#204

Merged
JoshuaBatty merged 20 commits intomasterfrom
josh/forc-wallet
Nov 28, 2025
Merged

feat: enable forc-wallet migration from standalone repo to forc monorepo#204
JoshuaBatty merged 20 commits intomasterfrom
josh/forc-wallet

Conversation

@JoshuaBatty
Copy link
Copy Markdown
Member

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).

forc-wallet has migrated from FuelLabs/forc-wallet to FuelLabs/forc
monorepo starting at v0.16.0. This adds version-based repository
routing to fetch from the correct repo based on version:

- Versions < 0.16.0: legacy forc-wallet repo with v{version} tags
- Versions >= 0.16.0: forc monorepo with {name}-{version} tags

The implementation uses legacy_repo and legacy_before fields on
package definitions, making it extensible for future sway tool
migrations to the forc monorepo.
Update the milestone tool to fetch forc-wallet releases from the new
FuelLabs/forc monorepo instead of the archived FuelLabs/forc-wallet.

Key changes:
- normalize_tag() handles different tag formats between repos
- fetch_latest_release_for_component() finds component-specific
  releases in monorepos by filtering on tag prefix
- Added unit tests for tag normalization logic
forc-wallet built from the forc monorepo needs buildAndTestSubdir set
to "forc-wallet" since the crate is in a subdirectory. This patch
applies only when the source URL is the forc monorepo.
- Update forc-wallet repo link to point to forc monorepo
- Update fuel_repos example to show new structure with forc and
  forc-wallet-legacy entries
- Update update-milestones README examples with new tag format
Run cargo test for the update-milestones tool to verify tag
normalization logic works correctly for both standard repos and
the forc monorepo.
@cursor
Copy link
Copy Markdown

cursor bot commented Nov 25, 2025

You have run out of free Bugbot PR reviews for this billing cycle. This will reset on December 7.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@JoshuaBatty JoshuaBatty marked this pull request as draft November 25, 2025 02:53
@JoshuaBatty JoshuaBatty self-assigned this Nov 25, 2025
Update forc-wallet commit hash to the 0.16.1 release from the new
FuelLabs/forc monorepo (tag: forc-wallet-0.16.1).
@JoshuaBatty JoshuaBatty marked this pull request as ready for review November 25, 2025 23:01
@cursor
Copy link
Copy Markdown

cursor bot commented Nov 25, 2025

PR Summary

Route forc-wallet >=0.16.x to the forc monorepo with correct tag formats, keep legacy repo for older versions, update tooling/CI, manifests, milestones, patches, and docs accordingly.

  • forc-wallet migration:
    • Fetch >=0.16.0 from FuelLabs/forc using {component}-{version} tags; older versions from legacy FuelLabs/forc-wallet with v{version} tags.
    • Add new manifests (forc-wallet-0.16.0, 0.16.1, and recent nightlies) and update milestones.nix commit for testnet/ignition/mainnet.
    • Patch builds from monorepo with buildAndTestSubdir = "forc-wallet".
  • Scripts/Tooling:
    • script/refresh-manifests.sh: introduce legacy_repo/legacy_before, split refresh logic by repo, handle tag prefixes for published/nightly, ensure correct pname/url in manifests.
    • ci/update-milestones: switch repo to FuelLabs/forc for forc-wallet, add normalize_tag and component-specific latest-release discovery for monorepo, plus unit tests.
  • CI:
    • Add rust-tests job for milestone tool; switch some runners to warp-ubuntu-latest-x64-4x; include job in Slack failure notifications.
  • Docs:
    • Update package/repo links and examples to reflect monorepo.

Written by Cursor Bugbot for commit 9e26a5b. This will update automatically on new commits. Configure here.

The write_manifest function was ignoring its $pkg_name and $pkg_repo
parameters and instead directly referencing ${pkg[name]} and ${pkg[repo]},
which always pointed to the current (non-legacy) repo. This caused all
legacy forc-wallet manifests (< 0.16.0) to be incorrectly updated to
point to the forc monorepo instead of the forc-wallet repo.

Fix by using the function parameters that are correctly passed from
refresh_published_from_repo based on whether it's a legacy version.
@JoshuaBatty JoshuaBatty marked this pull request as draft November 25, 2025 23:20
actions-user and others added 8 commits November 25, 2025 23:34
The refresh_nightlies function was only using pkg[repo] and ignoring
legacy_repo, causing pre-migration nightlies to incorrectly point to
the new monorepo where the package doesn't exist yet.

Refactor to mirror refresh_published pattern:
- Add refresh_nightlies_from_repo helper that takes repo URL as param
- Add get_first_tag_date to find migration cutoff date
- For legacy packages, generate nightlies from legacy repo before the
  first new repo tag, and from new repo after
@JoshuaBatty JoshuaBatty marked this pull request as ready for review November 28, 2025 05:58
@JoshuaBatty JoshuaBatty merged commit 3523afb into master Nov 28, 2025
6 checks passed
@JoshuaBatty JoshuaBatty deleted the josh/forc-wallet branch November 28, 2025 07:24
JoshuaBatty added a commit that referenced this pull request Dec 8, 2025
## Summary

- forc-crypto migrated from `FuelLabs/sway` to `FuelLabs/forc` monorepo
at v0.71.0
- Add version-based repository routing using the same
`legacy_repo`/`legacy_before` pattern established for forc-wallet in
#204
- Add `buildAndTestSubdir` patch for forc-crypto when built from forc
monorepo

## Changes

**refresh-manifests.sh:**
- Versions < 0.71.0: fetch from sway repo with `v{version}` tags
- Versions >= 0.71.0: fetch from forc monorepo with
`forc-crypto-{version}` tags

**patches.nix:**
- Add patch setting `buildAndTestSubdir = "forc-crypto"` when built from
forc monorepo

**packages.md:**
- Update forc-crypto documentation to reference forc repo

## Context

- forc-crypto migration PR: FuelLabs/forc#119
- forc-crypto v0.71.0 release:
https://github.com/FuelLabs/forc/releases/tag/forc-crypto-0.71.0
- sway-nightly-binaries update:
FuelLabs/sway-nightly-binaries#79

---------

Co-authored-by: GitHub Action <action@github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants