Skip to content

Validate license.spdx_id against spdx-license-ids - #193

Merged
admdly merged 1 commit into
mainfrom
license-spdx-support
Aug 8, 2026
Merged

Validate license.spdx_id against spdx-license-ids#193
admdly merged 1 commit into
mainfrom
license-spdx-support

Conversation

@admdly

@admdly admdly commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Summary

License.name stays free text, but adds an optional spdx_id so a submitter can identify a license as a specific, current (non-deprecated) SPDX identifier rather than an arbitrary string.

  • Validated with .refine() against the spdx-license-ids package (current, non-deprecated ids only) rather than z.enum(), so the public OpenAPI schema and generated client types stay a plain string instead of embedding a ~600-member literal union.
  • No migration needed — the license column is an opaque JSON blob, so this is purely an additive change to the shape stored in it.
  • Fully backward compatible: spdx_id is optional, name is unchanged and still always populated, so every existing consumer reading license.name keeps working unchanged.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 8, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
api 1898f85 Commit Preview URL

Branch Preview URL
Aug 08 2026, 05:22 PM

@cubic-dev-ai cubic-dev-ai Bot 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.

No issues found across 4 files

Requires human review: This changes the public License API shape by adding an optional spdx_id field that was previously rejected by the strict schema, so the client-visible request/response contract changes. That public-contract decision warrants human sign-off.

Re-trigger cubic

License.name stays free text, but a new optional spdx_id lets a
submitter identify a license as a specific, current (non-deprecated)
SPDX identifier rather than an arbitrary string. Validated with
.refine() against the spdx-license-ids package rather than z.enum()
so the public OpenAPI schema and generated client types stay a plain
string instead of embedding a ~600-member literal union.

No migration needed: the `license` column is an opaque JSON blob, so
this is purely an additive schema change to what's stored in it.

Adds coverage in extension-writes.test.ts: rejects an unknown or
deprecated id, stores name+spdx_id together for a recognized license,
and still accepts a license with no spdx_id for custom/proprietary
submissions.
@admdly
admdly force-pushed the license-spdx-support branch from 81a0439 to 1898f85 Compare August 8, 2026 17:22
@admdly
admdly merged commit 7f81c89 into main Aug 8, 2026
9 checks passed
@admdly
admdly deleted the license-spdx-support branch August 8, 2026 17:24
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