ci: replace addlicense with HawkEye for license header checks#3325
Conversation
|
Thanks for the pull request. It is now waiting for review, labeled You can update that label as the review goes back and forth, with slash commands - each on its own line, in a regular PR comment (not an inline review reply):
Commands take up to ~90s to apply. If no reaction (👍 or 😕) appears on your comment, the apply step likely failed - check the repo's Actions tab for the See CONTRIBUTING.md for details. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3325 +/- ##
============================================
- Coverage 74.44% 72.26% -2.19%
Complexity 943 943
============================================
Files 1245 1245
Lines 121477 116548 -4929
Branches 97599 92882 -4717
============================================
- Hits 90439 84227 -6212
- Misses 28080 29150 +1070
- Partials 2958 3171 +213
🚀 New features to boost your workflow:
|
addlicense with HawkEye for license header checks
cc8b0e0 to
28e84b9
Compare
|
Unrelated fixes included in this PR:
The current license header validation is overly strict. In some cases, a file already contains a valid license header using one comment style, but the checker still reports the file as missing a license header. As a result, running To prevent this issue, duplicate license header check has been added to the license header validation script. cc @hubcio /ready |
|
@Standing-Man i was thinking about this:
perhaps this is good issue to raise in hawkeye repository? |
hubcio
left a comment
There was a problem hiding this comment.
the local pre-commit path now needs hawkeye (compiled from source via cargo install, slow the first time) and jq installed on the host. neither is mentioned in CONTRIBUTING, so a line there would save contributors a confusing first run. or perhaps can you create a Tooling section in CONTRIBUTING.md, where you'll list all tools needed for percommit hooks to pass?
263e106 to
9e688e9
Compare
3b20a23 to
1e06d8c
Compare
There was a problem hiding this comment.
a few items from re-reviewing the latest push.
on CONTRIBUTING.md (not in the diff, so noting it here): the pre-commit license-headers hook is language: system and runs license-headers.sh, which hard-fails with "hawkeye command not found" if hawkeye isn't on PATH. so every contributor now needs cargo install hawkeye --version 6.5.1 --locked locally, but the pre-commit hooks section only documents prek and typos-cli. the first commit after prek install will fail until they read the script's hint. worth adding hawkeye to the install list.
after you fix these comments below (+ this one above) i believe we can merge.
0fe9ce0 to
e2b4875
Compare
|
/ready |
Good suggestion, I’ll check the If we don’t enforce a strict one-to-one mapping between file types and comment styles, the license header check would also avoid this kind of issue. |
e2b4875 to
7c98804
Compare
|
Thank you very much for your review. This has been quite a journey. 😂 @hubcio |
|
yeah, i think its one of biggest PRs. good that you've found hawkeye, i wasn't fully happy with addlicense. good job! |
Signed-off-by: StandingMan <jmtangcs@gmail.com>
Signed-off-by: StandingMan <jmtangcs@gmail.com>
Signed-off-by: StandingMan <jmtangcs@gmail.com>
Signed-off-by: StandingMan <jmtangcs@gmail.com>
Signed-off-by: StandingMan <jmtangcs@gmail.com>
Signed-off-by: StandingMan <jmtangcs@gmail.com>
Signed-off-by: StandingMan <jmtangcs@gmail.com>
Signed-off-by: StandingMan <jmtangcs@gmail.com>
Signed-off-by: StandingMan <jmtangcs@gmail.com>
Signed-off-by: StandingMan <jmtangcs@gmail.com>
Signed-off-by: StandingMan <jmtangcs@gmail.com>
Restore the intentionally misspelled env var names used by the fuzzy matching test, and make the typos pre-commit hook respect configured excludes for explicitly passed files. Signed-off-by: StandingMan <jmtangcs@gmail.com>
Signed-off-by: StandingMan <jmtangcs@gmail.com>
Signed-off-by: StandingMan <jmtangcs@gmail.com>
Signed-off-by: StandingMan <jmtangcs@gmail.com>
Signed-off-by: StandingMan <jmtangcs@gmail.com>
91ae033 to
4825bbb
Compare
Which issue does this PR close?
Rationale
Because license header validation runs on every git commit, the current setup requires starting a Docker container each time. In addition, addlicense only provides an AMD64 Docker image, which can introduce unnecessary overhead on other architectures.
This PR replaces
addlicensewithHawkEyefor license header validation, eliminating the Docker dependency and providing a more lightweight and consistent checking experience.What changed?
This PR migrates license-header validation to
HawkEyeand standardizes ASF license headers using a centralizedlicenserc.toml.Changes
license-headercheck withscripts/ci/license-headers.shfor both local and CI usage.HawkEyethrough the official action and run the sharedlicense-headerscript.HawkEyeJSONoutput withjqforeign/php/iggy-php.stubs.phpstyle.Validation
Local Execution
Passed
Ran
AI Usage