-
Notifications
You must be signed in to change notification settings - Fork 304
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
json-report: one file per dependency instead of multiple; use m2 coords #782
json-report: one file per dependency instead of multiple; use m2 coords #782
Conversation
…dinates When classifiers are used as part of dependency specifications, it's important to be able to select just the classified artifact. Unfortunately, in the current json, dependencies don't specify classifiers, so it isn't possible to just get one of the artifacts for a dependency when a classifier is required. This patch introduces maven style artifact prefixes in order to include classifier and packaging information in the coordinates. By doing that, we can use them as keys in dependency lists more easily and it allows consumers of the json to treat those dependency keys as mostly opaque ids rather than having to parse them.
This is a multi-tool change. The coursier side is here: coursier/coursier#782 This fixes the issue with coursier resolution where transitive dependencies that have classifiers can't be differentiated. Ie, if you have a classifier on a dependency, you get all the jars even if they have a different classifier. Additionally this updates the m2 coordinate string representation to bring it inline with maven's coordinate language. This is because I've chosen that language to use in the coursier change as well
@baroquebobcat The CI error seems legit… |
Yeah. Thanks for looking at it. |
@baroquebobcat New CI failure seems legit too. |
Turns out I left something when splitting the tests #788, so CI should pass after that. |
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.
Thanks! Looks good overall.
) | ||
|
||
assert( | ||
report == "{\"conflict_resolution\":{},\"dependencies\":[],\"version\":\"0.1.0\"}") |
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.
Any particular reason string based assertion is used rather than parsing the json report then assert on structured data? https://github.com/coursier/coursier/blob/master/cli/src/test/scala-2.12/coursier/cli/CliFetchIntegrationTest.scala#L18
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.
I think the assertion failure message is a bit clearer with the string, and the string is the actual output, so it feels like the right thing to test against. That said, it could be a bit too fragile.
…so that the dependency listings can be corrected
This error consistently in windows CI with this change:
I also verified it by singling it out at #750 The test should be covered in travis as well, do you have any clue why this would be case, @alexarchambault? |
It's possibly https://github.com/coursier/coursier/pull/782/commits/afe30721a00cc9790edc1289d58240d8eade6704… From what I remember, the scripted test that fails corresponds to things that are a bit hackish (but with non reg tests). I'll have a look at it. |
@alexarchambault the link is invalid btw |
It looks like I've got the CI issue resolved. It seems that the change I made to Resolution broke some assumptions. I've reverted that and instead do the dep flattening in Helper. |
Thanks. We are still vetting this change against our internal repo. will merge if all checks out |
…#5475) This is a multi-tool change. The coursier side is here: coursier/coursier#782 This fixes the issue with coursier resolution where transitive dependencies that have classifiers can't be differentiated. Ie, if you have a classifier on a dependency, you get all the jars even if they have a different classifier. Additionally this updates the m2 coordinate string representation to bring it inline with maven's coordinate language. This is because I've chosen that language to use in the coursier change as well. I've bumped ivy and coursier's implementation version to invalidate cached artifacts that used the old format.
…#5475) This is a multi-tool change. The coursier side is here: coursier/coursier#782 This fixes the issue with coursier resolution where transitive dependencies that have classifiers can't be differentiated. Ie, if you have a classifier on a dependency, you get all the jars even if they have a different classifier. Additionally this updates the m2 coordinate string representation to bring it inline with maven's coordinate language. This is because I've chosen that language to use in the coursier change as well. I've bumped ivy and coursier's implementation version to invalidate cached artifacts that used the old format.
…#5475) This is a multi-tool change. The coursier side is here: coursier/coursier#782 This fixes the issue with coursier resolution where transitive dependencies that have classifiers can't be differentiated. Ie, if you have a classifier on a dependency, you get all the jars even if they have a different classifier. Additionally this updates the m2 coordinate string representation to bring it inline with maven's coordinate language. This is because I've chosen that language to use in the coursier change as well. I've bumped ivy and coursier's implementation version to invalidate cached artifacts that used the old format.
…#5475) This is a multi-tool change. The coursier side is here: coursier/coursier#782 This fixes the issue with coursier resolution where transitive dependencies that have classifiers can't be differentiated. Ie, if you have a classifier on a dependency, you get all the jars even if they have a different classifier. Additionally this updates the m2 coordinate string representation to bring it inline with maven's coordinate language. This is because I've chosen that language to use in the coursier change as well. I've bumped ivy and coursier's implementation version to invalidate cached artifacts that used the old format.
When classifiers are used as part of dependency specifications, it's important to be able to select just the classified artifact. Unfortunately, in the current json, dependencies don't specify classifiers, so it isn't possible to just get one of the artifacts for a dependency when a classifier is required.
This patch introduces maven style artifact prefixes in order to include classifier and packaging information in the coordinates. By doing that, we can use them as keys in dependency lists more easily and it allows consumers of the json to treat those dependency keys as mostly opaque ids rather than having to parse them.
Addresses #743