Skip to content

feat: cascade checker recognizes in-repo container-base.yml builds#5

Merged
fatherlinux merged 1 commit into
mainfrom
feat/checker-recognize-in-repo-builds
Jun 11, 2026
Merged

feat: cascade checker recognizes in-repo container-base.yml builds#5
fatherlinux merged 1 commit into
mainfrom
feat/checker-recognize-in-repo-builds

Conversation

@fatherlinux

Copy link
Copy Markdown
Member

Some crunchtools Quay images are built by a workflow inside a DIFFERENT repo than their name suggests (e.g. quay.io/crunchtools/acquacotta-base is built by container-base.yml inside crunchtools/acquacotta; rotv-base likewise).

Before this change, the checker treated those FROM targets as broken because no separate repo of that name existed. Now it scans every workflow file in every repo for image-publication patterns (IMAGE_NAME: crunchtools/X env vars + literal quay.io/crunchtools/X references) and resolves FROM lines against the union of repo-names + workflow-published-image-names.

Cuts the live-org false-positive WARN about acquacotta-base. Remaining WARNs are legitimate (over-dispatch from ubi10-core to rotv, where rotv's main Containerfile uses an ARG for its FROM — separate, smaller issue).

🤖 Generated with Claude Code

Some crunchtools images are built and published by a workflow inside a
DIFFERENT repo than their name suggests:

  - quay.io/crunchtools/acquacotta-base is built by container-base.yml
    inside crunchtools/acquacotta
  - quay.io/crunchtools/rotv-base is built by build-base.yml inside
    crunchtools/rotv

Before this change, the checker flagged FROM lines pointing at those
images as broken (no separate repo of that name in the org). Augment
the checker with a pre-pass that scans every workflow file for image-
publication patterns (IMAGE_NAME: crunchtools/X env vars, plus literal
quay.io/crunchtools/X references). FROM targets resolve against the
union of (repo names + workflow-published image names).

Cuts the live-org false-positive WARN about acquacotta-base.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@fatherlinux fatherlinux merged commit 440bc9d into main Jun 11, 2026
@fatherlinux fatherlinux deleted the feat/checker-recognize-in-repo-builds branch June 11, 2026 03:56

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates validate-cascade.py to scan and cache GitHub workflow files across repositories to identify published crunchtools images, resolving false-positive broken image references. The review feedback highlights two key improvements: first, removing a redundant fetch_text fallback since all workflows are already cached, and handling .yaml extensions; second, filtering out non-file entries when scanning the workflows directory to prevent potential errors.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread validate-cascade.py
Comment on lines +187 to 190
txt = workflows_cache.get((r, wf))
if txt is None:
txt = fetch_text(args.org, r, f".github/workflows/{wf}", token)
if txt is None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Since workflows_cache is populated by scanning the entire .github/workflows directory for every repository, any existing workflow file is already cached. If a workflow file (like build.yml or container.yml) is not present in workflows_cache, it means the file does not exist in the repository.

Calling fetch_text here is redundant and will always result in a useless 404 API request. Since most repositories only have one of these two workflow files, this causes an unnecessary 404 request for almost every repository, which can easily trigger GitHub API rate limits and slow down execution.

We can safely remove the fallback to fetch_text and also handle the .yaml extension if the .yml lookup fails.

Suggested change
txt = workflows_cache.get((r, wf))
if txt is None:
txt = fetch_text(args.org, r, f".github/workflows/{wf}", token)
if txt is None:
txt = workflows_cache.get((r, wf))
if txt is None and wf.endswith(".yml"):
txt = workflows_cache.get((r, wf[:-4] + ".yaml"))
if txt is None:
continue

Comment thread validate-cascade.py
Comment on lines +149 to +152
for entry in wf_entries:
name = entry.get("name", "")
if not name.endswith((".yml", ".yaml")):
continue

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

When scanning the .github/workflows directory, some entries might not be regular files (e.g., subdirectories, symlinks, or submodules). Calling fetch_text on a non-file entry will cause a TypeError or KeyError because the GitHub API response for a directory listing does not contain a content field.

To prevent potential crashes, explicitly filter out non-file entries by checking entry.get("type") == "file".

Suggested change
for entry in wf_entries:
name = entry.get("name", "")
if not name.endswith((".yml", ".yaml")):
continue
for entry in wf_entries:
if entry.get("type") != "file":
continue
name = entry.get("name", "")
if not name.endswith((".yml", ".yaml")):
continue

fatherlinux added a commit that referenced this pull request Jun 17, 2026
Gatehouse AI code review is now gate #5 (between Gourmand and Container
Build) for all MCP servers. Added to both the ordered gate list and the
CI pipeline table.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant