Skip to content

Add SPDX license header checker and missing headers - #5725

Merged
Swiddis merged 6 commits into
opensearch-project:mainfrom
shreyah963:add-spdx-license-header-checker
Nov 30, 2026
Merged

Swiddis merged 6 commits into
opensearch-project:mainfrom
shreyah963:add-spdx-license-header-checker

Conversation

@shreyah963

@shreyah963 shreyah963 commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Description

Add SPDX license header validation to PR/push workflows using @kt3k/license-checker.

Changes:

  • Add .github/workflows/license-header-checker.yml
  • Add .licenserc.json
  • Add missing SPDX-License-Identifier: Apache-2.0 headers to source files

Related Issues

#6445

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • New functionality has javadoc added.
  • New functionality has a user manual doc added.
  • New PPL command checklist all confirmed.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff or -s.
  • Public documentation issue/PR created.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@github-actions

github-actions Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

PR Code Analyzer ❗

AI-powered 'Code-Diff-Analyzer' found issues on commit 6ff86d0.

⛔ Hard block: Issues at High severity or above will block this PR from merging.

PathLineSeverityDescription
.github/workflows/license-header-checker.yml12highNew third-party GitHub Action dependency added from a personal account: 'peterzhuamazon/license_checker_github_action@ee6c65336e5d72ac79a8358de0b7856c3b1c6bcb'. GitHub Actions run with repository permissions and can exfiltrate secrets, modify code, or perform other malicious operations. The action originates from a personal user account rather than a verified organization, increasing supply chain risk. Maintainers must verify the authenticity and integrity of this action before merging.

The table above displays the top 10 most important findings.

Total: 1 | Critical: 0 | High: 1 | Medium: 0 | Low: 0


Pull Requests Author(s): Please update your Pull Request according to the report above.

Repository Maintainer(s): You can bypass diff analyzer by adding label skip-diff-analyzer after reviewing the changes carefully, then re-run failed actions. To re-enable the analyzer, remove the label, then re-run all actions.


⚠️ Note: The Code-Diff-Analyzer helps protect against potentially harmful code patterns. Please ensure you have thoroughly reviewed the changes beforehand.

Thanks.

@codecov

codecov Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.48%. Comparing base (c154e40) to head (6ff86d0).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5725      +/-   ##
============================================
- Coverage     89.49%   89.48%   -0.01%     
+ Complexity    12264    12263       -1     
============================================
  Files           980      980              
  Lines         42014    42014              
  Branches       4834     4834              
============================================
- Hits          37599    37596       -3     
- Misses         2940     2942       +2     
- Partials       1475     1476       +1     
Flag Coverage Δ
integration 69.93% <ø> (+<0.01%) ⬆️
unit 76.86% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Swiddis

Swiddis commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

We've had this for a while in our existing spotless configs, I think these files are old files from before the config was added. https://github.com/search?q=repo%3Aopensearch-project%2Fsql+licenseHeader&type=code

Would prefer to just use the existing config & fix all the old inherited files once. A separate CI check for this is redundant if it's a spotless rule.

@Swiddis Swiddis added the maintenance Improves code quality, but not the product label Oct 20, 2026
Signed-off-by: shreyah963 <shreyab963@gmail.com>
Signed-off-by: shreyah963 <shreyab963@gmail.com>
Signed-off-by: shreyah963 <shreyab963@gmail.com>
Signed-off-by: shreyah963 <shreyab963@gmail.com>
@shreyah963
shreyah963 force-pushed the add-spdx-license-header-checker branch from bffd3c9 to 5adee47 Compare October 22, 2026 21:22
Signed-off-by: shreyah963 <shreyab963@gmail.com>
@shreyah963

Copy link
Copy Markdown
Contributor Author

Thanks for the review @Swiddis! Looking at the Spotless config across the repo, bunch of subprojects don't have licenseHeader configured so the license-checker fills that gap and it covers non-Java files (.sh, .py) too.
This is part of a cross-project initiative (opensearch-build#6445) to have a consistent SPDX check across all OpenSearch repos. The .licenserc.json  checks for the same header strings Spotless enforces so for subprojects that already have Spotless coverage there's no conflict.

@shreyah963

Copy link
Copy Markdown
Contributor Author

@Swiddis
Swiddis merged commit 6217b5a into opensearch-project:main Nov 30, 2026
42 of 48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Improves code quality, but not the product

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants