Skip to content

fix(code-review): stop reading the ASF header as a third-party copyright - #1777

Merged
potiuk merged 1 commit into
apache:mainfrom
potiuk:fix/licence-scan-asf-header
Oct 24, 2026
Merged

potiuk merged 1 commit into
apache:mainfrom
potiuk:fix/licence-scan-asf-header

Conversation

@potiuk

@potiuk potiuk commented Oct 24, 2026

Copy link
Copy Markdown
Member

Summary

  • The code-review licence scan (third_party_licences in tools/pr-management/src/pr_management/code_review/scans.py) treats a new file as third-party when its first lines carry a copyright notice naming someone other than the ASF. Its _COPYRIGHT pattern matched the word "copyright" anywhere, so the ASF header's own # regarding copyright ownership. The ASF licenses this file counted as a foreign notice.
  • Every new file carrying both an SPDX-License-Identifier: Apache-2.0 line and the full ASF header was therefore reported as Category A third-party code with "LICENSE / LICENSE.txt was not updated". On feat(tools/discourse): add a read-only Discourse topic bridge #1755 that was six false findings, one per new file. (Files with the ASF header but no SPDX line escaped only because no licence was detected for them at all.)
  • A copyright notice now has to open its line, after any comment markers (#, //, /*, *, ;, <!--, quotes), optionally prefixed by Portions.

Type of change

  • Python package (tools/*/ with pyproject.toml)

Test plan

Linked issues

Refs #1755


Generative AI disclosure: drafted with Claude Code (Opus 5.5), reviewed by the author before submission.

🤖 Generated with Claude Code

The licence scan treats a file as third-party when its head has a copyright
line naming someone other than the ASF. The pattern matched "copyright"
anywhere, so the ASF header's own "regarding copyright ownership" counted as
a foreign notice, and every new file carrying both an
`SPDX-License-Identifier: Apache-2.0` line and the full ASF header was
reported as Category A third-party code with LICENSE not updated. A notice
now has to open its line, after any comment markers.

Generated-by: Claude Code (Opus 5.5)
@github-actions github-actions Bot added family:tools tools/* substrate:analytics Tool substrate: read-only metrics / dashboards / renderers labels Oct 24, 2026
@potiuk
potiuk merged commit 9d241df into apache:main Oct 24, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

family:tools tools/* substrate:analytics Tool substrate: read-only metrics / dashboards / renderers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant