fix(deploy): require verified release manifests
This commit is contained in:
1 parent
95b8e566c4
commit
88a31ba0d5
5 files changed
+44
-5
No files matched your search
@@ -1647,6 +1647,24 @@ def prepare_manifest_images(manifest: dict[str, Any], docker: Docker) -> None:
|
||||
manifest["restore"]["status"] = "blocked"
|
||||
|
||||
|
||||
def require_verified_release(manifest: dict[str, Any]) -> None:
|
||||
"""Reject public publication unless the candidate passed every release check."""
|
||||
release = manifest.get("release")
|
||||
if isinstance(release, dict) and release.get("status") == "verified":
|
||||
return
|
||||
|
||||
reasons = release.get("reasons") if isinstance(release, dict) else None
|
||||
details = (
|
||||
"; ".join(reason for reason in reasons if isinstance(reason, str))
|
||||
if isinstance(reasons, list)
|
||||
else ""
|
||||
)
|
||||
message = "Refusing to publish an unverified release manifest; no manifest was written."
|
||||
if details:
|
||||
message += " " + details
|
||||
raise ReleaseError(message)
|
||||
|
||||
|
||||
def manifest_file(path_text: str | None, root: Path = ROOT) -> Path:
|
||||
if not path_text:
|
||||
return default_manifest(root)
|
||||
@@ -1698,6 +1716,7 @@ def command_manifest(args: argparse.Namespace, docker: Docker | None = None, roo
|
||||
data_versions = read_data_versions(args.data_manifest, root)
|
||||
compose_files = {name: file_digest(root / name) for name in CORE_COMPOSE_FILES}
|
||||
manifest = build_manifest(inputs, utc_now(), release_id, data_versions, compose_files, root)
|
||||
require_verified_release(manifest)
|
||||
path = release_artifact_dir(release_id, root) / "manifest.json"
|
||||
with immutable_release_lock(release_id, root):
|
||||
if path.exists():
|
||||
|
||||
Reference in new issue
Block a user