-
Notifications
You must be signed in to change notification settings - Fork 718
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
Generate notice file from dependency licences #1764
Conversation
fb52805
to
abd3e8f
Compare
I'm not able to run the unit tests:
Also should they not be run by the CI ? |
One of the test directories was ignored by git because it didn't contain anything (intentionally). It's been fixed now.
The tests were mainly for my benefit. This bit of code has nothing to do with the operator so I kept it as a separate project with its own set of dependencies so that we could move it out at a later time if we wanted to. |
It has nothing to do with the operator from a technical point of view, but I think it still has the responsibility to produce a notice with the right content. |
The notice file gets updated every time I don't feel that CI will bring much benefit due to the following reasons:
If you do feel strongly about it, I am happy to discuss offline. |
I'm not sure I'm strongly opinionated on this, but given that the generated file seems to be important I would prefer to let someone else approve the fact that we are not running the unit tests. |
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.
LGTM, clever idea to leverage go list
- I am +1 on running the tests given that you have written them (I know we have been a bit sloppy in the hack directory)
- but I don't think it should delay this from being merged
{{ end }} | ||
{{- end -}} | ||
|
||
Copyright 2014-{{ currentYear }} Elasticsearch BV |
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 I need some help here: why the specific range start of 2014?
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 took the header from #1689 -- which I think came from the Beats notice file. Should we change it to when the ECK project was started? (2018 I assume)
I wonder if this is worth splitting out into a separate project since anyone using projects with notice requirements has the same need. |
An alternative implementation of #1689 that does not require generating the vendor directory. This code parses the output of
go list -m -json all
to locate all dependencies and their paths on disk (taking replace directives into account). It then detects possible licence files in the path and builds a notice file.Sample output generated using the output of
go list -m -json all
on Kubebuilder v2 branch: https://gist.github.com/charith-elastic/fa284284cfbcdfa479820f28d542fc48