Repository navigation
Check license headers with Apache RAT in the build - #1732
Merged
Merged
Conversation
Wicket checked license headers only with its own ApacheLicenseHeaderTestCase, one test per module, each with its own ignore lists and each covering only its module's directory. Files outside the modules, the user guide, markdown, YAML, service files and anything outside the file types the test knows were never checked. Apache RAT, run over the source tree, reported 1470 files without an approved license. The Apache Trusted Releases platform runs RAT 0.18 on every source archive and reads its exclusions from a .rat-excludes file at the archive root. Unapproved files are recorded as concerns the release manager has to acknowledge before a vote can start. The root pom now runs apache-rat-plugin 0.18 over the whole tree at validate, reading the same .rat-excludes. Files that can carry a header now have one: the markdown files, .asf.yaml, the service files, the user guide, a few XML and text files and two Java files that lacked it. The exclusions record the files that stay without one and why: third-party code, which LICENSE covers, generated release notes, IDE settings, the archetype's project templates, markup rendered to the browser as is, example markup (as the examples' header test already decided) and test data that tests compare byte for byte. These follow the ignore lists of the existing header tests. Locally the check also skips what Git ignores, node and node_modules, and minified files. It takes about half a minute, so -Pfast skips it. A file without a header that is neither committed nor ignored by Git, such as a local note, now fails the build until it gets a header or is removed. GitHub issue #1723 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1732 +/- ##
============================================
- Coverage 63.17% 63.17% -0.01%
+ Complexity 11558 11556 -2
============================================
Files 1253 1253
Lines 48635 48635
Branches 6844 6844
============================================
- Hits 30725 30723 -2
- Misses 15192 15193 +1
- Partials 2718 2719 +1 🚀 New features to boost your workflow:
|
papegaaij
marked this pull request as ready for review
October 31, 2026 08:31
dashorst
approved these changes
Nov 1, 2026
dashorst
left a comment
Contributor
There was a problem hiding this comment.
Looks good. I ran RAT on the head, and again merged with current master: zero unapproved files both times, and a stray headerless file fails validate with its name in the output.
One non-blocking suggestion: the pom excludes a few things locally that the ATR does not, which makes the local check more lenient than the one that matters at release time.
**/*.min.js,**/*.min.css,**/node/**and**/node_modules/**currently exclude nothing extra: all tracked minified files are already covered by.rat-excludes, andnode/node_modulesare git-ignored. What they would do is let a future minified file pass locally while the ATR flags it. I'd drop these four and keep only what a working tree needs (the Git ignore parsing and the standard excludes fortargetand the like)..github/workflows/maven.ymlhas no license header; it only passes becauseHIDDEN_DIRskips it locally.dependabot.ymlandcheck-coverage-report.pynext to it do have one. Adding a header there removes the dependency onHIDDEN_DIRlining up with what the ATR scans.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #1723. Independent of #1731; together they leave Apache RAT with nothing to report.
The Apache Trusted Releases platform (ATR) runs Apache RAT 0.18 on every source archive. Every unapproved file becomes a concern the release manager has to acknowledge before a vote. On master, RAT run with the ATR's arguments flags 1470 files. This PR brings that to zero and keeps it there.
What changes
.rat-excludesat the root. This is the file the ATR reads. It lists the files that stay without a header, grouped by reason:LICENSEcoversThe groups follow the ignore lists of the existing
ApacheLicenceHeaderTests.Headers added to the files that can carry one:
.asf.yamlMETA-INF/servicesfiles.adocfiles (in////comments, which don't render)Root pom runs
apache-rat-plugin0.18 atvalidate, over the whole tree, reading the same.rat-excludes.node/node_modules, and minified files.-Pfastskips it.Worth knowing
release:performbuilds from a clean checkout of the tag, so this check runs on exactly what goes into the archive..rat-excludespresent, it drops its own Git/Maven/IDE default exclusions, which is why.gitignoreandMANIFEST.MFare listed explicitly.Verification
mvn clean verify -Pjs-testpasses.git archivereports 0 unapproved files. That holds for this branch alone and merged with List bundled third-party code in LICENSE and keep NOTICE to required notices #1731.-Pguide), with no header text in the HTML or DocBook output.🤖 Generated with Claude Code