Skip to content

Fix resolver BOM force versions#1571

Draft
shs96c wants to merge 1 commit into
bazel-contrib:masterfrom
shs96c:shs/bom-force-version
Draft

Fix resolver BOM force versions#1571
shs96c wants to merge 1 commit into
bazel-contrib:masterfrom
shs96c:shs/bom-force-version

Conversation

@shs96c

@shs96c shs96c commented May 13, 2026

Copy link
Copy Markdown
Collaborator

The resolvers accept BOMs from MODULE.bazel and version catalogs, but amend_artifact(force_version = ...) and version_conflict_policy = "pinned" did not consistently preserve forced BOM versions through resolution. This allowed higher transitive BOM versions, or an earlier duplicate requested BOM, to win silently.

What

  • Let amend_artifact match BOM declarations as well as artifact declarations
  • Normalize pinned version-conflict policy into force_version metadata before repo merging
  • Preserve BOM force_version through ResolverConfig
  • Render forced Gradle BOMs with strictly plus resolutionStrategy.force
  • Make forced duplicate requested BOMs win in the shared resolver contract, including MavenResolver
  • Add tests for BOM force-version plumbing, duplicate forced BOM resolution, and Gradle build script rendering

Generated with Codex

@shs96c
shs96c force-pushed the shs/bom-force-version branch 3 times, most recently from 13299bd to a768256 Compare May 13, 2026 10:21
@shs96c shs96c changed the title Fix Gradle resolver BOM force versions Fix resolver BOM force versions May 13, 2026
@shs96c
shs96c force-pushed the shs/bom-force-version branch from a768256 to a1b1cef Compare May 13, 2026 11:52
@shs96c
shs96c force-pushed the shs/bom-force-version branch 4 times, most recently from 99ccdc5 to 79221bf Compare June 9, 2026 14:39
Preserve force_version metadata for BOMs through Bzlmod extension processing, resolver config parsing, and duplicate BOM resolution.

Share artifact/BOM merge helpers while keeping their resolver inputs separate, and add regression coverage for request metadata, Gradle script rendering, and Maven/Gradle resolver behavior.
@shs96c
shs96c force-pushed the shs/bom-force-version branch from 79221bf to aa533b8 Compare June 11, 2026 11:37
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.

1 participant