Skip to content

chore: license under Apache-2.0 with CI-enforced SPDX headers#151

Merged
UtkarshBhardwaj007 merged 1 commit intomainfrom
chore/add-apache-license
May 9, 2026
Merged

chore: license under Apache-2.0 with CI-enforced SPDX headers#151
UtkarshBhardwaj007 merged 1 commit intomainfrom
chore/add-apache-license

Conversation

@UtkarshBhardwaj007
Copy link
Copy Markdown
Member

Summary

  • Add LICENSE (canonical Apache-2.0 text) and apply the Parity-style copyright + SPDX + Apache-appendix header to every tracked .ts / .tsx / .rs source file (153 files).
  • Add scripts/check-license-headers.sh (check + --fix modes) and a .github/workflows/license.yml workflow that runs the check on every PR, on push to main, and via workflow_dispatch. The check requires both the SPDX-License-Identifier: Apache-2.0 line and the Copyright (C) Parity Technologies line so a bare SPDX identifier alone won't pass. The --fix preserves shebangs (#!/usr/bin/env node|bun) on line 1 so executable scripts under tools/ and scripts/ keep working.
  • Declare "license": "Apache-2.0" in package.json, add a pnpm lint:license script, and update CLAUDE.md / AGENTS.md / README.md with a "Verification before committing" section that points contributors and AI agents at the full local check recipe (pnpm format:check + pnpm lint:license + pnpm test).

Test plan

  • pnpm format:check passes (Biome canonicalised the new headers; one trailing-blank-line nit auto-fixed).
  • pnpm lint:license passes — all 153 source files have the strengthened header.
  • Negative test: a file with only // SPDX-License-Identifier: Apache-2.0 (no Parity copyright line) is correctly rejected with exit code 1.
  • scripts/check-license-headers.sh --fix is idempotent on a clean tree and correctly preserves shebangs on src/index.ts, scripts/check-funder-balance.ts, and the three executable scripts in tools/.
  • Script is portable — while IFS= read -r f with no mapfile, works on macOS bash 3.2 and Ubuntu CI bash.
  • Executable bit recorded as 100755 (git ls-files --stage scripts/check-license-headers.sh).
  • pnpm test passes (486 tests across 45 files).
  • pnpm build succeeds (bun build --compile).
  • CI: License Headers workflow turns green on this PR.
  • CI: existing Format and Unit Tests workflows still pass with the new headers.

Notes

  • No NOTICE file added — Apache-2.0 §4(d) only requires reproducing one if it exists, and the Parity convention for newer repos is to skip it. Mirrors paritytech/playground-app#159.
  • Changeset (patch) included so the next release surfaces the license change in the changelog.

- Add LICENSE (canonical Apache-2.0 text from apache.org).
- Apply the Parity-style copyright + SPDX + Apache appendix block to
  every tracked .ts / .tsx / .rs source file (153 files).
- Add scripts/check-license-headers.sh — verifies every tracked source
  file has both the SPDX line and the Parity copyright line; --fix
  prepends the standard header to any file missing it. The fixer
  preserves shebangs (`#!/usr/bin/env node|bun`) on line 1 so executable
  scripts under tools/ and scripts/ continue to run.
- Add .github/workflows/license.yml — runs the check on every PR, on
  push to main, and via workflow_dispatch; concurrency-cancelled to
  avoid pile-ups; runs on parity-default for org PRs.
- Declare license = "Apache-2.0" in package.json and add a
  pnpm lint:license script that calls the check.
- Document the new step in CLAUDE.md, AGENTS.md, and README.md as part
  of the "Verification before committing" recipe (pnpm format:check +
  pnpm lint:license + pnpm test).

Verification: pnpm format:check, pnpm lint:license, pnpm test (486
tests, 45 files), and pnpm build all pass on this commit. Negative
test confirms a bare-SPDX file (no Parity copyright line) is rejected.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 9, 2026

Dev build ready — try this branch:

curl -fsSL https://raw.githubusercontent.com/paritytech/playground-cli/main/install.sh | VERSION=dev/chore/add-apache-license bash

@UtkarshBhardwaj007 UtkarshBhardwaj007 merged commit d5a1968 into main May 9, 2026
18 of 19 checks passed
@UtkarshBhardwaj007 UtkarshBhardwaj007 deleted the chore/add-apache-license branch May 9, 2026 12:24
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 9, 2026

E2E Test Pass · ❌ FAIL

Tag: e2e-ci-pr · Branch: chore/add-apache-license · Commit: ce76128 · Run logs

Cell Result Time
pr-deploy-cdm ✅ PASS 3m31s
pr-deploy-frontend ✅ PASS 5m41s
pr-deploy-foundry ✅ PASS 1m56s
pr-preflight ✅ PASS 2m10s
pr-install ✅ PASS 0m48s
pr-init-session ✅ PASS 1m55s
pr-mod ❌ FAIL 2m48s
${{ matrix.cell }} ⏭️ SKIP 0m00s
${{ matrix.cell }} ⏭️ SKIP 0m00s

Sentry traces: view spans for this run

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.

1 participant