Fix actual-budget listing ref and keep bump refs in sync (#34)

The bump bot updated the digest in cottage.yml but kept the old ref, so
Cottage's sync skipped actual-budget (template uses 26.11.0, listing
recorded 25.11.0). Correct the ref, make the bot rewrite it with the
digest, and add a CI check for Cottage's listing-image rule.
This commit is contained in:
michael authored and GitHub committed 2026-11-23 08:42:55 -05:00
1 parent 2868418a60
commit 6262b8b648
4 files changed
+37 -3

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
"""Every image a recipe's template.yml runs must be listed, with a digest, in its cottage.yml.
The same rule Cottage applies when it syncs the catalog: a recipe that breaks it is skipped.
"""
import glob, os, re, sys, yaml
DIGEST = re.compile(r"sha256:[0-9a-f]{64}")
bad = []
for d in sorted(glob.glob("apps/*/")):
tpl = yaml.safe_load(open(os.path.join(d, "template.yml")))
listing = yaml.safe_load(open(os.path.join(d, "cottage.yml")))
recorded = {}
for im in listing.get("images") or []:
recorded[im.get("ref")] = im.get("digest", "")
if not DIGEST.fullmatch(str(im.get("digest", ""))):
bad.append(f"{d}cottage.yml: image {im.get('ref')} needs a sha256 digest")
for name, svc in (tpl.get("services") or {}).items():
img = (svc or {}).get("image")
if img and img not in recorded:
bad.append(f"{d}cottage.yml: image {img} (service {name}) is used by template.yml but has no recorded digest")
print("\n".join(bad) or "every template image has a recorded digest")
sys.exit(1 if bad else 0)
+10
View File
@@ -50,6 +50,16 @@ jobs:
- run: pip install --quiet jsonschema pyyaml
- run: python3 .github/check-parameters.py
# Cottage skips a recipe at sync time if its template runs an image the listing has no
# digest for, so catch that here.
listing-images:
name: Listing images
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: pip install --quiet pyyaml
- run: python3 .github/check-listing-images.py
compose:
name: Docker Compose test
runs-on: ubuntu-latest