Skip to content

Conversation

@kevinjqliu
Copy link
Contributor

@kevinjqliu kevinjqliu commented Jan 26, 2026

Upgrades RAT to version 0.17, which has new regex for exclusion expression that would allow us to exclude subdir and unblock #15144

  • Using --input-exclude-file because -E,--exclude-file is deprecated
  • Using --input-include-std HIDDEN_DIR because --scan-hidden-directories is deprecated
  • Using the new --output-style missing-headers option for output styling

Heres the new --help message, https://gist.github.com/kevinjqliu/81ebca6bf93dd941c3156dda8bd57c56

Example output

Success

https://github.com/apache/iceberg/actions/runs/21370993207/job/61515189315?pr=15145

Run dev/check-license
Attempting to fetch rat
INFO: Apache Creadur RAT 0.17 (Apache Software Foundation)
SLF4J(W): No SLF4J providers were found.
SLF4J(W): Defaulting to no-operation (NOP) logger implementation
SLF4J(W): See https://www.slf4j.org/codes.html#noProviders for further details.
Files with missing headers:
RAT checks passed.

Failure

https://github.com/apache/iceberg/actions/runs/21371129112/job/61515658994?pr=15145

Run dev/check-license
Attempting to fetch rat
INFO: Apache Creadur RAT 0.17 (Apache Software Foundation)
SLF4J(W): No SLF4J providers were found.
SLF4J(W): Defaulting to no-operation (NOP) logger implementation
SLF4J(W): See https://www.slf4j.org/codes.html#noProviders for further details.
Files with missing headers:
  /tmp
ERROR: Unexpected count for UNAPPROVED, limit is [0,0].  Count: 1
Exception in thread "main" org.apache.rat.document.RatDocumentAnalysisException: Issues with UNAPPROVED
	at org.apache.rat.Report.main(Report.java:53)
Error: Process completed with exit code 1.

Previous upgrade #9579

@github-actions github-actions bot added the INFRA label Jan 26, 2026
Copy link
Contributor Author

Choose a reason for hiding this comment

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

about the new regex syntax.
**/build/**, matches any folder name "build"
.git/**, matches top level dir name .git and excludes all its files
dev/.rat-excludes, matches this 1 file explicitly
**/LICENSE, matches any file name "LICENSE"
**/*.sql, matches any file with .sql suffix

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR upgrades the Apache RAT license-checking tool to version 0.17 and updates how license checks are invoked and configured, aiming to support newer exclusion capabilities (e.g., for subdirectories) and the missing-headers output style.

Changes:

  • Bump RAT from 0.16.1 to 0.17 and simplify dev/check-license to rely on RAT’s exit code and the --output-style missing-headers option instead of parsing text output.
  • Switch from the old -E flag to --input-exclude-file in the license check script and adjust logging behavior.
  • Rewrite dev/.rat-excludes patterns, attempting to use **-style patterns for directories and extensions (e.g., **/build/**, **/*.json).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
dev/check-license Updates RAT version to 0.17 and modernizes the invocation including exclusion file flag, output style, and logging, with direct use of the tool’s exit status.
dev/.rat-excludes Replaces previous regex-like exclusion entries with **-style path and extension patterns to control which files and directories RAT scans.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

mkdir -p build
$java_cmd -jar "$rat_jar" --scan-hidden-directories -E "$FWDIR"/dev/.rat-excludes -d "$FWDIR" > build/rat-results.txt
$java_cmd -jar "$rat_jar" \
--input-exclude-file "$FWDIR"/dev/.rat-excludes \
Copy link
Contributor

Choose a reason for hiding this comment

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

why we are not scanning hidden directories any more?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch, we should!

@kevinjqliu kevinjqliu requested a review from huaxingao January 27, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants