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

ci: add license lint wf for cncf approved licenses #2461

Merged
merged 12 commits into from
Jan 20, 2023

Conversation

acpana
Copy link
Contributor

@acpana acpana commented Dec 15, 2022

Fixes #2404

reviewer notes

  • PR story:

Initially, i wanted to use license-lint but after an issue w allowlisted modules where the underlying license can change without detection, I decided to go with Max's original suggestion in the issue: https://github.com/kubernetes/kubernetes/blob/master/hack/verify-licenses.sh . This is a script that I am copying over w a number of minimal changes to make it work for us.

# install act
$ <your distro needs>

$ act -j license-lint

NOTE for the skeptics: you can play w the config file to make the wf fail

  • you can find the CNCF approved licenses here

@codecov-commenter
Copy link

codecov-commenter commented Dec 15, 2022

Codecov Report

Base: 53.95% // Head: 53.90% // Decreases project coverage by -0.05% ⚠️

Coverage data is based on head (a14778e) compared to base (ec3d4d9).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2461      +/-   ##
==========================================
- Coverage   53.95%   53.90%   -0.05%     
==========================================
  Files         116      116              
  Lines       10286    10286              
==========================================
- Hits         5550     5545       -5     
- Misses       4311     4315       +4     
- Partials      425      426       +1     
Flag Coverage Δ
unittests 53.90% <ø> (-0.05%) ⬇️

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

Impacted Files Coverage Δ
...onstrainttemplate/constrainttemplate_controller.go 55.74% <0.00%> (-2.88%) ⬇️
pkg/readiness/ready_tracker.go 70.33% <0.00%> (+0.50%) ⬆️
pkg/readiness/list.go 91.17% <0.00%> (+11.76%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@acpana acpana marked this pull request as ready for review December 20, 2022 04:05
.github/license-lint-config.yml Outdated Show resolved Hide resolved
.github/license-lint-config.yml Outdated Show resolved Hide resolved
.github/license-lint-config.yml Outdated Show resolved Hide resolved
.github/license-lint-config.yml Outdated Show resolved Hide resolved
@acpana
Copy link
Contributor Author

acpana commented Jan 5, 2023

hey @sozercan & @maxsmythe thanks both for offering feedback on the initial approach.

After this comment that Max made I realized that the license-lint tool may not be the best approach:

What is the mechanism for detecting license changes in allowlisted modules?

At present, if a package under allow list changes from an approved license to an unapproved license, the tool wouldn't detect that. code ref

While I am not too sure how often this would happen, that scenario, combined with some other papercuts of the tool have convinced me to explore a different solution for what actually does the license linting.

@acpana
Copy link
Contributor Author

acpana commented Jan 5, 2023

Starting 4e73471 I am introducing a script from the k8s repo: verify-licenses and its dependencies. I also added a few commits to taylor it to the g8r repo. Some of the env vars and such will remain.

@acpana acpana marked this pull request as draft January 5, 2023 03:49
@acpana acpana changed the title ci: add license lint wf ci: add license lint wf for cncf approved licenses Jan 5, 2023
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
@acpana acpana marked this pull request as ready for review January 6, 2023 18:04
@acpana acpana requested review from sozercan and removed request for sozercan January 6, 2023 18:04
@acpana acpana requested a review from maxsmythe January 6, 2023 18:04
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
@acpana
Copy link
Contributor Author

acpana commented Jan 19, 2023

alright folks, I think this PR has all the feedback from our weekly chat @ritazh @sozercan @maxsmythe

Copy link
Member

@sozercan sozercan left a comment

Choose a reason for hiding this comment

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

LGTM. since action didn't run on this PR, did you test this manually?

.github/workflows/license-lint.yaml Show resolved Hide resolved
@acpana
Copy link
Contributor Author

acpana commented Jan 20, 2023

re testing, there's 3 avenues:

Copy link
Contributor

@maxsmythe maxsmythe left a comment

Choose a reason for hiding this comment

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

LGTM

@sozercan sozercan merged commit 7786db9 into open-policy-agent:master Jan 20, 2023
davis-haba pushed a commit to davis-haba/gatekeeper that referenced this pull request Mar 7, 2023
…#2461)

* make yml file for current g8r licenses

Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>

* add gh wf for license-lint

Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>

* cncf aligned config for lgk

Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>

* cherry pick script at 124fd62ad25

Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>

* replace some k8s references, fix path

Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>

* swap out license linter

Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>

* delete license-lint config

Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>

* designer commits: specify CF url, add exception, include tests

Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>

* add wf paths

Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>

* add readme

Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>

* remove dependencies

Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>

Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add License Linting
5 participants