Skip to content

fix: stop scoping LATEST dependency resolution to --branch flag @W-21617695@ - #898

Merged
soridalac merged 1 commit into
mainfrom
wr/fixLatestDependencyBranchScoping
Jul 28, 2026
Merged

fix: stop scoping LATEST dependency resolution to --branch flag @W-21617695@#898
soridalac merged 1 commit into
mainfrom
wr/fixLatestDependencyBranchScoping

Conversation

@WillieRuemmele

@WillieRuemmele WillieRuemmele commented Jul 20, 2026

Copy link
Copy Markdown
Member

Summary

  • When --branch is passed to sf package version create, LATEST dependency resolution now falls back to the null branch (main/released versions) if the dependency has no versions on the specified branch
  • Previously, this would fail with NoReleaseVersionFoundForBranchError — now it gracefully resolves from the unscoped branch
  • Dependencies that DO have versions on the branch still resolve from that branch (existing behavior preserved)
  • Dependencies with an explicit branch in their config still use that branch (existing behavior preserved)

Fixes forcedotcom/cli#3517

Work Item

@W-21617695@: LATEST dependency resolution incorrectly scoped to --branch for all packages

Proof of Work

  • Tests: 275 passing, 0 failing
  • Lint: clean (0 errors)
  • Type check: clean

Test plan

  • Run sf package version create --branch <branch> with dependencies using LATEST that don't have versions on the specified branch — should now succeed by falling back to null branch resolution
  • Run sf package version create --branch <branch> with dependencies that DO have versions on the branch — should resolve LATEST from that branch (existing behavior)
  • Run sf package version create --branch <branch> with dependencies that have an explicit branch in their config — should still resolve against that explicit branch
  • Run sf package version create (no --branch flag) with LATEST dependencies — behavior unchanged (resolves against null branch)
  • Run with dependency.branch set to empty string '' — should resolve against null branch (existing behavior preserved)

@WillieRuemmele
WillieRuemmele force-pushed the wr/fixLatestDependencyBranchScoping branch from 58d14bc to b7d2016 Compare July 20, 2026 21:06
@WillieRuemmele
WillieRuemmele force-pushed the wr/fixLatestDependencyBranchScoping branch from b7d2016 to 081e13f Compare July 20, 2026 21:19
@soridalac

Copy link
Copy Markdown
Contributor

QA notes:
✅ LATEST dep with --branch flag (no versions on branch) — falls back to null branch, succeeds
✅ No --branch flag — resolves from null branch as before
✅ Explicit branch in dependency config — fails with NoReleaseVersionFoundForBranchError (no fallback, correct)
✅ RELEASED token + --branch — fails with NoReleaseVersionFoundError (branch ignored, correct)

@soridalac
soridalac merged commit 5bc0fec into main Jul 28, 2026
14 checks passed
@soridalac
soridalac deleted the wr/fixLatestDependencyBranchScoping branch July 28, 2026 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LATEST dependency resolution incorrectly scoped to --branch for all packages

2 participants