Skip to content

Commit

Permalink
fix(ci): consider stable tag aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
cjdcordeiro committed Oct 17, 2023
1 parent 2829396 commit 845dda0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
1 change: 1 addition & 0 deletions .github/base_digests/22.04
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
public.ecr.aws/ubuntu/ubuntu:jammy@sha256:c6871ae8b54fb3ed0ba4df4eb98527e9a6692088fe0c2f2260a9334853092b47

Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,22 @@ def find_released_revisions(releases_json: dict) -> dict:
for tag in tags["imageTagDetails"]:
if tag["imageDetail"].get("imageDigest") != revision_digest:
continue
try:
to_track, to_risk = tag["imageTag"].rsplit("_", 1)
except ValueError as err:
if "not enough values to unpack" in str(err):
to_track = "latest"
to_risk = tag["imageTag"]
else:
logging.exception(f"Unrecognized tag {tag['imageTag']}")
continue

if tag["imageTag"] in ["edge", "beta", "candidate", "stable"]:
to_track = "latest"
to_risk = tag["imageTag"]
else:
try:
to_track, to_risk = tag["imageTag"].rsplit("_", 1)
except ValueError as err:
if "not enough values to unpack" in str(err):
# These cases are driven by the <track> alias which
# is created for tags like <track>_stable
to_track = tag["imageTag"]
to_risk = "stable"
else:
logging.exception(f"Unrecognized tag {tag['imageTag']}")
continue

if to_track not in release_to:
release_to[str(to_track)] = {"risks": [to_risk]}
Expand Down

0 comments on commit 845dda0

Please sign in to comment.