Skip to content

chore(models): add SPDX-License-Identifier header to the 3 model files missing one#150

Merged
CryptoJones merged 1 commit into
masterfrom
chore/add-spdx-headers-to-models
May 19, 2026
Merged

chore(models): add SPDX-License-Identifier header to the 3 model files missing one#150
CryptoJones merged 1 commit into
masterfrom
chore/add-spdx-headers-to-models

Conversation

@CryptoJones
Copy link
Copy Markdown
Owner

Closes #149.

Summary

3 of 18 files in app/models/ had been shipping without the project-standard // SPDX-License-Identifier: Apache-2.0 header. The other 15 model files and every other JS source file in the repo had it. Add the two-line header to bring the three into compliance:

  • app/models/apikey.model.js
  • app/models/apimaster.model.js
  • app/models/customer.model.js

Add tests/unit/spdx-headers.test.js that walks app/, server.js, and the test tree, asserting every .js file's first line is // SPDX-License-Identifier: Apache-2.0. Future copy-paste of a header-less template fails CI immediately rather than slipping in and surfacing months later via an external license audit.

Test plan

  • npm run lint — clean
  • npm test — 595 passed (was 520 + 75 new = 1 sanity-floor + ~74 per-file test.each assertions covering the source tree), 15 skipped
  • grep -L 'SPDX-License-Identifier' app/models/*.js returns empty

Proudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/2347/

…s missing one

The project convention is to put `// SPDX-License-Identifier: Apache-2.0`
on the first line of every JS source file — eases attribution for
downstream forks and Apache-2.0 §4(c) re-distributors who receive a
single file out of context. Of 18 model files in `app/models/`,
three had been shipping without the header for months:

- app/models/apikey.model.js
- app/models/apimaster.model.js
- app/models/customer.model.js

The other 15 model files (and every other source file in app/,
server.js, and tests/) had it. Add the two-line header to bring
those three into compliance.

New `tests/unit/spdx-headers.test.js` walks `app/`, `server.js`, and
the rest of the source tree at test time, asserting that every `.js`
file's first line is `// SPDX-License-Identifier: Apache-2.0`.
Future copy-paste of a header-less template (or someone adding a
file via a generator that doesn't know our convention) fails CI
immediately rather than slipping in and being discovered by an
external license-audit tool months later.

595 tests pass (was 520 + 75 new = 1 sanity-floor + ~74 per-file
test.each assertions covering the source tree).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@CryptoJones CryptoJones merged commit 5a392e1 into master May 19, 2026
3 checks passed
@CryptoJones CryptoJones deleted the chore/add-spdx-headers-to-models branch May 19, 2026 07:06
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.

chore: 3 of 18 model files missing the SPDX-License-Identifier header convention

1 participant