ci(license): add license header check for .rs files - #20
Conversation
Pull request was converted to draft
5b79555 to
e2fced0
Compare
|
License check works as expected. See https://github.com/network-analytics/NetCalyx/actions/runs/30550515470/job/90897767302?pr=20. |
225a336 to
e2fced0
Compare
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.
e2fced0 to
136b1db
Compare
|
Retested after review. Works as expected: https://github.com/network-analytics/NetCalyx/actions/runs/30554296689/job/90910745785?pr=20 |
1af69c9 to
136b1db
Compare
136b1db to
7fe4f58
Compare
ustorbeck
left a comment
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.
7fe4f58 to
d454fba
Compare
No description provided.