Skip to content
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

Allow extra 3rd party licenses #9796

Merged
merged 9 commits into from
Jul 29, 2021
Merged

Conversation

sarah-witt
Copy link
Contributor

@sarah-witt sarah-witt commented Jul 28, 2021

What does this PR do?

Updates the validate license command to add the ability for integrations to have 3rd party licenses which are not pulled directly from the requirements file and the origin is not PyPI.

Motivation

#9786

Additional Notes

To test, add a LICENSE-3rdparty-extra.csv to the directory of any check. See #9786 for an example.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • PR title must be written as a CHANGELOG entry (see why)
  • Files changes must correspond to the primary purpose of the PR as described in the title (small unrelated changes should have their own PR)
  • PR must have changelog/ and integration/ labels attached

@codecov
Copy link

codecov bot commented Jul 28, 2021

Codecov Report

Merging #9796 (b0c06d9) into master (f44c7b9) will not change coverage.
The diff coverage is n/a.

Flag Coverage Δ
datadog_checks_dev 79.93% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@sarah-witt sarah-witt marked this pull request as ready for review July 28, 2021 19:50
@sarah-witt sarah-witt requested a review from a team as a code owner July 28, 2021 19:50
Comment on lines 221 to 223
def get_extra_license_file(check_name):
path = os.path.join(get_root(), check_name, 'LICENSE-3rdparty-extra.csv')
return path, file_exists(path)
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead, wdyta:

Suggested change
def get_extra_license_file(check_name):
path = os.path.join(get_root(), check_name, 'LICENSE-3rdparty-extra.csv')
return path, file_exists(path)
def get_extra_license_files():
for path in os.listdir(get_root()):
if not file_exists(get_manifest_file(path)):
continue
extra_license_file = os.path.join(get_root(), path, 'LICENSE-3rdparty-extra.csv')
if file_exists(extra_license_file):
yield extra_license_file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good- updated!

@sarah-witt sarah-witt changed the title Allow for extra 3rd party licenses Allow extra 3rd party licenses Jul 28, 2021
@sarah-witt sarah-witt merged commit 47882ad into master Jul 29, 2021
@sarah-witt sarah-witt deleted the sarah/update-license-script branch July 29, 2021 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants