-
Notifications
You must be signed in to change notification settings - Fork 365
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
Validate dependencies licenses #836
Validate dependencies licenses #836
Conversation
a222016
to
de80b2a
Compare
Codecov Report
@@ Coverage Diff @@
## master #836 +/- ##
==========================================
- Coverage 42.89% 42.84% -0.06%
==========================================
Files 135 135
Lines 10574 10574
==========================================
- Hits 4536 4530 -6
- Misses 5448 5451 +3
- Partials 590 593 +3
Continue to review full report at Codecov.
|
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, @daniel-shuy ! This would be a nice safety net for us.
I'll ask @ozkatz to have a look at it, it does make sense but we need to know we're checking for the right things.
check-licenses-npm: | ||
go get github.com/senseyeio/diligent/cmd/diligent | ||
# The -i arg is a workaround to ignore NPM scoped packages until https://github.com/senseyeio/diligent/issues/77 is fixed | ||
$(GOBINPATH)/diligent check -w permissive -i ^@[^/]+?/[^/]+ $(UI_DIR) |
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.
|
||
check-licenses-go-mod: | ||
go get github.com/google/go-licenses | ||
$(GOBINPATH)/go-licenses check ./cmd/$(LAKEFS_BINARY_NAME) |
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.
@ozkatz here we could also add a check category, I guess.
Thanks! |
Closes #449
This PR adds
Makefile
tasks to validatego-mod
andnpm
dependency licenses to ensure they are compatible with the project's license (Apache-2.0
).I used go-licenses for validating
go-mod
dependencies, and diligent for validatingnpm
dependencies.Currently, I have only added the tasks to the
Makefile
, but I haven't added them to the GitHub Actions workflow file(s). Which workflow should I bind it to?Ideally I would've liked to use diligent for both
go-mod
andnpm
dependencies, as it claims to be able to do so, but unfortunately I couldn't get it to work withgo-mod
.Since I couldn't use a single tool for both
go-mod
andnpm
, I could've used a different tool for validatingnpm
dependencies, however I couldn't find another one than diligent that allowed specifying the license type (eg.permissive
). diligent also has the advantage of being a Go module.Also, I had to update
base-64
to1.0.0
because it had the license information in the wrong place, which was causing diligent to detect it aslicense: none
(see mathiasbynens/base64#24).Also, note that there is an issue with diligent that prevents it from working with NPM scoped packages (eg.
@primer/octicons-react
). I have created an issue for this (senseyeio/diligent/issues/77). As a workaround, I have configured diligent to ignore scoped packages.Note that go-licenses ignores Go modules without any license (or modules that it fails to detect a license for), whereas diligent will fail validation if it cannot find an NPM package or a license for an NPM package (which is why the workaround above to ignore scoped packages is required).
Example
make check-licenses-go-mod
output (this is considered passing despite all the warnings):Example
check-licenses-npm
output: