PMDB: Exporter: Export SPDX Expressions and Migrate to v3
Overview
We want the exporter to return full SPDX expressions, not just individual license identifiers. This requires migrating to the v3 format, and is also a good opportunity to move the export artifacts to Cloudflare R2 to reduce egress costs.
Proposed Work
- Modify the export logic to conditionally return an SPDX license id or expression
- Expose a raw expression string
- Publish a JSON schema for the v3 license object
- Migrate to v3 as part of the expression support work (reusing the
manifest.json+ full export + deltas approach)
Export format
Each entry in default_licenses and other_licenses should contains either expression or licenses, for example:
{
"name": "app.cash.backfila/client-misk-hibernate",
"lowest_version": "0.1.4-20211109.2053-alpha-41370-d",
"highest_version": "2026.3.26.140500-911435-f",
"default_licenses": [
{
"expression": "Apache-2.0 AND (MIT OR GPL-3.0)",
}
],
"other_licenses": [
{
"licenses": [
{
"id": "MIT",
}
],
"versions": [
"0.1.3-20210127.1838-76ab4fc",
"0.1.3-20210805.0116-93702c4",
"0.1.3-20210805.0207-0d08d2b",
"0.1.4-20210806.0204-5341f38"
]
}
]
}Suggested breakdown
-
v3 format + expression support — define the v3 license object and its JSON schema (each block carries
expressionxorlicenses), and carry the raw expression through the versions compression pipeline. -
v3 delta export: read expressions from the db and export to the v3
manifest.json+ deltas layout. -
v3 full snapshot: produce the
full_dataset.tar.zstbootstrap archive.
Out of scope:
- Host artifacts on Cloudflare R2
Related issues and discussions
- Spike: PackageMetadata sync data format v3 (#584273 - closed)
- https://gitlab.com/gitlab-org/gitlab/-/work_items/589355+
- https://gitlab.com/gitlab-org/gitlab/-/work_items/596182+
- Spike: Update security policies to support comp... (#424827 - closed)
- License Approval Policies: Support LicenseRef-*... (#596930 - closed)
- #594303 (comment 3271764450)
- gitlab-org#18346 (comment 3256627649)
Edited by Orin Naaman