Publish complete signed module catalogs
This commit is contained in:
@@ -158,6 +158,7 @@ def build_selective_catalog_candidate(
|
||||
repository_base=repository_base.rstrip("/"),
|
||||
workspace=workspace,
|
||||
)
|
||||
changes.extend(remove_official_license_requirements(candidate))
|
||||
changes.extend(
|
||||
apply_python_artifact_identities(
|
||||
candidate,
|
||||
@@ -728,6 +729,32 @@ def module_entry_repo(entry: dict[str, Any]) -> str | None:
|
||||
return str(package).split("[", 1)[0] if isinstance(package, str) and package.startswith("govoplan-") else None
|
||||
|
||||
|
||||
def remove_official_license_requirements(payload: dict[str, Any]) -> list[CatalogEntryChange]:
|
||||
"""Official open-source modules never require commercial entitlements."""
|
||||
|
||||
modules = payload.get("modules")
|
||||
if not isinstance(modules, list):
|
||||
return []
|
||||
changes: list[CatalogEntryChange] = []
|
||||
for entry in modules:
|
||||
if not isinstance(entry, dict):
|
||||
continue
|
||||
tags = entry.get("tags")
|
||||
if not isinstance(tags, list) or "official" not in tags or "license_features" not in entry:
|
||||
continue
|
||||
before = entry.pop("license_features")
|
||||
changes.append(
|
||||
CatalogEntryChange(
|
||||
repo=module_entry_repo(entry) or "unknown",
|
||||
module_id=str(entry.get("module_id") or "") or None,
|
||||
field="license_features",
|
||||
before=json.dumps(before, sort_keys=True),
|
||||
after=None,
|
||||
)
|
||||
)
|
||||
return changes
|
||||
|
||||
|
||||
def apply_python_artifact_identities(
|
||||
payload: dict[str, Any],
|
||||
*,
|
||||
|
||||
Reference in New Issue
Block a user