ci(license): add license header check for .rs files - #20
Open
riccardo-negri wants to merge 1 commit into
Open
Conversation
riccardo-negri
enabled auto-merge (rebase)
July 30, 2026 13:53
riccardo-negri
marked this pull request as draft
July 30, 2026 14:00
auto-merge was automatically disabled
July 30, 2026 14:00
Pull request was converted to draft
riccardo-negri
force-pushed
the
add-license-check
branch
from
July 30, 2026 14:08
5b79555 to
e2fced0
Compare
Member
Author
|
License check works as expected. See https://github.com/network-analytics/NetCalyx/actions/runs/30550515470/job/90897767302?pr=20. |
riccardo-negri
force-pushed
the
add-license-check
branch
from
July 30, 2026 14:13
225a336 to
e2fced0
Compare
riccardo-negri
marked this pull request as ready for review
July 30, 2026 14:13
riccardo-negri
enabled auto-merge (rebase)
July 30, 2026 14:14
There was a problem hiding this comment.
Pull request overview
Adds a CI guardrail to enforce Apache 2.0 license headers on Rust files touched in pull requests, with additional rules around preserving legacy NetGauze attribution when present.
Changes:
- Introduces a new
licensejob in CI to run only onpull_requestevents and validate headers on changed*.rsfiles. - Adds
.github/scripts/check_license.pyto validate the required header format and ensure NetGauze attribution lines aren’t removed when they existed in the base ref.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
.github/workflows/ci.yml |
Adds a PR-only job that identifies changed Rust files and runs the license checker. |
.github/scripts/check_license.py |
Implements header validation and base-ref comparison logic for NetGauze attribution preservation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
riccardo-negri
force-pushed
the
add-license-check
branch
from
July 30, 2026 14:53
e2fced0 to
136b1db
Compare
Member
Author
|
Retested after review. Works as expected: https://github.com/network-analytics/NetCalyx/actions/runs/30554296689/job/90910745785?pr=20 |
riccardo-negri
force-pushed
the
add-license-check
branch
from
July 30, 2026 15:01
1af69c9 to
136b1db
Compare
rodonile
previously approved these changes
Jul 30, 2026
rodonile
force-pushed
the
add-license-check
branch
from
July 31, 2026 07:06
136b1db to
7fe4f58
Compare
ustorbeck
requested changes
Jul 31, 2026
ustorbeck
left a comment
Member
There was a problem hiding this comment.
- When a file is renamed or copied and substantially rewritten git will detect it as a new file and the license check will fail with "new file must not have a NetGauze Authors copyright line" which it should not. Either reduce the similarity threshold for git or maybe drop the check for the NetGauze header in new files.
- The script uses git porcelain commands (git show, git diff) where the output format is not guaranteed to be stable. Better use git plumbing commands like git cat-file instead.
riccardo-negri
force-pushed
the
add-license-check
branch
from
July 31, 2026 13:13
7fe4f58 to
d454fba
Compare
rodonile
approved these changes
Jul 31, 2026
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.
No description provided.