Binary license management system#7998
Conversation
|
Heh, travis rat check failing for |
clintropolis
left a comment
There was a problem hiding this comment.
very nice.
For additional future improvement stuff, I think we should also probably add something to contributing guide docs and to the PR template about maintaining license.yaml, mentioning that if you add a new dependency or change a version of a dependency to update it accordingly. There is probably room for automating this part as well to some extent.
| from html.parser import HTMLParser | ||
|
|
||
|
|
||
| apache_license_v2 = "\n\ |
There was a problem hiding this comment.
This is a pretty big string, should we just keep this in an external file somewhere (or do we already have it somewhere maybe) and consider just loading it from that?
There was a problem hiding this comment.
Extracted as licenses/APACHE2.
|
|
||
|
|
||
| class DependencyReportParser(HTMLParser): | ||
| # TODO: Change to comments |
There was a problem hiding this comment.
Ah this was resolved. Removed now.
| print(" * {}:{}".format(group_id, artifact_id)) | ||
|
|
||
|
|
||
| def check_licenses(license_yaml, dependencie_reports_root): |
There was a problem hiding this comment.
dependencie_reports_root -> dependencies_reports_root
|
|
||
| print_error("Found {} reported licenses".format(len(reported_dep_to_licenses))) | ||
|
|
||
| # Compare licenses in registry and those in dependency reports |
There was a problem hiding this comment.
could you add a few additional comments about what is going on here to break up all these loops? makes it kind of rough to follow along with what is going on here
There was a problem hiding this comment.
Added more comments here and other places. Please let me know if it's still unclear.
To clarify, are the contents of the generated |
Yes, the contents should be same. Only the format is slightly different. |
|
Great work @jihoonson. Thanks for picking this up. I fully agree with you; if it isn't checked by the CI, then it is hard to maintain. Maybe it is a good idea to add the lines on how to run the checker to the One final note on the |
clintropolis
left a comment
There was a problem hiding this comment.
👍 from me after you get CI fixed
|
@Fokko thanks for taking a look!
It sounds good. I think it would be nicer if we add that to our PullRequest template as well.
What do you mean by "wrong license"? Spotbugs is also licensed under LGPL, so we shouldn't include it in our binary distribution unless the part you want to use it is particularly licensed under a compatible license. |
|
Ok, now Travis looks stable. |
|
Hmm, looks like Travis is currently getting stuck at |
Motivation
We are currently maintaining LICENSE.BINARY file manually. The way we do now is
This is a huge burden for the release manager since we have tons of binary dependency. We should automate this check.
Description
This PR adds a binary license management system. All binary licenses are maintained in
license.yamlfile. Here is a snippet of the file.Note that
skip_dependency_report_checkis set to true for some licenses. ForFindBugs JSR305, it's set to true since maven dependency plugin reports a wrong license (LGPL). Note thatFindBugsis licensed under LGPL butJSR305is licensed under BSD-3 license. This script also skips dependency report check for"Java Concurrency In Practice" Book Annotationssince it points to a book and doesn't have a valid library version.docs/_bin/generate-license.pyreads this file, checks the registered licenses with maven dependency report, and generates the contents ofLICENSE.BINARYfile. You can run this program as below:The generated
LICENSE.BINARYfile is a little bit different from the current one, mostly because of the difficulty of auto generation.I will adjustdistribution/pom.xmlto generate LICENSE.BINARY when building binary distribution in a follow-up PR. I will also set up Travis to run license check automatically.I have adjusted
distribution/pom.xmlto generate LICENSE.BINARY when building binary distribution. This is currently being checked automatically in Travis.