Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions dev-support/rat/rat-exclusions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
###### 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.

.github/*
CONTRIBUTING.md
README.md
SECURITY.md
.gitattributes
src/main/resources/proto.lock
**/output.xml
**/log.html
**/report.html
**/.ssh/id_rsa*
src/test/resources/*.log
src/test/resources/ssl/*
**/dependency-reduced-pom.xml
**/pnpm-lock.yaml
src/test/resources/prometheus-test-response.txt
src/main/license/**
src/main/resources/proto.lock
src/test/resources/test.db.ini
tools/fault-injection-service/README.md
**/webapps/static/angular-nvd3-1.0.9.min.js
**/webapps/static/angular-route-1.8.0.min.js
**/webapps/static/bootstrap-3.4.1/**
**/webapps/static/d3-3.5.17.min.js
**/webapps/static/jquery-3.5.1.min.js
**/webapps/static/nvd3-1.8.5.min.css.map
**/webapps/static/nvd3-1.8.5.min.css
**/webapps/static/nvd3-1.8.5.min.js.map
**/webapps/static/nvd3-1.8.5.min.js
**/webapps/static/angular-1.8.0.min.js
src/test/resources/additionalfields.container
src/test/resources/incorrect.checksum.container
src/test/resources/incorrect.container
src/test/resources/test.db.ini
src/test/resources/123-dn-container.db/**
src/test/resources/123.container
static/slides/*
**/themes/ozonedoc/**
**/*.json
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be nice to sort these.

To make the script useful for local run by devs, we should also exclude:

dev-support/ci/bats-assert/**
dev-support/ci/bats-support/**
.dev-tools/**

(Would be useful if we could exclude everything in .gitignore by default...)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Would be useful if we could exclude everything in .gitignore by default...

As it's in the root folder now, it behaves exactly as you suggested.( parseSCMIgnoresAsExcludes is enabled by default https://creadur.apache.org/rat/apache-rat-plugin/check-mojo.html)

Copy link
Contributor

@adoroszlai adoroszlai Mar 12, 2024

Choose a reason for hiding this comment

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

Thanks @myskov for the info and updating the patch.

It seems Rat 0.13 does not use .gitignore correctly, the check fails due to the items I suggested (when not included in rat-exclusions.txt). Upgrading to latest Rat 0.16.1 solves false positive for those.

The only item it still reports is .hugo_build.lock. The problem seems to be that it looks for .gitignore only in the module directory tree:

[INFO] --- apache-rat-plugin:0.16.1:check (default-cli) @ hdds-docs ---
...
[DEBUG] Recursively loading .gitignore files in hadoop-hdds/docs

So I suggest:

  1. upgrade to 0.16.1 (adoroszlai@301b56b)
  2. split some items from .gitignore to module-level files (adoroszlai@82f0a4b)

BTW, steps that create the files reported by Rat as false positives:

  • build docs: mvn -pl :hdds-docs clean package (for .hugo_build.lock)
  • run bats check: hadoop-ozone/dev-support/checks/bats.sh (for dev-support/ci/bats-*)

24 changes: 0 additions & 24 deletions hadoop-hdds/docs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,30 +51,6 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
<configuration>
<excludes>
<exclude>static/slides/*</exclude>
<exclude>themes/ozonedoc/static/js/bootstrap.min.js</exclude>
<exclude>themes/ozonedoc/static/js/jquery-3.5.1.min.js</exclude>
<exclude>themes/ozonedoc/static/js/swagger-ui-bundle.js</exclude>
<exclude>themes/ozonedoc/static/css/bootstrap-theme.min.css
</exclude>
<exclude>themes/ozonedoc/static/css/bootstrap.min.css.map</exclude>
<exclude>themes/ozonedoc/static/css/bootstrap.min.css</exclude>
<exclude>themes/ozonedoc/static/css/bootstrap-theme.min.css.map
</exclude>
<exclude>themes/ozonedoc/static/css/swagger-ui.css</exclude>
<exclude>
themes/ozonedoc/static/fonts/glyphicons-halflings-regular.svg
</exclude>
<exclude>themes/ozonedoc/layouts/index.html</exclude>
<exclude>themes/ozonedoc/theme.toml</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>
39 changes: 0 additions & 39 deletions hadoop-hdds/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -234,45 +234,6 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
</execution>
</executions>
</plugin>
<plugin>

<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/*.json</exclude>
<exclude>**/hs_err*.log</exclude>
<exclude>**/.attach_*</exclude>
<exclude>**/**.rej</exclude>
<exclude>**/.factorypath</exclude>
<exclude>public</exclude>
<exclude>**/*.iml</exclude>
<exclude>**/target/**</exclude>
<exclude>**/output.xml</exclude>
<exclude>**/log.html</exclude>
<exclude>**/report.html</exclude>
<exclude>.gitattributes</exclude>
<exclude>.idea/**</exclude>
<exclude>src/main/resources/webapps/static/angular-1.8.0.min.js</exclude>
<exclude>src/main/resources/webapps/static/angular-nvd3-1.0.9.min.js</exclude>
<exclude>src/main/resources/webapps/static/angular-route-1.8.0.min.js</exclude>
<exclude>src/main/resources/webapps/static/d3-3.5.17.min.js</exclude>
<exclude>src/main/resources/webapps/static/nvd3-1.8.5.min.css.map</exclude>
<exclude>src/main/resources/webapps/static/nvd3-1.8.5.min.css</exclude>
<exclude>src/main/resources/webapps/static/nvd3-1.8.5.min.js.map</exclude>
<exclude>src/main/resources/webapps/static/nvd3-1.8.5.min.js</exclude>
<exclude>src/main/resources/webapps/static/jquery-3.5.1.min.js</exclude>
<exclude>src/main/resources/webapps/static/bootstrap-3.4.1/**</exclude>
<exclude>src/test/resources/additionalfields.container</exclude>
<exclude>src/test/resources/incorrect.checksum.container</exclude>
<exclude>src/test/resources/incorrect.container</exclude>
<exclude>src/test/resources/test.db.ini</exclude>
<exclude>src/test/resources/123-dn-container.db/**</exclude>
<exclude>src/test/resources/123.container</exclude>
<exclude>src/main/resources/proto.lock</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
Expand Down
8 changes: 1 addition & 7 deletions hadoop-ozone/dev-support/checks/rat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,7 @@ mkdir -p "$REPORT_DIR"

REPORT_FILE="$REPORT_DIR/summary.txt"

dirs="hadoop-hdds hadoop-ozone"

for d in $dirs; do
pushd "$d" || exit 1
mvn -B --no-transfer-progress -fn org.apache.rat:apache-rat-plugin:0.13:check
popd
done
mvn -B --no-transfer-progress -fn org.apache.rat:apache-rat-plugin:0.13:check

grep -r --include=rat.txt "!????" $dirs | tee "$REPORT_FILE"

Expand Down
4 changes: 0 additions & 4 deletions hadoop-ozone/httpfsgateway/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
Expand Down
60 changes: 0 additions & 60 deletions hadoop-ozone/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -305,66 +305,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/*.json</exclude>
<exclude>**/hs_err*.log</exclude>
<exclude>**/target/**</exclude>
<exclude>.gitattributes</exclude>
<exclude>**/.attach_*</exclude>
<exclude>**/**.rej</exclude>
<exclude>**/.factorypath</exclude>
<exclude>public</exclude>
<exclude>**/*.iml</exclude>
<exclude>**/output.xml</exclude>
<exclude>**/log.html</exclude>
<exclude>**/report.html</exclude>
<exclude>**/.idea/**</exclude>
<exclude>**/.ssh/id_rsa*</exclude>
<exclude>dev-support/*tests</exclude>
<exclude>dev-support/checkstyle*</exclude>
<exclude>dev-support/jdiff/**</exclude>
<exclude>src/contrib/**</exclude>
<exclude>src/main/webapps/datanode/robots.txt</exclude>
<exclude>src/main/webapps/hdfs/robots.txt</exclude>
<exclude>src/main/webapps/journal/robots.txt</exclude>
<exclude>src/main/webapps/router/robots.txt</exclude>
<exclude>src/main/webapps/secondary/robots.txt</exclude>
<exclude>src/site/resources/images/*</exclude>
<exclude>src/test/all-tests</exclude>
<exclude>src/test/empty-file</exclude>
<exclude>src/test/resources/*.log</exclude>
<exclude>src/test/resources/*.tgz</exclude>
<exclude>src/test/resources/data*</exclude>
<exclude>src/test/resources/empty-file</exclude>
<exclude>src/test/resources/ssl/*</exclude>
<exclude>src/main/compose/ozonesecure/docker-image/runner/build/apache-rat-0.12/README-CLI.txt</exclude>
<exclude>src/main/compose/ozonesecure/docker-image/runner/build/apache-rat-0.12/README-ANT.txt</exclude>
<exclude>webapps/static/angular-1.8.0.min.js</exclude>
<exclude>webapps/static/angular-nvd3-1.0.9.min.js</exclude>
<exclude>webapps/static/angular-route-1.8.0.min.js</exclude>
<exclude>webapps/static/bootstrap-3.4.1/**</exclude>
<exclude>webapps/static/d3-3.5.17.min.js</exclude>
<exclude>webapps/static/jquery-3.5.1.min.js</exclude>
<exclude>webapps/static/jquery.dataTables.min.js</exclude>
<exclude>webapps/static/nvd3-1.8.5.min.css.map</exclude>
<exclude>webapps/static/nvd3-1.8.5.min.css</exclude>
<exclude>webapps/static/nvd3-1.8.5.min.js.map</exclude>
<exclude>webapps/static/nvd3-1.8.5.min.js</exclude>
<exclude>**/dependency-reduced-pom.xml</exclude>
<exclude>**/node_modules/**</exclude>
<exclude>**/yarn.lock</exclude>
<exclude>**/pnpm-lock.yaml</exclude>
<exclude>**/ozone-recon-web/build/**</exclude>
<exclude>src/test/resources/prometheus-test-response.txt</exclude>
<exclude>src/main/license/**</exclude>
<exclude>src/main/resources/proto.lock</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
Expand Down
7 changes: 7 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2105,6 +2105,13 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
<configuration>
<excludesFile>dev-support/rat/rat-exclusions.txt</excludesFile>
</configuration>
</plugin>
</plugins>
</build>

Expand Down