Fix external-plugin quality gates reporting infra_error for valid tag refs#2399
Open
tlmii wants to merge 1 commit into
Open
Fix external-plugin quality gates reporting infra_error for valid tag refs#2399tlmii wants to merge 1 commit into
tlmii wants to merge 1 commit into
Conversation
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>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes false infra_error results when external-plugin quality gates inspect tag-based locators.
Changes:
- Reads primary and fetched locators through
HEADorFETCH_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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 falseinfra_errorwhenever a submission'ssource.refwas a tag name (e.g.v1.1.247):git fetch --depth=1 origin <tag>only updatesFETCH_HEAD; it does not create a localrefs/tags/<tag>. The fetch reports success, but the subsequentgit show <tag>:…/git cat-file <tag>:…has no ref to resolve and dies withinvalid 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-agentv1.1.247andcopilot-rulefoundryv1.0.0).Fix
Read locator content through a resolved git object, not the bare locator string:
HEAD(already checked out at the primary commit during clone).git fetchit, then read viaFETCH_HEAD(at most one non-primary fetch per gate, read immediately, soFETCH_HEADis 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/…breakinggit clone --branchat install time); this bug is in the quality-gate harness'sgit show/git cat-filepath.Tests
Adds 4 regression tests in
eng/external-plugin-quality-gates.test.mjscovering the tag-locator path for both gates (tag ref alongside a sha, and tag ref as the primary locator), using a localoriginremote withuploadpack.allowAnySHA1InWantto 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 passnpm run build,npm run plugin:validate,npm run skill:validate— all pass