Repository navigation
fix(code-review): stop reading the ASF header as a third-party copyright - #1777
Merged
Merged
Conversation
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)
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.
Summary
third_party_licencesintools/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_COPYRIGHTpattern matched the word "copyright" anywhere, so the ASF header's own# regarding copyright ownership. The ASF licenses this filecounted as a foreign notice.SPDX-License-Identifier: Apache-2.0line 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.)#,//,/*,*,;,<!--, quotes), optionally prefixed byPortions.Type of change
tools/*/withpyproject.toml)Test plan
prek run --all-files --skip workspace-pytestandprek run workspace-pytest --from-ref upstream/main --to-ref HEADpasstools/pr-managementpytest suite passes, including two new cases:test_licence_case_7_asf_header_with_spdx_is_not_third_party: SPDX line plus the ASF header gives no finding (failed before the fix)test_licence_case_8_third_party_apache_file_is_still_flagged: an Apache-2.0 file with a non-ASFCopyrightline is still reportedLinked issues
Refs #1755
Generative AI disclosure: drafted with Claude Code (Opus 5.5), reviewed by the author before submission.
🤖 Generated with Claude Code