-
Notifications
You must be signed in to change notification settings - Fork 201
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
Add test case that enables dependency verification. #375
Conversation
src/test/groovy/com/github/benmanes/gradle/versions/DifferentGradleVersionsSpec.groovy
Show resolved
Hide resolved
I noticed the test maven repo doesn't have a guice 2.0 POM file in it so thought switching to 3.0 might bring up the potentially broken behavior, but even with 3.0, which does have a POM in the repo, still seems to work ok |
What about in an actual project? Can you get anything to break with this feature? |
Works fine I think - https://github.com/anuraaga/gradle-scratch Actually, I could test out the verification itself since when I added the versions plugin, it complained about the versions plugin's checksum not being in the XML - expected behavior when checking checksums. Updated the XML and then proceeds fine.
@vlsi Does it make sense that the versions plugin works fine even with verification enabled? If so, glad we won't have any issues with 6.2 :) |
Maybe it’s because we only resolve metadata and not any artifacts, so the checksum isn’t triggered? |
@melix, can you please double-check the dependency verification case here? It looks like the verification does not stop resolution of detached configurations which seems odd to me. Just in case, I've checked with Caffeine sources as well, and |
It's hard to figure out what you mean without an example. Dependency verification should be tested with 6.2 only (not 6.1). Verification of detached configurations should always happen, unless it's disabled in the verification configuration file. |
@melix @vlsi I realized that this probably works since we resolve new versions using a dynamic version number I presume verification isn't applied to dynamic versions since it's not clear what the checksum should actually refer to. Does this sound right? And if so I guess it's why we don't have to worry about the effect of verification on this plugin? |
Verification happens once the artifact or metadata is accessed. So it works for dynamic versions too (once resolved to a version number). It doesn't, however, apply to changing versions (like snapshots) because by definition their checksum would always change. |
I see. Well, the line of code that resolves a bunch of dependencies with something like version These newer versions that get resolved to don't appear in our XML and I guess we are expecting a verification failure. That being said, we don't use the resolved artifacts at all, we only do this to get resolved version numbers from Gradle, not to actually use any dependency. So perhaps we bail out of a flow before verification triggers. I guess knowing which exact methods have a chance of producing a verification failure would help clear our confusion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anuraaga you are welcome to merge (and even release) when you're satisfied. Thank you for this!
Thanks - guess we can be confident that Gradle 6.2 will still work with versions plugin :) |
I believe I have enabled dependency verification by including the XML file and seeing a log message about it. Things still work fine. @vlsi can you check if this is the case you're concerned about?
For #366