Skip to content

Commit

Permalink
[10.0.x] kie-issues#1613: Add CI :: License headers GitHub Actions …
Browse files Browse the repository at this point in the history
…workflow (#3797)

* kie-issues#1613: Add `CI :: License headers` GitHub Actions workflow (#3714)

* Add license header

* Revert "Add license header"

This reverts commit 00cfcc5.

* Add license header

* revert beans.xml

* .rat-excludes and rat check action

* remove checkstyle.header.template

* OMG BPMN SPEC files license

* .rat-excludes fix format - escaping

* .rat-excludes

* storage-jpa license

* apache rat 17

* fix exit logic

* print rat check output

* align with other PRs of kie-issues#1613

* license text placeholder

* LICENSE SPEC

* Revert "LICENSE SPEC"

This reverts commit 3e4e2f8.

* List explicitely all files in the .rat-excludes

* Use apache-rat v0.16.1

* Everthing -> Everything

* BPMN LICENSE text

* CI :: License headers

* kogito-codegen-modules/kogito-codegen-processes-integration-tests/src/test/resources

* .bpmn[2] files

* Adapt .rat-excludes

* Resolve conflicts

* Exclude pepe.txt
  • Loading branch information
jomarko authored Dec 2, 2024
1 parent 53aa1b2 commit f3951d1
Show file tree
Hide file tree
Showing 9 changed files with 241 additions and 61 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/ci_check_license_headers.yaml
Original file line number Diff line number Diff line change
@@ -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: "CI :: License headers"

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

jobs:
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:" && echo "The files listed above are missing license headers." && exit 1 || echo "All files have license headers."
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,7 @@ target/
.run/
.checkstyle

*.log
*.log

# Apache RAT check excludes file
!.rat-excludes
196 changes: 196 additions & 0 deletions .rat-excludes
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
# .rat-excludes
.rat-excludes
# DISCLAIMER-WIP
DISCLAIMER-WIP
# addons/common/jbpm-usertask-storage-jpa/src/main/resources/META-INF/beans.xml
beans.xml
# addons/common/marshallers/avro/src/main/resources/jsonNode.avsc
jsonNode.avsc
# addons/common/marshallers/avro/src/main/resources/spec.avsc
spec.avsc
# addons/common/marshallers/avro/src/test/avro/pojo.avsc
pojo.avsc
# addons/common/monitoring/prometheus/src/main/resources/META-INF/kogito.addon
kogito.addon
# addons/common/persistence/filesystem/src/main/resources/META-INF/kogito.addon
kogito.addon
# addons/common/persistence/infinispan/src/main/resources/META-INF/kogito.addon
kogito.addon
# addons/common/persistence/jdbc/src/main/resources/META-INF/kogito.addon
kogito.addon
# addons/common/persistence/mongodb/src/main/resources/META-INF/kogito.addon
kogito.addon
# addons/common/persistence/postgresql/src/main/resources/META-INF/kogito.addon
kogito.addon
# addons/common/persistence/rocksdb/src/main/resources/META-INF/kogito.addon
kogito.addon
# api/kogito-events-core/src/main/resources/META-INF/services/com.fasterxml.jackson.databind.Module
com.fasterxml.jackson.databind.Module
# api/kogito-events-core/src/main/resources/META-INF/services/org.kie.kogito.event.impl.adapter.DataEventAdapter
org.kie.kogito.event.impl.adapter.DataEventAdapter
# jbpm/jbpm-bpmn2/src/main/resources/META-INF/BPMN20.xsd
BPMN20.xsd
# jbpm/jbpm-bpmn2/src/main/resources/META-INF/BPMNDI.xsd
BPMNDI.xsd
# jbpm/jbpm-bpmn2/src/main/resources/META-INF/DC.xsd
DC.xsd
# jbpm/jbpm-bpmn2/src/main/resources/META-INF/DI.xsd
DI.xsd
# jbpm/jbpm-bpmn2/src/main/resources/META-INF/DiagramDefinition.xsd
DiagramDefinition.xsd
# jbpm/jbpm-bpmn2/src/main/resources/META-INF/DiagramInterchange.xsd
DiagramInterchange.xsd
# jbpm/jbpm-bpmn2/src/main/resources/META-INF/Semantic.xsd
Semantic.xsd
# jbpm/jbpm-bpmn2/src/main/resources/META-INF/bpsim.xsd
bpsim.xsd
# jbpm/jbpm-bpmn2/src/main/xsd/BPMN20.xsd
BPMN20.xsd
# jbpm/jbpm-bpmn2/src/main/xsd/BPMNDI.xsd
BPMNDI.xsd
# jbpm/jbpm-bpmn2/src/main/xsd/DC.xsd
DC.xsd
# jbpm/jbpm-bpmn2/src/main/xsd/DI.xsd
DI.xsd
# jbpm/jbpm-bpmn2/src/main/xsd/DiagramDefinition.xsd
DiagramDefinition.xsd
# jbpm/jbpm-bpmn2/src/main/xsd/DiagramInterchange.xsd
DiagramInterchange.xsd
# jbpm/jbpm-bpmn2/src/main/xsd/Semantic.xsd
Semantic.xsd
# jbpm/jbpm-bpmn2/src/main/xsd/bpsim.xsd
bpsim.xsd
# jbpm/jbpm-flow/src/main/resources/META-INF/services/org.jbpm.ruleflow.core.factory.provider.NodeFactoryProvider
org.jbpm.ruleflow.core.factory.provider.NodeFactoryProvider
# jbpm/jbpm-flow-builder/src/main/resources/META-INF/services/org.jbpm.compiler.canonical.builtin.ReturnValueEvaluatorBuilder
org.jbpm.compiler.canonical.builtin.ReturnValueEvaluatorBuilder
# jbpm/jbpm-flow-builder/src/main/resources/META-INF/services/org.jbpm.compiler.canonical.node.NodeVisitorBuilder
org.jbpm.compiler.canonical.node.NodeVisitorBuilder
# jbpm/jbpm-flow-builder/src/main/resources/META-INF/services/org.jbpm.process.builder.transformation.DataTransformerCompiler
org.jbpm.process.builder.transformation.DataTransformerCompiler
# jbpm/jbpm-flow-migration/src/test/resources/META-INF/migration-plan/simple_invalid_migration.invalid
simple_invalid_migration.invalid
# jbpm/jbpm-flow-migration/src/test/resources/META-INF/migration-plan/simple_migration.mpf
simple_migration.mpf
# jbpm/jbpm-flow-migration/src/test/resources/META-INF/migration-plan/simple_migration_version.mpf
simple_migration_version.mpf
# jbpm/jbpm-tests/src/test/resources/calendar.properties
calendar.properties
# jbpm/jbpm-tests/src/test/resources/xxe-protection/Text1.txt
Text1.txt
# jbpm/jbpm-tests/src/test/resources/xxe-protection/Text2.txt
Text2.txt
# kogito-codegen-modules/kogito-codegen-core/src/test/resources/.a-hidden-file.txt
.a-hidden-file.txt
# kogito-codegen-modules/kogito-codegen-processes-integration-tests/src/test/resources/META-INF/kogito.addon
kogito.addon
# kogito-codegen-modules/kogito-codegen-processes-integration-tests/src/test/resources/org/kie/kogito/codegen/process/process-generation-test.skip.txt
process-generation-test.skip.txt
# kogito-codegen-modules/kogito-codegen-sample/kogito-codegen-sample-generator/src/test/resources/sampleFile1.txt
sampleFile1.txt
# kogito-codegen-modules/kogito-codegen-sample/kogito-codegen-sample-generator/src/test/resources/sampleFile2.txt
sampleFile2.txt
# kogito-serverless-workflow/kogito-serverless-workflow-builder/src/test/resources/pepe.txt
pepe.txt
# kogito-serverless-workflow/kogito-serverless-workflow-executor-python/requirements.txt
requirements.txt
# quarkus/addons/events/decisions/runtime/src/main/resources/META-INF/kogito.addon
kogito.addon
# quarkus/addons/events/predictions/runtime/src/main/resources/META-INF/kogito.addon
kogito.addon
# quarkus/addons/events/rules/runtime/src/main/resources/META-INF/kogito.addon
kogito.addon
# quarkus/addons/explainability/runtime/src/main/resources/META-INF/kogito.addon
kogito.addon
# quarkus/addons/jobs/knative-eventing/runtime/src/main/resources/META-INF/kogito.addon
kogito.addon
# quarkus/addons/jobs/management/runtime/src/main/resources/META-INF/kogito.addon
kogito.addon
# quarkus/addons/jobs/messaging/runtime/src/main/resources/META-INF/kogito.addon
kogito.addon
# quarkus/addons/knative/eventing/runtime/src/main/resources/META-INF/kogito.addon
kogito.addon
# quarkus/addons/knative/serving/runtime/src/main/resources/META-INF/kogito.addon
kogito.addon
# quarkus/addons/kubernetes/runtime/src/main/resources/META-INF/kogito.addon
kogito.addon
# quarkus/addons/mail/runtime/src/main/resources/META-INF/kogito.addon
kogito.addon
# quarkus/addons/messaging/common/src/main/resources/META-INF/kogito.addon
kogito.addon
# quarkus/addons/messaging/runtime/src/main/resources/META-INF/kogito.addon
kogito.addon
# quarkus/addons/microprofile-config-service-catalog/runtime/src/main/resources/META-INF/kogito.addon
kogito.addon
# quarkus/addons/monitoring/core/src/main/resources/META-INF/kogito.addon
kogito.addon
# quarkus/addons/monitoring/elastic/runtime/src/main/resources/META-INF/kogito.addon
kogito.addon
# quarkus/addons/monitoring/prometheus/runtime/src/main/resources/META-INF/kogito.addon
kogito.addon
# quarkus/addons/persistence/kafka/runtime/src/main/resources/META-INF/kogito.addon
kogito.addon
# quarkus/addons/process-definitions/runtime/src/main/resources/META-INF/kogito.addon
kogito.addon
# quarkus/addons/process-management/runtime/src/main/resources/META-INF/kogito.addon
kogito.addon
# quarkus/addons/process-svg/runtime/src/main/resources/META-INF/kogito.addon
kogito.addon
# quarkus/addons/python/integration-tests/requirements.txt
requirements.txt
# quarkus/addons/source-files/runtime/src/main/resources/META-INF/kogito.addon
kogito.addon
# quarkus/addons/task-management/runtime/src/main/resources/META-INF/kogito.addon
kogito.addon
# quarkus/addons/task-notification/runtime/src/main/resources/META-INF/kogito.addon
kogito.addon
# quarkus/addons/tracing-decision/runtime/src/main/resources/META-INF/kogito.addon
kogito.addon
# quarkus/extensions/kogito-quarkus-decisions-extension/kogito-quarkus-decisions-integration-test-hot-reload/src/test/resources/TrafficViolation.txt
TrafficViolation.txt
# quarkus/extensions/kogito-quarkus-decisions-extension/kogito-quarkus-decisions-integration-test-hot-reload/src/test/resources/adult.txt
adult.txt
# quarkus/extensions/kogito-quarkus-rules-extension/kogito-quarkus-rules-integration-test-hot-reload/src/test/resources/adult.txt
adult.txt
# quarkus/extensions/kogito-quarkus-rules-extension/kogito-quarkus-rules-integration-test-hot-reload/src/test/resources/drl1.txt
drl1.txt
# quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow-integration-test/src/test/resources/__snapshots__/ServerlessWorkflowCodestartTest/testContent/src_test_resources_application.yml
src_test_resources_application.yml
# quarkus/integration-tests/integration-tests-quarkus-rules/src/test/resources/LoanUnit.xls.properties.test
LoanUnit.xls.properties.test
# springboot/addons/events/decisions/src/main/resources/META-INF/kogito.addon
kogito.addon
# springboot/addons/events/predictions/src/main/resources/META-INF/kogito.addon
kogito.addon
# springboot/addons/explainability/src/main/resources/META-INF/kogito.addon
kogito.addon
# springboot/addons/jobs/src/main/resources/META-INF/kogito.addon
kogito.addon
# springboot/addons/kubernetes/src/main/resources/META-INF/kogito.addon
kogito.addon
# springboot/addons/mail/src/main/resources/META-INF/kogito.addon
kogito.addon
# springboot/addons/messaging/implementation/src/main/resources/META-INF/kogito.addon
kogito.addon
# springboot/addons/monitoring/core/src/main/resources/META-INF/kogito.addon
kogito.addon
# springboot/addons/monitoring/elastic/src/main/resources/META-INF/kogito.addon
kogito.addon
# springboot/addons/monitoring/prometheus/src/main/resources/META-INF/kogito.addon
kogito.addon
# springboot/addons/process-management/src/main/resources/META-INF/kogito.addon
kogito.addon
# springboot/addons/process-svg/src/main/resources/META-INF/kogito.addon
kogito.addon
# springboot/addons/task-management/src/main/resources/META-INF/kogito.addon
kogito.addon
# springboot/addons/task-notification/src/main/resources/META-INF/kogito.addon
kogito.addon
# springboot/addons/tracing-decision/src/main/resources/META-INF/kogito.addon
kogito.addon
# springboot/archetype/src/test/resources/projects/it-basic/goal.txt
goal.txt
# springboot/archetype/src/test/resources/projects/it-custom-decisions/goal.txt
goal.txt
# springboot/archetype/src/test/resources/projects/it-custom-process/goal.txt
goal.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
~ specific language governing permissions and limitations
~ under the License.
-->

<definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:tns="http://www.jboss.org/drools" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd" id="Definition" expressionLanguage="http://www.mvel.org/2.0" typeLanguage="http://www.java.com/javaTypes">
<itemDefinition id="_xItem" structureRef="String" />
<process id="BoundarySignalEventOnTaskWithTransformation" tns:packageName="org.jbpm.bpmn2.activity" name="BoundarySignalOnTask" isExecutable="true" processType="Private">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
~ specific language governing permissions and limitations
~ under the License.
-->

<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:bpsim="http://www.bpsim.org/schemas/1.0" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:drools="http://www.jboss.org/drools" id="_4D6UQA-DED2fZdcCquQDuw" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd http://www.jboss.org/drools drools.xsd http://www.bpsim.org/schemas/1.0 bpsim.xsd http://www.omg.org/spec/DD/20100524/DC DC.xsd http://www.omg.org/spec/DD/20100524/DI DI.xsd " exporter="jBPM Process Modeler" exporterVersion="2.0" targetNamespace="http://www.omg.org/bpmn20">
<bpmn2:itemDefinition id="_dataItem" structureRef="String"/>
<bpmn2:itemDefinition id="_enddataItem" structureRef="String"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
~ specific language governing permissions and limitations
~ under the License.
-->

<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:bpsim="http://www.bpsim.org/schemas/1.0" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:drools="http://www.jboss.org/drools" id="_ioNE0A98ED2kMdINZFf-yQ" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd http://www.jboss.org/drools drools.xsd http://www.bpsim.org/schemas/1.0 bpsim.xsd http://www.omg.org/spec/DD/20100524/DC DC.xsd http://www.omg.org/spec/DD/20100524/DI DI.xsd " exporter="jBPM Process Modeler" exporterVersion="2.0" targetNamespace="http://www.omg.org/bpmn20">
<bpmn2:itemDefinition id="_dataItem" structureRef="String"/>
<bpmn2:itemDefinition id="__A4C8228C-1359-4663-A82B-4AA1C98C3871_dataOutputXItem" structureRef="String"/>
Expand Down
26 changes: 0 additions & 26 deletions kogito-build/kogito-build-no-bom-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,28 +45,6 @@
-->
<properties>
<checkstyle.failOnViolation>false</checkstyle.failOnViolation>
<checkstyle.header.template><![CDATA[
^\/\*$\n^
\* Licensed to the Apache Software Foundation \(ASF\) under one$\n^
\* or more contributor license agreements\. See the NOTICE file$\n^
\* distributed with this work for additional information$\n^
\* regarding copyright ownership\. The ASF licenses this file$\n^
\* to you under the Apache License, Version 2\.0 \(the$\n^
\* &quot;License&quot;\); you may not use this file except in compliance$\n^
\* with the License\. You may obtain a copy of the License at$\n^
\*$\n^
\* http:\/\/www\.apache\.org\/licenses\/LICENSE-2\.0$\n^
\*$\n^
\* Unless required by applicable law or agreed to in writing,$\n^
\* software distributed under the License is distributed on an$\n^
\* &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY$\n^
\* KIND, either express or implied\. See the License for the$\n^
\* specific language governing permissions and limitations$\n^
\* under the License\.$\n^
\*\/$
]]>
</checkstyle.header.template>
<checkstyle.header.extensions>java,groovy</checkstyle.header.extensions>
<checkstyle.logViolationsToConsole>true</checkstyle.logViolationsToConsole>

<!-- container images for testing -->
Expand Down Expand Up @@ -190,10 +168,6 @@
<configuration>
<checkstyleRules>
<module name="Checker">
<module name="RegexpHeader">
<property name="header" value="${checkstyle.header.template}"/>
<property name="fileExtensions" value="${checkstyle.header.extensions}"/>
</module>
<module name="TreeWalker">
<module name="RegexpSinglelineJava">
<property name="format" value="@author"/>
Expand Down
30 changes: 0 additions & 30 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.outputTimestamp>2024-07-16T20:52:10Z</project.build.outputTimestamp>
<version.maven.artifact.plugin>3.4.1</version.maven.artifact.plugin>
<version.apache-rat-plugin>0.16.1</version.apache-rat-plugin>
<version.maven-javadoc-plugin>3.6.2</version.maven-javadoc-plugin>
</properties>

Expand All @@ -115,35 +114,6 @@
<outputTimestamp>${project.build.outputTimestamp}</outputTimestamp>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
<version>${version.apache-rat-plugin}</version>
<configuration>
<excludes>
<exclude>.mvn/maven.config</exclude>
<exclude>**/simple_invalid_migration.invalid</exclude>
<exclude>**/*.mpf</exclude>
<exclude>**/src/test/**/*.txt</exclude>
<exclude>**/.gitkeep</exclude>
<exclude>**/checkstyle-cachefile</exclude>
<exclude>**/*.log</exclude>
<exclude>**/*.lst</exclude>
<exclude>**/requirements.txt</exclude>
<exclude>**/*.addon</exclude>
<exclude>**/*.avsc</exclude>
<exclude>**/LoanUnit.xls.properties.test</exclude>
<exclude>**/src_test_resources_application.yml</exclude>
<exclude>**/BPMN*.xsd</exclude>
<exclude>**/bpsim.xsd</exclude>
<exclude>**/DC.xsd</exclude>
<exclude>**/DI.xsd</exclude>
<exclude>**/DiagramDefinition.xsd</exclude>
<exclude>**/DiagramInterchange.xsd</exclude>
<exclude>**/Semantic.xsd</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
# under the License.
#

quarkus.native.auto-service-loader-registration=true
quarkus.native.auto-service-loader-registration=true

0 comments on commit f3951d1

Please sign in to comment.