Skip to content
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

Fix baseline-exact-dependencies with new GCV #1487

Merged
merged 3 commits into from
Sep 2, 2020

Conversation

dansanduleac
Copy link
Contributor

Before this PR

com.palantir.baseline-exact-dependencies tries to copy over constraints from <source-set>CompileClasspath, in order to pick up versions.lock constraints generated by GCV.

However, after palantir/gradle-consistent-versions#557, these are no longer implemented as explicit constraints inherited by that configuration (which would have shown up in compileClasspath.getAllDependencyConstraints()), but instead GCV uses a dependency to a configuration on the root project, which itself holds these constraints in a single centralized place.

This means that the configuration resolved by tasks like checkUnusedDependenciesMain etc now lacks versions.lock constraints, leading to weird outcomes including flakes.

After this PR

==COMMIT_MSG==
Fix com.palantir.baseline-exact-dependencies to work with GCV 1.26.0+.
==COMMIT_MSG==

Possible downsides?

@changelog-app
Copy link

changelog-app bot commented Sep 2, 2020

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

Fix com.palantir.baseline-exact-dependencies to work with GCV 1.26.0+.

Check the box to generate changelog(s)

  • Generate changelog entry

@dansanduleac dansanduleac marked this pull request as ready for review September 2, 2020 14:05
@policy-bot policy-bot bot requested a review from CRogers September 2, 2020 14:05
@CRogers
Copy link
Contributor

CRogers commented Sep 2, 2020

Is it possible to write a test for this? Does it work with GCV <1.26.0 too?

@dansanduleac
Copy link
Contributor Author

We're currently testing it with old GCV - I suppose I could add a test for new GCV but the problem is the issue we've seen is a heisenbug... I couldn't reproduce it locally, for instance.

// Alternatively, we could tell GCV to lock this configuration, at the cost of a slightly more
// expensive 'unifiedClasspath' resolution during lock computation.
if (project.getRootProject().getPluginManager().hasPlugin("com.palantir.versions-lock")) {
explicitCompile.extendsFrom(project.getConfigurations().getByName("lockConstraints"));
Copy link
Contributor

Choose a reason for hiding this comment

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

Feels quite weird to have this direct knowledge of GCV here? Will this still work with old GCV?

@CRogers
Copy link
Contributor

CRogers commented Sep 2, 2020

I am also struggling to reproduce this bug locally anywhere :(

@CRogers
Copy link
Contributor

CRogers commented Sep 2, 2020

👍 Let's see if this fixes people's problems

@bulldozer-bot bulldozer-bot bot merged commit cc5217a into develop Sep 2, 2020
@bulldozer-bot bulldozer-bot bot deleted the ds/fix-with-new-gcv branch September 2, 2020 17:02
@svc-autorelease
Copy link
Collaborator

Released 3.37.1

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