release: bump version to 0.84.2
ci / backend (push) Waiting to run
ci / frontend (push) Waiting to run

This commit is contained in:
rayd1o committed 2026-12-05 01:56:03 +08:00
1 parent 5e6352f524
commit 30b44ec00d
77 files changed
+3312 -1039

No files matched your search

+49 -11
View File
@@ -18,6 +18,7 @@ if __package__:
from .production_registry import (
API,
MANIFEST_NAME,
RELEASE_NOTES_NAME,
REPO,
SERVER,
SERVICES,
@@ -27,16 +28,19 @@ if __package__:
release_by_tag,
release_manifest,
resolve_image,
resolve_release_bundle_oci,
resolve_release_manifest_oci,
resolve_service_ref,
tag_commit,
version,
)
from .release_publish import extract_release_notes
from .release_scope import resolve_release_scope
else:
from production_registry import (
API,
MANIFEST_NAME,
RELEASE_NOTES_NAME,
REPO,
SERVER,
SERVICES,
@@ -46,11 +50,13 @@ else:
release_by_tag,
release_manifest,
resolve_image,
resolve_release_bundle_oci,
resolve_release_manifest_oci,
resolve_service_ref,
tag_commit,
version,
)
from release_publish import extract_release_notes
from release_scope import resolve_release_scope
@@ -248,22 +254,34 @@ def resolve_previous_release_state(previous_tag):
return pins, previous_tag[1:], previous_tag[1:]
def ensure_release_manifest_image(tag, commit, manifest):
def ensure_release_manifest_image(tag, commit, manifest, *, bundle_path=None, release_notes=None):
"""Push and verify the minimal OCI release-manifest:<tag> metadata artifact."""
bundle_in_oci = (manifest.get("client") or {}).get("bundle_storage") == "oci"
existing = resolve_release_manifest_oci(tag, commit)
if existing is not None:
if existing != manifest:
raise RuntimeError(f"Published OCI release manifest for {tag} differs from expected manifest")
if bundle_in_oci and resolve_release_bundle_oci(tag, commit, manifest) is None:
raise RuntimeError(f"Published OCI release manifest for {tag} is missing embedded hotfix bundle")
print(f"Verified OCI {manifest_image_name()}:{tag}", flush=True)
return existing
with tempfile.TemporaryDirectory(prefix="planet-manifest-") as tmp:
ctx = Path(tmp)
(ctx / "release-manifest.json").write_text(
payload = ctx / "payload"
payload.mkdir()
(payload / MANIFEST_NAME).write_text(
json.dumps(manifest, indent=2) + "\n", encoding="utf-8"
)
if bundle_path is not None:
shutil.copy2(bundle_path, payload / bundle_path.name)
if release_notes:
(payload / RELEASE_NOTES_NAME).write_text(
release_notes.strip()[:32768] + "\n",
encoding="utf-8",
)
(ctx / "Dockerfile").write_text(
"FROM scratch\nCOPY release-manifest.json /release-manifest.json\n",
"FROM scratch\nCOPY payload/ /\n",
encoding="utf-8",
)
cmd = [
@@ -294,6 +312,8 @@ def ensure_release_manifest_image(tag, commit, manifest):
verified = resolve_release_manifest_oci(tag, commit)
if verified != manifest:
raise RuntimeError(f"Pushed OCI release manifest is missing or mismatched for {tag}")
if bundle_in_oci and resolve_release_bundle_oci(tag, commit, manifest) is None:
raise RuntimeError(f"Pushed OCI release manifest is missing embedded hotfix bundle for {tag}")
print(f"Verified OCI {manifest_image_name()}:{tag}", flush=True)
return verified
@@ -308,6 +328,15 @@ def build_release_manifest(tag, commit, scope, service_refs, packages, *, shell_
else:
resolved_shell = shell_version or ver
resolved_min_shell = min_shell_version or resolved_shell
client_info = {
"mode": scope.client_mode,
"shell_version": resolved_shell,
"min_shell_version": resolved_min_shell,
"bundle": bundle_path.name if bundle_path else None,
"bundle_sha256": package_hash(bundle_path) if bundle_path else None,
}
if bundle_path is not None:
client_info["bundle_storage"] = "oci" if scope.client_mode == "hotfix" else "release"
return {
"schema_version": 1,
"tag": tag,
@@ -316,13 +345,7 @@ def build_release_manifest(tag, commit, scope, service_refs, packages, *, shell_
"components": list(scope.components),
"changed_services": list(scope.services),
"services": dict(service_refs),
"client": {
"mode": scope.client_mode,
"shell_version": resolved_shell,
"min_shell_version": resolved_min_shell,
"bundle": bundle_path.name if bundle_path else None,
"bundle_sha256": package_hash(bundle_path) if bundle_path else None,
},
"client": client_info,
}
@@ -406,7 +429,22 @@ def prepare(tag, assets_dir, suffixes, *, already_published=False, scope_overrid
shell_version=prev_shell_version,
min_shell_version=prev_min_shell_version,
)
ensure_release_manifest_image(tag, commit, manifest)
oci_bundle_path = None
oci_release_notes = None
if (manifest.get("client") or {}).get("bundle_storage") == "oci" and not already_published:
bundle_name = (manifest.get("client") or {}).get("bundle")
oci_bundle_path = next(
(p for p in staged_packages if p.name == bundle_name),
None,
)
oci_release_notes = extract_release_notes(worktree / "docs/CHANGELOG.md", tag)
ensure_release_manifest_image(
tag,
commit,
manifest,
bundle_path=oci_bundle_path,
release_notes=oci_release_notes,
)
(stage / MANIFEST_NAME).write_text(json.dumps(manifest, indent=2) + "\n", encoding="utf-8")
yield stage, worktree / "docs/CHANGELOG.md"
# The verified public release now holds these bytes. Keep the cache on upload failure.