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

Fail fast if outgoing configurations are realized early #424

Merged
merged 2 commits into from
May 19, 2020

Conversation

dansanduleac
Copy link
Contributor

@dansanduleac dansanduleac commented Feb 14, 2020

Before this PR

Hard to debug bad interactions with other plugins.
For instance, the kotlin plugin realizes the dependencies of a bunch of java configurations early (at configuration time), and GCV doesn't allow that (see #423 (comment)).

However, by the time GCV fails, it will fail like so, and the stack trace won't point to who "included this configuration in dependency resolution" in the first place.

org.gradle.api.InvalidUserDataException: Cannot change dependencies of dependency configuration ':<redacted>:apiElements' after it has been included in dependency resolution.

After this PR

==COMMIT_MSG==
Immediately throw an error capturing the stacktrace when other plugins / gradle code are attempting to realize configuration dependencies/constraints early (at configuration-time) and throw an error.
==COMMIT_MSG==

Possible downsides?

@stale
Copy link

stale bot commented Mar 5, 2020

This PR has been automatically marked as stale because it has not been touched in the last 14 days. If you'd like to keep it open, please leave a comment or add the 'long-lived' label, otherwise it'll be closed in 7 days.

@stale stale bot added the stale label Mar 5, 2020
@stale stale bot closed this Mar 12, 2020
@dansanduleac dansanduleac reopened this May 19, 2020
@stale stale bot removed the stale label May 19, 2020
@dansanduleac dansanduleac marked this pull request as ready for review May 19, 2020 10:50
@policy-bot policy-bot bot requested a review from fawind May 19, 2020 10:50
+ "This is not allowed when using GCV.",
configuration.get()));
}
return ImmutableList.of();
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to return this so the resolution constraint gets triggered in addAllLater?

Copy link
Contributor Author

@dansanduleac dansanduleac May 19, 2020

Choose a reason for hiding this comment

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

yep, I didn't know how else to add this as a "lazy effect" essentially

@bulldozer-bot bulldozer-bot bot merged commit 8e5ae28 into develop May 19, 2020
@bulldozer-bot bulldozer-bot bot deleted the ds/showcase-kotlin branch May 19, 2020 13:38
@svc-autorelease
Copy link
Collaborator

Released 1.18.0

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