Skip to content

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

Merged
sozercan merged 12 commits into
open-policy-agent:masterfrom
acpana:acpana/license-lint
Jan 20, 2023
Merged

ci: add license lint wf for cncf approved licenses#2461
sozercan merged 12 commits into
open-policy-agent:masterfrom
acpana:acpana/license-lint

Conversation

@acpana
Copy link
Copy Markdown
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

@acpana acpana force-pushed the acpana/license-lint branch from e9d030a to e08e622 Compare December 15, 2022 06:21
@codecov-commenter
Copy link
Copy Markdown

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 force-pushed the acpana/license-lint branch from e08e622 to 6c3983d Compare December 20, 2022 04:04
@acpana acpana marked this pull request as ready for review December 20, 2022 04:05
Comment thread .github/license-lint-config.yml Outdated
Comment thread .github/license-lint-config.yml Outdated
Comment thread .github/license-lint-config.yml Outdated
Comment thread .github/workflows/license-lint.yaml
Comment thread .github/workflows/license-lint.yaml
Comment thread .github/workflows/license-lint.yaml Outdated
Comment thread .github/license-lint-config.yml Outdated
Comment thread .github/license-lint-config.yml Outdated
Comment thread .github/license-lint-config.yml Outdated
Comment thread .github/license-lint-config.yml Outdated
@acpana acpana force-pushed the acpana/license-lint branch from 6c3983d to 158461d Compare January 5, 2023 02:33
@acpana
Copy link
Copy Markdown
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
Copy Markdown
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
acpana added 7 commits January 6, 2023 16:43
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 force-pushed the acpana/license-lint branch from 8ee2596 to 60795a7 Compare January 6, 2023 17:41
acpana added 2 commits January 6, 2023 17:52
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
@acpana acpana force-pushed the acpana/license-lint branch from 60795a7 to 46e88a8 Compare January 6, 2023 17:59
@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
Comment thread third_party/k8s.io/kubernetes/hack/lib/golang.sh Outdated
Comment thread third_party/k8s.io/kubernetes/hack/lib/etcd.sh Outdated
Comment thread third_party/k8s.io/kubernetes/hack/verify-licenses.sh
Comment thread third_party/k8s.io/kubernetes/hack/lib/etcd.sh Outdated
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
Copy Markdown
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
Copy Markdown
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?

Comment thread .github/workflows/license-lint.yaml
@acpana
Copy link
Copy Markdown
Contributor Author

acpana commented Jan 20, 2023

re testing, there's 3 avenues:

@sozercan sozercan requested a review from maxsmythe January 20, 2023 01:18
Copy link
Copy Markdown
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