AbstractConflictResolverTest.groovy

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Use the first found dependency artifact for override metadata

Later in the resolution, we already combine all artifacts defined

as 'dependency artifacts' on incoming edges.

If a component does not have metadata, we need at least information

about one artifact early when we look for an artifact (instead of a

metadata file).

  1. … 9 more files in changeset.
Use the first found dependency artifact for override metadata

Later in the resolution, we already combine all artifacts defined

as 'dependency artifacts' on incoming edges.

If a component does not have metadata, we need at least information

about one artifact early when we look for an artifact (instead of a

metadata file).

  1. … 9 more files in changeset.
Use the first found dependency artifact for override metadata

Later in the resolution, we already combine all artifacts defined

as 'dependency artifacts' on incoming edges.

If a component does not have metadata, we need at least information

about one artifact early when we look for an artifact (instead of a

metadata file).

  1. … 9 more files in changeset.
Use the first found dependency artifact for override metadata

Later in the resolution, we already combine all artifacts defined

as 'dependency artifacts' on incoming edges.

If a component does not have metadata, we need at least information

about one artifact early when we look for an artifact (instead of a

metadata file).

  1. … 9 more files in changeset.
Use the dependency artifacts of all selectors for override metadata

Later in the resolution, we already combine all artifacts defined

as 'dependency artifacts' on incoming edges.

If a component does not have metadata, we also need to consider all

this information early when we look for an artifact (instead of a

metadata file).

  1. … 9 more files in changeset.
Fix patch version alignement with `enforcedPlatform`

This commit reworks "floating" alignement so that it works properly

when a forced patch version is declared using `enforcedPlatform`.

    • -1
    • +10
    ./AbstractConflictResolverTest.groovy
  1. … 9 more files in changeset.
Be more consistent in names related to `ComponentSelectionDescriptor`

- Use plural for method name returning `List`

- Use 'Descriptor` instead of `Description`

  1. … 8 more files in changeset.
Moved tracking of rejected versions to `SelectorState`

  1. … 6 more files in changeset.
Track unmatched versions in SelectorState

Previously, when resolving a selector we were registering the unmatched

versions at the component level. The `ComponentState` would keep a map

of selector -> unmatched versions, which would later be reconnected to

the original selector.

With this change, the unmatched versions are kept with the `SelectorState`

until required to form a component selection reason. This simplifies the

logic and reduces the number of collection copies required.

  1. … 11 more files in changeset.
Collect unmatched dependencies too

Without this change, it is not possible to know which versions Gradle

considered for a dynamic range, unless it's rejected by a rule or by

attribute matching.

  1. … 19 more files in changeset.
Collect unmatched dependencies too

Without this change, it is not possible to know which versions Gradle

considered for a dynamic range, unless it's rejected by a rule or by

attribute matching.

  1. … 19 more files in changeset.
Collect all rejections during dependency resolution

This commit collects all rejections during dependency resolution,

so that we can properly show them in the dependency insight report.

This highlights some consistency/readability issues, like when a

rejection originates from a constraint. For this reason this commit

does **not** pass tests, and is just the first step towards better

rendering.

    • -0
    • +11
    ./AbstractConflictResolverTest.groovy
  1. … 26 more files in changeset.
Collect all rejections during dependency resolution

This commit collects all rejections during dependency resolution,

so that we can properly show them in the dependency insight report.

This highlights some consistency/readability issues, like when a

rejection originates from a constraint. For this reason this commit

does **not** pass tests, and is just the first step towards better

rendering.

    • -0
    • +11
    ./AbstractConflictResolverTest.groovy
  1. … 26 more files in changeset.
Remove unused methods

  1. … 3 more files in changeset.
Move method from `ResolvableSelectorState` to `ComponentResolutionState`

  1. … 8 more files in changeset.
Don't resolve module metadata to determine component type

We were resolving module metadata in order to determine of a `ComponentState`

represented a project component or not. This can be done simply by inspecting

the `ComponentIdentifier` for the component, and the metadata is not

required.

  1. … 3 more files in changeset.
Simplify logic for version-range merging

    • -18
    • +5
    ./AbstractConflictResolverTest.groovy
  1. … 3 more files in changeset.
Remove some usused methods

    • -21
    • +0
    ./AbstractConflictResolverTest.groovy
  1. … 3 more files in changeset.
Remove unused interface

    • -31
    • +8
    ./AbstractConflictResolverTest.groovy
  1. … 2 more files in changeset.
Construct reject failure reason when validating graph

Instead of building the failure reason during conflict resolution

when we find a rejected component, we now flag the component as rejected

but only build the message later when actually validating the graph.

This required a change to the message builder, so that it constructs

a failure message based on the edges and selectors in the graph, rather

than attempting to build this from the components provided to conflict

resolution.

  1. … 9 more files in changeset.
Check if a version is rejected post-resolve

Previously, we checked if a version was rejected as part of selecting

that version in conflict resolution. This was problematic in a couple

of ways:

- The end result was order-dependent, since a failure in an early

conflict resolution would abort resolve, preventing a later

(non-rejected) version from being selected.

- There was no mechanism to do a "best effort" resolve, so we

failed early. This prevented us from reporting all failures

where multiple versions are rejected.

We now mark a chosen component as 'rejected' during conflict

resolution, but only fail the resolve later during a post-

validation phase. We still fail on the first discovered

error, but it should now be possible to collect all failures

for reporting.

    • -0
    • +10
    ./AbstractConflictResolverTest.groovy
  1. … 11 more files in changeset.
Merge `getMetaData()` with `getMetadata()`

It's hard to believe we had both of these methods on `ComponentState`.

  1. … 7 more files in changeset.
Revert the initial implementation of capabilities

Revert "Remove the `Preference` inner class"

Revert "Add test case showing limitation of the current implementation of capabilities"

Revert "Report error whenever two modules in the graph disagree on a preference"

Revert "Support capabilities with project dependencies"

Revert "Consume capabilities from external modules"

Revert "Handle case of conflicting resolution in case multiple capabilities are found"

Revert "Make sure that conflict resolution on version still kicks in"

Revert "Wire capabilities handling into conflict resolution"

Revert "Introduce `CapabilitiesHandlerInternal`"

Revert "Validate module notations in capabilities"

Revert "Introduce the concept of "capabilities""

This reverts commit a6248b2c4e7a810051112fc2169c97d341b9f007.

This reverts commit 76e88732f403d1b295c879bdee0b0a92887e4173.

This reverts commit d9dbe0f6d909604d31857504133440f92996d3f3.

This reverts commit ac3ffa467dd73314b4526b79df3cedf6db4e6c13.

This reverts commit 97f523cd78cdca3819a8a6d65d33b72f8b972646.

This reverts commit d4c02e3f13340ce2d6114cd17f741ac51fee7796.

This reverts commit 4d4d71eb26a2828ff37fe700ae55530d9fff711d.

This reverts commit b0c962468a54affd3eaad8a5df698287d5a1ab4f.

This reverts commit 4030f642397f46330670b99cd6252e92684c53a1.

This reverts commit 80f39f5465990c870dac59b61ade4d8c68839fe2.

This reverts commit 8c0e02833303ea1a6a4e57af48278f24672c98ff.

  1. … 64 more files in changeset.
Wire capabilities handling into conflict resolution

Handling of capabilities is now delegated to the conflict handler, which allows different things:

1. if two modules provide the same capability, but no preference is set, conflict resolution fails

2. there's no need to convert the capabilities to replacement rules anymore

It's worth noting that this currently only works if a single capability is conflicting. Behavior

when there are more than one capability for conflicting modules is undefined at this point (will

be fixed later)

  1. … 18 more files in changeset.
Display custom reasons in conflict resolution error message

  1. … 2 more files in changeset.
Rework component selection reason to support composite explanations

This commit changes how `ComponentSelectionReason` works, so that we can save a list of selection

reasons, instead of a single one. This should let us give richer explananations about why a component

was selected. In particular, a component may be selected because another one was rejected, or it

can be selected by a rule **and** by conflict resolution. This last case was handled in an adhoc

manner, it's now a regular case.

Signed-off-by: Cedric Champeau <cedric@gradle.com>

  1. … 41 more files in changeset.
Minor improvement to error message for `rejectAll`

  1. … 3 more files in changeset.
Implement `rejectAll` on mutable version constraint

This commit leverages the prefer/reject infrastructure of version constraints

to implement incompatible module constraints. Internally, the rejection

constraint is implemented as:

- prefer empty version (aka, tells no preference)

- reject `+` (which is "reject any version starting with an empty string")

  1. … 8 more files in changeset.
Implement better reporting of conflicting versions constraints

This commit reworks the error message when 2 versions are in conflict. They now show the path to the

conflicting dependencies.

    • -7
    • +27
    ./AbstractConflictResolverTest.groovy
  1. … 8 more files in changeset.
Add test coverage for `LatestModuleConflictResolver`

    • -0
    • +136
    ./AbstractConflictResolverTest.groovy
  1. … 1 more file in changeset.