Skip to content
This repository has been archived by the owner on May 30, 2022. It is now read-only.

CI: add job for checking licenses from dependencies #741

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

flaviodsr
Copy link
Contributor

The check is implemented using wwhrd [1] and the allowed
licenses are listed on the .wwhrd.yml file.

  1. https://github.com/frapposelli/wwhrd

Fix: #349

Copy link
Contributor

@dottorblaster dottorblaster left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@arbulu89 arbulu89 left a comment

Choose a reason for hiding this comment

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

Hey @flaviodsr ,
So comments worth checking.
As a side note, if you don't have your golang bin directory in your path the wwhrd execution fails

.wwhrd.yml Outdated
@@ -0,0 +1,7 @@
allowlist:
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we rename the file to have yaml extension rather than yml, as we already have files with the 2nd extesion

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

- uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Install WWHRD
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't really need to run this in 2 steps, right?
check-licenses already depend on install-wwhrd, so calling the 2nd would call the 1st by default

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you are right, I just thought that in case of failure of the install it would be more clear having a step specifically doing that.

Anyways, I have removed the step.


.PHONY: install-wwhrd
install-wwhrd:
which wwhrd || go install github.com/frapposelli/wwhrd@latest
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know that much about golang dependencies, but I wonder if there is some option to define this dependency as a development dependency

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not aware of such option. Did some research and could not find it either.

Copy link
Contributor

@dottorblaster dottorblaster Jan 27, 2022

Choose a reason for hiding this comment

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

I would ask @fabriziosestito since he is the lord of that pattern but I think we can actually declare wwhrd in the tools/tools.go file having it fetched inside deps

@flaviodsr
Copy link
Contributor Author

@arbulu89 thanks for the review.

Regarding the golang bin directory, do you have a suggestion on how to fix that? I could add $GOPATH/bin to the path of the binary, however there is also the case where it is not defined which defaults to $HOME/go/bin. Not sure if it would be worthy going over all the options.

@flaviodsr flaviodsr force-pushed the check_licenses branch 2 times, most recently from 8e3b3b0 to 8ecdbd4 Compare January 27, 2022 14:08
The check is implemented using wwhrd [1] and the allowed
licenses are listed on the `.wwhrd.yml` file.

1. https://github.com/frapposelli/wwhrd
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Add licenses checking to the test phase of the build pipeline
3 participants