Skip to content

Add SPDX license header tooling for OSRB compliance - #619

Open
Sulaymon333 wants to merge 4 commits into
masterfrom
osrb/license-header-compliance
Open

Add SPDX license header tooling for OSRB compliance#619
Sulaymon333 wants to merge 4 commits into
masterfrom
osrb/license-header-compliance

Conversation

@Sulaymon333

@Sulaymon333 Sulaymon333 commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

  • license-header.js - dependency-free Node script that adds/validates the canonical SPDX header across source files (yarn license to fix, yarn license-check to verify). Rebuilds headers so it also corrects drift, and preserves shebangs.
  • license.yml - CI gate running license-check on PRs and pushes to master.
  • COPYRIGHT.md - updated to the canonical SPDX header format.
  • Update scripts in packaga.json

What testing has been done on this PR?

Any background context you want to provide?

What are the relevant issues?

relates to grommet/hpe-design-system#6360

Screenshots (if appropriate)

Is this change backward compatible or could it be a breaking change for the official HPE theme?

How should this PR be communicated in the release notes?

Copilot AI lite review requested due to automatic review settings August 7, 2026 10:40
@changeset-bot

changeset-bot Bot commented Aug 7, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: b4b59e6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify

netlify Bot commented Aug 7, 2026

Copy link
Copy Markdown

Deploy Preview for gregarious-clafoutis-525547 ready!

Name Link
🔨 Latest commit b4b59e6
🔍 Latest deploy log https://app.netlify.com/projects/gregarious-clafoutis-525547/deploys/6a7c838205c3c10008ca06dd
😎 Deploy Preview https://deploy-preview-619--gregarious-clafoutis-525547.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@Sulaymon333 Sulaymon333 changed the title cccccbkdheergkvkdtdrtrirefebbivnrihduvhjkfndadd licence header script, ci and update copyright Add SPDX license header tooling for OSRB compliance Aug 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces an automated SPDX license-header enforcement mechanism for the repository, wiring it into local developer workflows (Husky) and CI (GitHub Actions) and adding a standalone COPYRIGHT.md marker file.

Changes:

  • Add tools/license-header.js to insert/normalize SPDX headers, with --check and --staged modes.
  • Add npm scripts (license, license-check, license-staged) and run license-staged in the pre-commit hook.
  • Add a GitHub Actions workflow to enforce SPDX headers on changed files, plus add COPYRIGHT.md.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tools/license-header.js New script to insert/validate canonical SPDX headers across source roots.
package.json Adds scripts to run the license header tool in fix/check/staged modes.
COPYRIGHT.md Adds repository-level SPDX copyright/license marker text.
.husky/pre-commit Runs license header normalization on staged files before other pre-commit steps.
.github/workflows/license.yml Adds CI job to verify SPDX headers on changed files for PRs/pushes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tools/license-header.js
Comment thread tools/license-header.js
Comment thread tools/license-header.js Outdated
Comment thread .github/workflows/license.yml
@Sulaymon333 Sulaymon333 self-assigned this Aug 7, 2026

@MikeKingdom MikeKingdom left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I think a few of Copilot's comments are worth cleaning up.

@halocline

Copy link
Copy Markdown
Collaborator

Looks good. I think a few of Copilot's comments are worth cleaning up.

Same.

@Sulaymon333

Copy link
Copy Markdown
Collaborator Author

Addressed valid copilot comments based on PR comment comment review below.

image

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Suppressed comments (2)

.github/workflows/license.yml:7

  • The PR description says the CI gate runs on pushes to master/stable, but this workflow only triggers for the master branch. If stable is meant to be gated too, add it to the branch filters (or update the PR description if stable is intentionally excluded).
  pull_request:
    branches: [master]
  push:
    branches: [master]

tools/license-header.js:116

  • File processing order depends on filesystem traversal order, so the list of non-compliant files (and even which file is rewritten first) can vary run-to-run/OS-to-OS. Sorting the collected file list makes CI output deterministic and reduces noisy diffs/logs.
  let files;

@Sulaymon333

Copy link
Copy Markdown
Collaborator Author

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Suppressed comments (2)
.github/workflows/license.yml:7

  • The PR description says the CI gate runs on pushes to master/stable, but this workflow only triggers for the master branch. If stable is meant to be gated too, add it to the branch filters (or update the PR description if stable is intentionally excluded).
  pull_request:
    branches: [master]
  push:
    branches: [master]

tools/license-header.js:116

  • File processing order depends on filesystem traversal order, so the list of non-compliant files (and even which file is rewritten first) can vary run-to-run/OS-to-OS. Sorting the collected file list makes CI output deterministic and reduces noisy diffs/logs.
  let files;

Addressed

@britt6612
britt6612 requested a review from MikeKingdom August 12, 2026 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants