Skip to content

Issue #175 Improves variant and artifacts selection #194

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

Merged
merged 2 commits into from
May 9, 2025

Conversation

guillermo-varela
Copy link
Contributor

Uses Disambiguation rules in a better way to resolve the multiple variants selection problem and make it compatible with Gradle >= 8.11

It relates to the following issue #s:

cc @bhamail / @DarthHater / @shaikhu

@paul-botsco-2-0 paul-botsco-2-0 bot added the 😍 cla signed The CLA is signed label May 9, 2025
@guillermo-varela guillermo-varela requested a review from Copilot May 9, 2025 01:45
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves the variant and artifacts selection mechanism by refactoring how dependencies and disambiguation rules are applied, and ensures compatibility with Gradle versions ≥ 8.11. Key changes include:

  • Replacing direct instantiation of dependency objects with mock objects in tests.
  • Refactoring the DependenciesFinder to remove legacy methods and add disambiguation rules via a new helper.
  • Updating plugin version references and integration tests to align with the new Gradle versions.

Reviewed Changes

Copilot reviewed 9 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/test/java/org/sonatype/gradle/plugins/scan/ossindex/OssIndexAuditTaskTest.java Updated test dependency setup using mocks and task registration changes.
src/test/java/org/sonatype/gradle/plugins/scan/common/DependenciesFinderTest.java Modified tests to match the updated signature of findResolvedArtifacts and dependency processing.
src/main/java/org/sonatype/gradle/plugins/scan/common/VariantAttributeDisambiguationRule.java New disambiguation rule class implemented to support variant selection.
src/main/java/org/sonatype/gradle/plugins/scan/common/DependenciesFinder.java Refactored dependency resolution and rule addition; legacy methods removed.
src/main/java/org/sonatype/gradle/plugins/scan/ScanPlugin.java Adjusted task creation logic to use unified registration style.
src/integTest/java/org/sonatype/gradle/plugins/scan/ScanIT_Gradle_Versions_8_11_to_8_14.java Updated integration test class name and version support to include Gradle 8.14.
README.md Updated plugin version references to reflect the new release.
Files not reviewed (4)
  • gradle.properties: Language not supported
  • gradle/wrapper/gradle-wrapper.properties: Language not supported
  • gradlew: Language not supported
  • gradlew.bat: Language not supported

@guillermo-varela guillermo-varela merged commit 62420c6 into main May 9, 2025
13 of 18 checks passed
@guillermo-varela guillermo-varela deleted the 75_improve_variant_binaries_selection branch May 9, 2025 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
😍 cla signed The CLA is signed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Gradle 8.11 ambiguity
1 participant