Skip to content

Replace the blanket RAT globs with targeted exclusions - #2039

Open
tuhaihe wants to merge 1 commit into
apache:mainfrom
tuhaihe:rat-drop-dead-exclusions
Open

tuhaihe wants to merge 1 commit into
apache:mainfrom
tuhaihe:rat-drop-dead-exclusions

Conversation

@tuhaihe

@tuhaihe tuhaihe commented Sep 22, 2026

Copy link
Copy Markdown
Member

The RAT config excused five whole file types from the licence scan, so a clean run said nothing about them. Justin Mclean raised this during the 2.2.0-rc1 IPMC vote.

**/*.gif and **/*.json match nothing that fails, so they just go.

**/*.md, **/*.sql and **/*.out do hide real gaps: dropping them reports 1088 unapproved files. Almost all are inherited sources that must not be given an ASF header, so they are named instead. For markdown that is README files, orafce's docs, ORCA's design notes and the PR template; for SQL and regression output it is 77 directories plus four files, most of which exist verbatim in PostgreSQL REL_16_STABLE or REL_14_STABLE or sit in third-party subtrees already declared in LICENSE.

The directory patterns are scoped to .sql and .out rather than written as <dir>/**, which would also excuse the C and Perl sources beside them -- 2294 files tree-wide, a wider hole than the globs being replaced.

Project-authored files are unaffected: 36 of 75 .md and 5354 of 6386 .sql/.out already carry a header and stay in the scan. A new file outside these paths now has to carry one too.

The gpcloud exclusion gains a comment recording why it stays: those sources came from Greenplum without a header, so an ASF one must not be added.

Verified on Rocky 9 against a fresh checkout of main: mvn clean verify -Drat.consoleOutput=true gives Unapproved: 0, unknown: 0, generated: 1, approved: 5665 licenses, BUILD SUCCESS. The approved count rises from 5649 because files the globs used to skip are now checked and pass.

Assisted-by: Claude Code
Backpatch-through: REL_2_STABLE

Fixes #ISSUE_Number

What does this PR do?

Type of Change

  • Bug fix (non-breaking change)
  • New feature (non-breaking change)
  • Breaking change (fix or feature with breaking changes)
  • Documentation update

Breaking Changes

Test Plan

  • Unit tests added/updated
  • Integration tests added/updated
  • Passed make installcheck
  • Passed make -C src/test installcheck-cbdb-parallel

Impact

Performance:

User-facing changes:

Dependencies:

Checklist

Additional Context

CI Skip Instructions


@tuhaihe tuhaihe added this to the 2.2 milestone Sep 22, 2026

@leborchuk leborchuk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

The RAT config excused five whole file types from the licence scan, so a
clean run said nothing about them.  Justin Mclean raised this during the
2.2.0-rc1 IPMC vote.

- `**/*.gif` and `**/*.json` match nothing that fails, so they just go.

- `**/*.md`, `**/*.sql` and `**/*.out` do hide real gaps: dropping them reports
1088 unapproved files.  Almost all are inherited sources that must not be
given an ASF header, so they are named instead.  For markdown that is
README files, orafce's docs, ORCA's design notes and the PR template; for
SQL and regression output it is 77 directories plus four files, most of
which exist verbatim in PostgreSQL `REL_16_STABLE` or `REL_14_STABLE` or sit
in third-party subtrees already declared in LICENSE.

- The directory patterns are scoped to .sql and .out rather than written as
`<dir>/**`, which would also excuse the C and Perl sources beside them --
2294 files tree-wide, a wider hole than the globs being replaced.

- Project-authored files are unaffected: 36 of 75 .md and 5354 of 6386
`.sql/.out` already carry a header and stay in the scan.  A new file
outside these paths now has to carry one too.

- The gpcloud exclusion gains a comment recording why it stays: those
sources came from Greenplum without a header, so an ASF one must not be
added.

Verified on Rocky 9 against a fresh checkout of main:
`mvn clean verify -Drat.consoleOutput=true` gives Unapproved: 0,
unknown: 0, generated: 1, approved: 5665 licenses, BUILD SUCCESS.  The
approved count rises from 5649 because files the globs used to skip are
now checked and pass.

Assisted-by: Claude Code
Backpatch-through: REL_2_STABLE
@tuhaihe
tuhaihe force-pushed the rat-drop-dead-exclusions branch from 8be5764 to 1acc5d3 Compare September 24, 2026 02:03
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.

3 participants