apache / incubator-kie-issues

Apache License 2.0
12 stars 1 forks source link

Add .rat-excludes file to each repository #1613

Open tkobayas opened 2 weeks ago

tkobayas commented 2 weeks ago

In order to check All files have license headers if necessary. https://kie.apache.org/docs/community/verify/ , add .rat-excludes to the root directory of each repository.

For example, running

java -jar apache-rat-0.16.1.jar -d ./incubator-kie-drools/ -E ./incubator-kie-drools/.rat-excludes | grep "== File:" > kie-drools-rat.txt

can easily confirm license headers.

Each repository committers should add ignorable file names/paths in .rat-excludes.

Note:

jomarko commented 1 week ago

Thank you @tkobayas, I have something similar in my head longer time. What I see as we should do as part of this ticket is to unify the approach. Because there were already some initiatives to have licenses checks.

apache-rat-plugin

Used for example in kogito-runtimes https://github.com/apache/incubator-kie-kogito-runtimes/blob/main/pom.xml

        <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>

checkstyle.header.template

Used in a lot of our maven projects

    <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>

I think we should avoid the situation we have in parallel use of:

I think we should use just one of the above, while the last seems to me as best candidate as it is not bind to maven projects. What is your opinion?

tkobayas commented 1 week ago

Hi @jomarko

I think we should use just one of the above, while the last seems to me as best candidate as it is not bind to maven projects. What is your opinion?

Yeah, +1 for apache-rat java cli tool.

Indeed, I merged https://github.com/apache/incubator-kie-drools/pull/6149 with removing apache-rat-plugin. I think @baldimir has the same opinion, but it's good to discuss it in dev at kie.apache ML. I'll send an email very soon.

Also thanks for mentioning that checkstyle.header.template can be removed as well.

LightGuard commented 1 week ago

Also a +1 from me about using the CLI tool.

jomarko commented 6 days ago

FYI, "kogito-images" will be not updated with "CI :: Check license headers" workflow, see the explanation here https://github.com/apache/incubator-kie-kogito-images/pull/1811#issuecomment-2489695430.