From f164a69affa4b6e4cdb81afa8b84932c53b1b6fc Mon Sep 17 00:00:00 2001 From: Toshiya Kobayashi Date: Wed, 13 Nov 2024 15:47:47 +0900 Subject: [PATCH] [incubator-kie-issues-1613] Add .rat-excludes file to each repository --- .github/workflows/pr-rat-check.yml | 40 +++++++++++++++++++ .gitignore | 1 + .rat-excludes | 40 +++++++++++++++++++ NOTICE | 4 ++ NOTICE-BINARY | 8 +++- .../drools-test-coverage-jars/README.md | 19 +++++++++ .../only-jar-pojo-not-kjar-no-kmodule/pom.xml | 9 +++++ .../drools-test-coverage-jars/surf/pom.xml | 9 +++++ .../testEnum/pom.xml | 9 +++++ .../drools-verifier-test-jar/pom.xml | 9 +++++ .../valid_models/DMNv1_5/MultipleHitRules.dmn | 18 +++++++++ .../DMNv1_5/RiskScore_Conditional.dmn | 18 +++++++++ .../valid_models/DMNv1_5/RiskScore_Simple.dmn | 18 +++++++++ pom.xml | 4 ++ 14 files changed, 205 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/pr-rat-check.yml create mode 100644 .rat-excludes diff --git a/.github/workflows/pr-rat-check.yml b/.github/workflows/pr-rat-check.yml new file mode 100644 index 00000000000..1f504cd40c2 --- /dev/null +++ b/.github/workflows/pr-rat-check.yml @@ -0,0 +1,40 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +name: Run Apache RAT check + +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + +jobs: + apache-rat-check: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Download Apache RAT + run: | + curl -LO https://repo1.maven.org/maven2/org/apache/rat/apache-rat/0.16.1/apache-rat-0.16.1.jar + + - name: Run Apache RAT + run: | + java -jar apache-rat-0.16.1.jar -d . -E .rat-excludes | grep "== File:" && exit 1 || echo "All files have license headers." diff --git a/.gitignore b/.gitignore index dfa69a393a7..655baabbb2b 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ local/ !.github !.git-blame-ignore-revs !.openrewrite +!.rat-excludes nbproject *.ipr *.iws diff --git a/.rat-excludes b/.rat-excludes new file mode 100644 index 00000000000..88a2c53717c --- /dev/null +++ b/.rat-excludes @@ -0,0 +1,40 @@ +\.rat-excludes +\.gitignore +DISCLAIMER-WIP +ui-bundle\.zip +\.git-blame-ignore-revs +dependency-reduced-pom\.xml +lunr-2\.3\.9\.min\.js +search-ui\.js +branch\.yaml +main\.yaml +mvel\.jj +JavaLexer\.g4 +JavaParser\.g4 +.*\.sdo +.*\.sdt +TestingEmptyFile\.txt +.*\.test_json +.*\.pmml_json +.*\.drl_json +.*\.dslr +DMN.*\.xsd +DC\.xsd +DI\.xsd +KiePMML.*\.txt +TargetValueFactoryTest_01\.txt +TargetFieldFactoryTest_01\.txt +.*\.uml +drools-model +testFile\.txt +simple\.dot +.*\.log +.*\.lst +checkstyle-cachefile +test.*\.txt +test.*\.yml +drl\.ftl +goal\.txt +adult\.txt +antora\.yml +.*\.iml \ No newline at end of file diff --git a/NOTICE b/NOTICE index 646a3d4ae06..ca80f76b0cf 100644 --- a/NOTICE +++ b/NOTICE @@ -22,6 +22,10 @@ This product also includes the following third-party components: Downloaded from: https://gitlab.com/antora/antora-lunr-extension License: Mozilla Public License 2.0 +* antora ui-bundle + Downloaded from: https://github.com/stephengold/antora-ui-bundle + License: Mozilla Public License 2.0 + * JavaParser, JavaLexer Downloaded from: https://github.com/antlr/grammars-v4/tree/master/java/java License: BSD License \ No newline at end of file diff --git a/NOTICE-BINARY b/NOTICE-BINARY index 958dc62a499..31b997e9d95 100644 --- a/NOTICE-BINARY +++ b/NOTICE-BINARY @@ -25,4 +25,10 @@ efesto/efesto-core/efesto-common-api/src/test/resources/TestJar.jar : a compress efesto/efesto-core/efesto-common-core/src/test/resources/TestJar.jar : a compressed JSON file for test efesto/efesto-core/efesto-runtime-manager/efesto-runtime-manager-core/src/test/resources/TestJar.jar : a compressed JSON file for test -These files are used to validate the functionality and reliability of Apache KIE. They are not intended for production use or distribution beyond the scope of testing within this project. \ No newline at end of file +These files are used to validate the functionality and reliability of Apache KIE. They are not intended for production use or distribution beyond the scope of testing within this project. + +## Disclaimer for non-compiled resources Binaries + +The following binaries are included in this project, but don't contain compiled resources. + +drools-docs/ui-bundle/ui-bundle.zip : antora ui-bundle resources. For example, js and svg. See NOTICE file \ No newline at end of file diff --git a/drools-test-coverage/drools-test-coverage-jars/README.md b/drools-test-coverage/drools-test-coverage-jars/README.md index b3a0d191671..195a5f7d596 100644 --- a/drools-test-coverage/drools-test-coverage-jars/README.md +++ b/drools-test-coverage/drools-test-coverage-jars/README.md @@ -1,3 +1,22 @@ + + ## drools-test-coverage-jars This project is to build jars that are used in `drools-test-coverage` project. So we can avoid having jar binaries in the codebase. diff --git a/drools-test-coverage/drools-test-coverage-jars/only-jar-pojo-not-kjar-no-kmodule/pom.xml b/drools-test-coverage/drools-test-coverage-jars/only-jar-pojo-not-kjar-no-kmodule/pom.xml index 743140ddc61..b8df8ebb164 100644 --- a/drools-test-coverage/drools-test-coverage-jars/only-jar-pojo-not-kjar-no-kmodule/pom.xml +++ b/drools-test-coverage/drools-test-coverage-jars/only-jar-pojo-not-kjar-no-kmodule/pom.xml @@ -49,6 +49,11 @@ copy-rename-maven-plugin 1.0 + + org.apache.rat + apache-rat-plugin + 0.16.1 + @@ -69,6 +74,10 @@ + + org.apache.rat + apache-rat-plugin + diff --git a/drools-test-coverage/drools-test-coverage-jars/surf/pom.xml b/drools-test-coverage/drools-test-coverage-jars/surf/pom.xml index 4d64756f856..ee27ae8b863 100644 --- a/drools-test-coverage/drools-test-coverage-jars/surf/pom.xml +++ b/drools-test-coverage/drools-test-coverage-jars/surf/pom.xml @@ -49,6 +49,11 @@ copy-rename-maven-plugin 1.0 + + org.apache.rat + apache-rat-plugin + 0.16.1 + @@ -69,6 +74,10 @@ + + org.apache.rat + apache-rat-plugin + diff --git a/drools-test-coverage/drools-test-coverage-jars/testEnum/pom.xml b/drools-test-coverage/drools-test-coverage-jars/testEnum/pom.xml index 3ad43595713..733516d82de 100644 --- a/drools-test-coverage/drools-test-coverage-jars/testEnum/pom.xml +++ b/drools-test-coverage/drools-test-coverage-jars/testEnum/pom.xml @@ -49,6 +49,11 @@ copy-rename-maven-plugin 1.0 + + org.apache.rat + apache-rat-plugin + 0.16.1 + @@ -69,6 +74,10 @@ + + org.apache.rat + apache-rat-plugin + diff --git a/drools-verifier/drools-verifier-test-jar/pom.xml b/drools-verifier/drools-verifier-test-jar/pom.xml index 415f171364a..a4c76f03410 100644 --- a/drools-verifier/drools-verifier-test-jar/pom.xml +++ b/drools-verifier/drools-verifier-test-jar/pom.xml @@ -49,6 +49,11 @@ copy-rename-maven-plugin 1.0 + + org.apache.rat + apache-rat-plugin + 0.16.1 + @@ -69,6 +74,10 @@ + + org.apache.rat + apache-rat-plugin + diff --git a/kie-dmn/kie-dmn-test-resources/src/test/resources/valid_models/DMNv1_5/MultipleHitRules.dmn b/kie-dmn/kie-dmn-test-resources/src/test/resources/valid_models/DMNv1_5/MultipleHitRules.dmn index b01f79264a5..11f5b808f56 100644 --- a/kie-dmn/kie-dmn-test-resources/src/test/resources/valid_models/DMNv1_5/MultipleHitRules.dmn +++ b/kie-dmn/kie-dmn-test-resources/src/test/resources/valid_models/DMNv1_5/MultipleHitRules.dmn @@ -1,4 +1,22 @@ + diff --git a/kie-dmn/kie-dmn-test-resources/src/test/resources/valid_models/DMNv1_5/RiskScore_Conditional.dmn b/kie-dmn/kie-dmn-test-resources/src/test/resources/valid_models/DMNv1_5/RiskScore_Conditional.dmn index a4816f968de..d99df9eb17b 100644 --- a/kie-dmn/kie-dmn-test-resources/src/test/resources/valid_models/DMNv1_5/RiskScore_Conditional.dmn +++ b/kie-dmn/kie-dmn-test-resources/src/test/resources/valid_models/DMNv1_5/RiskScore_Conditional.dmn @@ -1,4 +1,22 @@ + string diff --git a/kie-dmn/kie-dmn-test-resources/src/test/resources/valid_models/DMNv1_5/RiskScore_Simple.dmn b/kie-dmn/kie-dmn-test-resources/src/test/resources/valid_models/DMNv1_5/RiskScore_Simple.dmn index ea0d40e36a1..e3ae94ef54b 100644 --- a/kie-dmn/kie-dmn-test-resources/src/test/resources/valid_models/DMNv1_5/RiskScore_Simple.dmn +++ b/kie-dmn/kie-dmn-test-resources/src/test/resources/valid_models/DMNv1_5/RiskScore_Simple.dmn @@ -1,4 +1,22 @@ + string diff --git a/pom.xml b/pom.xml index 82960af5a91..33fd8656119 100644 --- a/pom.xml +++ b/pom.xml @@ -135,6 +135,10 @@ ${version.apache-rat-plugin} + .rat-excludes + .gitignore + DISCLAIMER-WIP + **/ui-bundle.zip .git-blame-ignore-revs **/dependency-reduced-pom.xml **/lunr-2.3.9.min.js