Skip to content

Align Apache RAT configuration with the ATR license check#502

Open
ppkarwasz wants to merge 1 commit into
mainfrom
feat/main/align-rat-with-atr
Open

Align Apache RAT configuration with the ATR license check#502
ppkarwasz wants to merge 1 commit into
mainfrom
feat/main/align-rat-with-atr

Conversation

@ppkarwasz

Copy link
Copy Markdown
Member

Motivation

During a release, the ASF Trusted Releases platform (ATR) re-checks the source archive with the Apache RAT CLI (see atr/tasks/checks/rat.py). ATR never reads the Maven POM: the only exclusion mechanisms it honors are its own predefined exclusions and a .rat-excludes file found in the archive. Any exclusion that lives only in the POM therefore hides a failure locally that ATR will later report against the release candidate.

This PR makes the local apache-rat-plugin check behave like the ATR check, so a build passing verify also passes ATR.

Changes

  • Update apache-rat-plugin from 0.16.1 (managed by org.apache:apache) to 0.18.
  • The POM configuration now contains only what ATR itself always applies:
    • the MISC, HIDDEN_DIR and MAC standard exclusion collections,
    • the generated-file patterns (*.min.js, *.css.map, etc. from GENERATED_FILE_SUFFIXES in atr/constants.py),
    • the LICENSE_CATEGORIES:0, LICENSE_NAMES:0 and STANDARDS:0 counter minimums.
  • Two file-activated profiles reproduce ATR's two code paths, keyed on ${maven.multiModuleProjectDirectory}/.rat-excludes:
    • apache-rat-std-excludes (file absent): additionally applies the MAVEN, ECLIPSE, IDEA, GIT and STANDARD_SCMS collections, as ATR does for archives without a .rat-excludes file;
    • apache-rat-excludes-file (file present): passes the file to RAT via inputExcludeFile, and the SCM/IDE collections are not applied, as in ATR.
  • All project-specific exclusions need to be removed from the POM and moved to a new .rat-excludes file.

Impact on downstream projects

Projects inheriting from logging-parent no longer inherit POM-level RAT excludes beyond the ATR-predefined ones. Each project must provide its own .rat-excludes at its repository root. This is intentional: those exclusions were invisible to ATR anyway, and the file makes them effective both locally and during the ATR release check.

Bump `apache-rat-plugin` to `0.18` (requires Java 17) and configure it to
mirror the RAT invocation of the ASF Trusted Releases platform, see
`atr/tasks/checks/rat.py` in `apache/tooling-trusted-releases`:

- The POM only contains the exclusions that ATR itself applies: the
  `MISC`, `HIDDEN_DIR` and `MAC` standard collections, the generated
  file patterns and the counter minimums.
- The SCM and IDE standard collections are applied by the new
  `apache-rat-std-excludes` profile, only when the build root contains
  no `.rat-excludes` file, matching ATR's behavior.
- When `.rat-excludes` is present, the new `apache-rat-excludes-file`
  profile passes it to RAT instead, like ATR does.
- Project-specific exclusions move from the POM, which ATR never reads,
  to a new `.rat-excludes` file at the build root.

Assisted-By: Claude Fable 5 <noreply@anthropic.com>
@ppkarwasz

Copy link
Copy Markdown
Member Author

The windows build requires #504.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant