Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions delivery/ci/publish_mcp_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,9 @@ def registry_tags():
return []
require(status == 200, "registry_tags_unavailable")
value = strict_json(raw)
# GHCR returns null while the repository contains only untagged digests.
if "tags" in value and value["tags"] is None:
value["tags"] = []
require(value.get("name") == IMAGE.removeprefix("ghcr.io/") and isinstance(value.get("tags"), list)
and len(value["tags"]) < 1000 and all(isinstance(tag, str) for tag in value["tags"]), "registry_tags_window")
return value["tags"]
Expand Down
10 changes: 10 additions & 0 deletions tests/test_mcp_publication.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,16 @@ class TransportBoundaryTests(unittest.TestCase):
def setUp(self):
self.p = importlib.import_module("delivery.ci.publish_mcp_artifacts")

def test_registry_without_tagged_images_has_no_reusable_runtime(self):
with patch.object(self.p, "registry_request", return_value=(200, b'{"name":"zeegin/v8std-mcp","tags":null}')):
self.assertEqual(self.p.registry_tags(), [])
for value in ({"name": "zeegin/v8std-mcp"},
{"name": "other/repository", "tags": None},
{"name": "zeegin/v8std-mcp", "tags": "stable"}):
with self.subTest(value=value), patch.object(self.p, "registry_request", return_value=(200, json.dumps(value).encode())):
with self.assertRaisesRegex(self.p.PublicationError, "registry_tags_window"):
self.p.registry_tags()

def test_real_local_smoke_validates_inspect_array_for_both_platforms_and_cleans_failures(self):
good = {"Config": {"User": "10001:10001", "Labels": {"org.opencontainers.image.revision": "d" * 40}},
"HostConfig": {"Privileged": False, "ReadonlyRootfs": True}}
Expand Down