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

gh: check copyrights and make Apache only approved #9098

Merged
merged 4 commits into from
Nov 25, 2024

Conversation

kikofernandez
Copy link
Contributor

Adds the checks on copyrights, and makes Apache the only accepted license.
Anything outside Apache should be flagged and approved in the Security panel.

@kikofernandez kikofernandez self-assigned this Nov 21, 2024
@kikofernandez kikofernandez added team:VM Assigned to OTP team VM enhancement labels Nov 21, 2024
Copy link
Contributor

github-actions bot commented Nov 21, 2024

CT Test Results

  1 files   11 suites   3m 58s ⏱️
 93 tests  91 ✅ 2 💤 0 ❌
109 runs  107 ✅ 2 💤 0 ❌

Results for commit 42b6136.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

~"openssl-ssleay", ~"cc-by-sa-3.0", ~"cc-by-4.0", ~"dco-1.1", ~"fsf-ap",
~"agpl-1.0-plus", ~"agpl-1.0", ~"agpl-3.0-plus", ~"classpath-exception-2.0",
~"ietf-trust"].
[ <<"apache-2.0">> ].
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We only accept Apache

Comment on lines 43 to 50
reviewed() ->
[ <<"mit">>, <<"boost-1.0">>, <<"llvm-exception">>,
<<"cc0-1.0">>, <<"bsd-simplified">>, <<"bsd-new">>, <<"pcre">>,
<<"fsf-free">>, <<"autoconf-exception-3.0">>, <<"public-domain">>,
<<"autoconf-simple-exception">>, <<"unicode">>, <<"tcl">>, <<"gpl-2.0 WITH classpath-exception-2.0">>,
<<"zlib">>, <<"lgpl-2.0-plus WITH wxwindows-exception-3.1">>,
<<"openssl-ssleay">>, <<"cc-by-sa-3.0">>, <<"cc-by-4.0">>, <<"dco-1.1">>, <<"fsf-ap">>,
<<"classpath-exception-2.0">>, <<"ietf-trust">> ].
Copy link
Contributor Author

Choose a reason for hiding this comment

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

in cases of auto-generated code or special cases, we could review contributions under these licenses, but these must be very special cases.
The idea is that the automated check marks these for review, and we accept them on an ongoing basis.
No PR should be merged without its corresponding license approval

Comment on lines 53 to 56
[<<"gpl">>, <<"gpl-3.0-plus">>, <<"gpl-2.0">>, <<"gpl-1.0-plus">>, <<"unlicense">>,
<<"lgpl-2.0-plus">>, <<"lgpl-2.1-plus">>, <<"agpl-1.0-plus">>, <<"agpl-1.0">>,
<<"agpl-3.0-plus">>, <<"erlangpl-1.1">>, <<"gpl-2.0-plus">>, <<"null">>, <<"agpl-3.0">>,
<<"mpl-1.1">>, 'null'].
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we do not approve some licenses, and I mess up the list initially

@kikofernandez kikofernandez force-pushed the kiko/codescan/compliance-pr branch 5 times, most recently from f45272b to fc3a872 Compare November 21, 2024 17:02
@kikofernandez
Copy link
Contributor Author

this is a meta error. the introduction of the LICENSE rule to correctly change AND rules by ORs cannot be applied to itself, so it reports a license compliance error when it is ok.

@garazdawi
Copy link
Contributor

The change seems to crash when run on a push and not a pr: https://github.com/kikofernandez/otp/actions/runs/11958065364/job/33336711990

Copy link
Contributor

@garazdawi garazdawi left a comment

Choose a reason for hiding this comment

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

As we are reporting copyright and license information now we need to remove any duplicate files from the SARIF artifact array. For example like this:

                 ~"artifacts" =>
                     [ #{
                         ~"location" => #{
                                          ~"uri" => File
                                         },
                         ~"length" => -1
                        } || File <- lists:usort([F || {_, F, _} <- Errors])]
                     ],

The error shows up here: https://github.com/kikofernandez/otp/actions/runs/11973269459/job/33382224159

@kikofernandez
Copy link
Contributor Author

Thanks, I was thinking that it was ok to report the same file for copyright issues and for license issues, but that should not be the case for the sarif generation, since files should be unique. Thanks again! Change pushed

@kikofernandez kikofernandez merged commit c5edde7 into erlang:maint Nov 25, 2024
23 of 24 checks passed
@kikofernandez kikofernandez deleted the kiko/codescan/compliance-pr branch November 25, 2024 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement team:VM Assigned to OTP team VM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants