Skip to content

Fetch hub_fetch_run.py's Companion and Script From One Revision When the Commit Lookup Fails #3533

Closed

Description

@ptr727

Problem

catalog/snippets/hub_fetch_run.py promises that the prose gate and its prose-gate.json companion run from one hub commit. That holds only when resolve_main_commit() returns a SHA. When the lookup fails, ref falls back to the moving main branch, and the loop in main() then fetches the companion and the script as two separate raw URLs:

commit = resolve_main_commit() if is_prose_gate else None
ref = commit or "main"
...
for path in (*COMPANIONS.get(hub_path, ()), hub_path):
    url = f"{HUB_RAW_BASE}/{ref}/{path}"

If a hub main push lands between those two requests, the run pairs one revision's prose-gate.json with another revision's prose_lint.py. The gate can then refuse the data or evaluate rules the script was not written against. The provenance line says commit unresolved but does not say that the pair may be mixed.

Expected

On the fallback path, either the whole run reads one immutable revision, such as a SHA resolved some other way or a single archive or tree fetch, or the helper refuses to pair the companion with the script rather than running a possibly mixed pair.

Evidence

Raised by Copilot on the carried copy in ptr727/ESPHome-NonRoot#372, a promotion PR whose hub_fetch_run.py is byte-identical to this snippet at hub f60f57d. The fix has to land here and then be carried.

Activity

  1. added
    script
    on Oct 27, 2026
  2. ptr727 commented on Oct 31, 2026

    @ptr727
    OwnerAuthor

    Backlog burndown round 2 claim. Branch: feature/burndown-3533. Group: #3533.

    Predicted file set:

    • catalog/snippets/hub_fetch_run.py
    • tests/test_hub_fetch_run.py

    No other live group may edit these files until this branch merges or the claim is released here.

  3. ptr727 commented on Oct 31, 2026

    @ptr727
    OwnerAuthor

    Claim released: feature/burndown-3533 merged to develop as #3696 and its branch and worktree are cleaned up. The documentation follow-up is #3700. This issue closes when the next develop -> main promotion merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    script

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions