Skip to content

Fix external-plugin quality gates reporting infra_error for valid tag refs#2399

Open
tlmii wants to merge 1 commit into
github:mainfrom
tlmii:tlmii-fix-external-plugin-tag-locator-fetch
Open

Fix external-plugin quality gates reporting infra_error for valid tag refs#2399
tlmii wants to merge 1 commit into
github:mainfrom
tlmii:tlmii-fix-external-plugin-tag-locator-fetch

Conversation

@tlmii

@tlmii tlmii commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Fixes #2397.

Problem

The external-plugin quality-gate harness (eng/external-plugin-quality-gates.mjs) failed the version match and canvas structure gates with a false infra_error whenever a submission's source.ref was a tag name (e.g. v1.1.247):

- v1.1.247: Unable to read "plugins/.../plugin.json" at "v1.1.247": fatal: invalid object name 'v1.1.247'.

git fetch --depth=1 origin <tag> only updates FETCH_HEAD; it does not create a local refs/tags/<tag>. The fetch reports success, but the subsequent git show <tag>:… / git cat-file <tag>:… has no ref to resolve and dies with invalid object name. Raw SHA locators worked because a SHA is a direct object name once the objects are local.

This forced unnecessary maintainer follow-up on otherwise-valid submissions (confirmed on upgrade-agent v1.1.247 and copilot-rulefoundry v1.0.0).

Fix

Read locator content through a resolved git object, not the bare locator string:

  • Primary locator → read via HEAD (already checked out at the primary commit during clone).
  • Non-primary locatorgit fetch it, then read via FETCH_HEAD (at most one non-primary fetch per gate, read immediately, so FETCH_HEAD is never clobbered before use).

This handles commit SHAs, short tag names, and fully-qualified refs/tags/… refs uniformly, without having to classify the locator. Display messages still show the original locator string. git show FETCH_HEAD:… correctly peels annotated tags. eng/external-plugin-validation.mjs (the canonical data rules) is untouched.

This is distinct from #1783 (fully-qualified refs/tags/… breaking git clone --branch at install time); this bug is in the quality-gate harness's git show/git cat-file path.

Tests

Adds 4 regression tests in eng/external-plugin-quality-gates.test.mjs covering the tag-locator path for both gates (tag ref alongside a sha, and tag ref as the primary locator), using a local origin remote with uploadpack.allowAnySHA1InWant to reproduce the CI fetch shape. All new tests fail against the old code and pass against the fix.

Validation

  • node --test eng/external-plugin-quality-gates.test.mjs eng/materialize-plugins.test.mjs — 9/9 pass
  • npm run build, npm run plugin:validate, npm run skill:validate — all pass
  • Multi-model adversarial review (Opus 4.8, GPT-5.6, Gemini 3.1 Pro) — no material issues

  Generated via Copilot (Claude Opus 4.8) on behalf of @tlmii

runVersionMatchGate and runCanvasStructureGate read locator content with git show/cat-file. For a tag-name locator, `git fetch origin <tag>` only updates FETCH_HEAD and never creates refs/tags/<tag>, so `git show <tag>:...` died with 'invalid object name' and produced a false infra_error.

Read the primary locator via HEAD (already checked out during clone) and non-primary locators via FETCH_HEAD after fetching, instead of the bare locator. This handles SHAs, short tag names, and fully-qualified tag refs uniformly without classifying the locator.

Adds regression coverage for the tag-locator path in both gates.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 22, 2026 21:49
@tlmii
tlmii requested a review from aaronpowell as a code owner July 22, 2026 21:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes false infra_error results when external-plugin quality gates inspect tag-based locators.

Changes:

  • Reads primary and fetched locators through HEAD or FETCH_HEAD.
  • Adds regression coverage for version and canvas gates.
Show a summary per file
File Description
eng/external-plugin-quality-gates.mjs Resolves fetched tag content through valid Git object references.
eng/external-plugin-quality-gates.test.mjs Tests primary and secondary tag locators across both gates.

Review details

  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Medium

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.

External plugin quality gates report infra_error for valid tag refs (git fetch origin <tag> doesn't create a local ref)

2 participants