-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Add NOTICE file for Beats #3334
Conversation
d819c70
to
432609c
Compare
7061edd
to
f2b9c32
Compare
@@ -0,0 +1,1692 @@ | |||
License /Users/monica/src/github.com/elastic/beats/metricbeat/vendor/github.com/mitchellh/hashstructure/LICENSE |
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.
We should not include here the full path as it contains your private username. Perhaps we can replace it by $GOPATH or just make it relative to the repo.
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.
Yes, sure. The plan is to include only github.com/mitchellh/hashstructure
.
vendors = [beat_dir, libbeat_dir] | ||
licenses = [] | ||
|
||
for vendor in vendors: |
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.
Will this also include vendor directories inside metricbeat modules?
This could also be interesting to see which repos do not contain a license file: https://github.com/pmezard/licenses |
47b59f7
to
274fac6
Compare
965a018
to
441e5e2
Compare
This PR is going to be useful for community beats as well :) Could you please make sure that we (developers) can configure the output by using variables instead of |
505934b
to
b7c0a6b
Compare
1fe45e8
to
8f7f2f8
Compare
@cyrilleverrier Thank you for such a quick feedback. I added two options ( |
|
||
.PHONY: notice | ||
notice: | ||
python dev-tools/generate_notice.py metricbeat/vendor vendor |
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.
This does not include the vendor directories in the metricbeat modules? How about somthing like find . -name vendor
?
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.
Ah, good point. Then I will search in a given director for all the vendor directories.
lib = "" | ||
path = os.path.dirname(license) | ||
# get the last three directories | ||
for i in range(0, 3): |
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.
Does this also work for dependencies not on Github?
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.
It gets only the last 3rd directories from the path, but the function should be able to get less than 3 directories as well. I adjusted the code a bit to accept also less than 3 directories (example windows/project)
The script receives a directory and searches for all the all vendor subdirectories in order to extract copyright information about the 3rd party libraries that are used. The NOTICE file is generated in the current directory. For each 3rd party library, the following rules are used: - If the library has apache license, and if NOTICE file is present, include that text in the NOTICE file. - If the library has MIT, ISC or BSD license, include the whole copyright block in NOTICE file (meaning copyright + license)
48fc892
to
529e477
Compare
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
* Python script to generate the NOTICE file The script receives a directory and searches for all the all vendor subdirectories in order to extract copyright information about the 3rd party libraries that are used. The NOTICE file is generated in the current directory. For each 3rd party library, the following rules are used: - If the library has apache license, and if NOTICE file is present, include that text in the NOTICE file. - If the library has MIT, ISC or BSD license, include the whole copyright block in NOTICE file (meaning copyright + license) * Accept also 3rd party libraries with less than 3 directories (cherry picked from commit e2aaa38)
* Add NOTICE file for Beats (#3334) * Python script to generate the NOTICE file The script receives a directory and searches for all the all vendor subdirectories in order to extract copyright information about the 3rd party libraries that are used. The NOTICE file is generated in the current directory. For each 3rd party library, the following rules are used: - If the library has apache license, and if NOTICE file is present, include that text in the NOTICE file. - If the library has MIT, ISC or BSD license, include the whole copyright block in NOTICE file (meaning copyright + license) * Accept also 3rd party libraries with less than 3 directories (cherry picked from commit e2aaa38) * Add NOTICE file to the packages (#3379) Added to the home path. Also modifies the generators to include a simple NOTICE file, which is anyway good practice for Apache licensed projects. Tested the beat and the metricbeat generators by hand. (cherry picked from commit f3352eb)
* Add NOTICE file for Beats (elastic#3334) * Python script to generate the NOTICE file The script receives a directory and searches for all the all vendor subdirectories in order to extract copyright information about the 3rd party libraries that are used. The NOTICE file is generated in the current directory. For each 3rd party library, the following rules are used: - If the library has apache license, and if NOTICE file is present, include that text in the NOTICE file. - If the library has MIT, ISC or BSD license, include the whole copyright block in NOTICE file (meaning copyright + license) * Accept also 3rd party libraries with less than 3 directories (cherry picked from commit da690f7) * Add NOTICE file to the packages (elastic#3379) Added to the home path. Also modifies the generators to include a simple NOTICE file, which is anyway good practice for Apache licensed projects. Tested the beat and the metricbeat generators by hand. (cherry picked from commit 3e63f7b)
This PR contains a python script that generates the NOTICE file. There is a single NOTICE file for all the official Beats, and it's placed in the beats repository.
The NOTICE file includes the copyright information for all the 3rd party libraries used in the Beats project. It follows the rules:
You can pass a list of vendor directories where the NOTICE* and LICENSE* files of all 3rd party libraries are available:
For the official Beats, you can run the following in the beats repository.
The NOTICE file can be generated by the community Beats by using the script. The NOTICE file is not added by the Beat generator.
UPDATE: The script accepts also the name of the Beat and the copyright owner, to customize the NOTICE file for the community Beats.