Splitting ref and sha into two fields correctly for the intake form#1788
Splitting ref and sha into two fields correctly for the intake form#1788aaronpowell wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the external plugin public submission flow so maintainers can review either an immutable tag (ref), a full commit SHA (sha), or both—aligning the issue form, intake automation, and canonical validator.
Changes:
- Extend the canonical validator to support
source.shaand require at least one immutable locator (refand/orsha) for public submissions. - Update intake parsing/validation and the issue template to split “ref” and “sha” into separate fields.
- Refresh contributor/agent documentation to reflect the new locator fields and guidance.
Show a summary per file
| File | Description |
|---|---|
eng/external-plugin-validation.mjs |
Adds source.sha validation and replaces requireImmutableRef with requireImmutableLocator (ref/sha). |
eng/external-plugin-intake.mjs |
Updates issue-form parsing, required checklist text, remote validation, and output formatting to handle ref and/or sha. |
CONTRIBUTING.md |
Documents the new ref + sha fields and updates examples/checklist wording. |
AGENTS.md |
Updates external plugin submission guidance to allow immutable ref, sha, or both. |
.github/ISSUE_TEMPLATE/external-plugin.yml |
Splits the locator input into optional “Ref to review” and “Commit SHA to review” fields and updates checklist copy. |
Copilot's findings
Comments suppressed due to low confidence (2)
eng/external-plugin-intake.mjs:26
- Changing the section heading from "Immutable ref to review" to "Ref to review" means parseExternalPluginIssueBody will no longer find the ref value in issues created with the old template. Because the workflow runs on edited/reopened issues, older submissions can start failing validation unexpectedly. Consider supporting both headings when extracting the ref (e.g., check the legacy title as a fallback).
const FIELD_TITLES = Object.freeze({
pluginName: "Plugin name",
shortDescription: "Short description",
githubRepository: "GitHub repository",
pluginPath: "Plugin path inside the repository",
immutableRef: "Ref to review",
immutableSha: "Commit SHA to review",
version: "Version",
eng/external-plugin-intake.mjs:252
- The "one of ref or sha is required" check will incorrectly flag submissions created with the previous template, because their ref lives under the legacy "Immutable ref to review" heading and won’t be picked up by the new title. Once legacy heading support is added, ensure this validation uses the resolved ref value (new or legacy) so older issues don’t fail intake on reopen/edit.
const pluginName = requiredField(FIELD_TITLES.pluginName);
const shortDescription = requiredField(FIELD_TITLES.shortDescription);
const repoInput = normalizeGitHubRepo(requiredField(FIELD_TITLES.githubRepository));
const immutableRef = stripNoResponse(sections.get(FIELD_TITLES.immutableRef));
const immutableSha = stripNoResponse(sections.get(FIELD_TITLES.immutableSha));
const version = requiredField(FIELD_TITLES.version);
const license = requiredField(FIELD_TITLES.license);
const authorName = requiredField(FIELD_TITLES.authorName);
const pluginPath = stripNoResponse(sections.get(FIELD_TITLES.pluginPath));
const authorUrl = stripNoResponse(sections.get(FIELD_TITLES.authorUrl));
const homepageUrl = stripNoResponse(sections.get(FIELD_TITLES.homepageUrl));
const keywords = parseKeywords(sections.get(FIELD_TITLES.keywords));
const additionalNotes = stripNoResponse(sections.get(FIELD_TITLES.additionalNotes));
const checkedItems = parseChecklist(sections.get(FIELD_TITLES.submissionChecklist));
if (!immutableRef && !immutableSha) {
errors.push(`submission: one of "${FIELD_TITLES.immutableRef}" or "${FIELD_TITLES.immutableSha}" is required`);
}
- Files reviewed: 5/5 changed files
- Comments generated: 2
| "The ref I provided is an immutable release tag or full 40-character commit SHA, not a branch.", | ||
| "The ref and/or sha I provided is immutable (release tag and/or full 40-character commit SHA), not a branch.", | ||
| "This submission follows this repository's contribution, security, and responsible AI policies.", | ||
| "This plugin is not already listed in the Awesome Copilot marketplace.", |
There was a problem hiding this comment.
Done in commits e881641 and f36d8b3. Both the checklist item text and the immutableRef field title now support old and new values:
REQUIRED_CHECKLIST_ITEMSis now an array ofSets; a submission passes each entry if the checked items contain any equivalent text (new or legacy). The old text"The ref I provided is an immutable release tag or full 40-character commit SHA, not a branch."is accepted alongside the new wording.- When looking up the
immutableReffield, the parser now falls back to the legacy title"Immutable ref to review"if the current title"Ref to review"is absent from the issue body. This covers issues submitted before the ref/sha split. - The error message always uses the canonical (new) text, so new submissions see the current expected wording.
| if (source.path !== undefined) { | ||
| validateRelativePath(source.path, prefix, errors); | ||
| } | ||
|
|
||
| if (source.ref !== undefined) { | ||
| validateImmutableRef(source.ref, prefix, errors); | ||
| } else if (requireImmutableRef) { | ||
| errors.push(`${prefix}: "source.ref" is required for public external plugin submissions`); | ||
| } | ||
|
|
||
| if (source.sha !== undefined) { | ||
| validateCommitSha(source.sha, prefix, errors); | ||
| } | ||
|
|
||
| if (requireImmutableLocator && source.ref === undefined && source.sha === undefined) { | ||
| errors.push(`${prefix}: one of "source.ref" or "source.sha" is required for public external plugin submissions`); | ||
| } | ||
| } |
There was a problem hiding this comment.
Added the 40-character enforcement to validateImmutableRef: if the ref is all-hex characters and not exactly 40 characters long, it now returns an error directing users to provide a full SHA. Tag refs (e.g. refs/tags/v1.0.0) are unaffected. Fixed in the latest commit.
Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
| - Ref to review (`ref`), using a release tag or tag ref rather than a branch | ||
| - Commit SHA to review (`sha`), using a full 40-character commit SHA |
| label: Ref to review | ||
| description: Optional release tag or tag ref. Submit this, a commit SHA, or both. | ||
| placeholder: v1.2.3 | ||
| validations: | ||
| required: true | ||
| required: false | ||
| - type: input | ||
| id: immutable-sha | ||
| attributes: | ||
| label: Commit SHA to review | ||
| description: Optional full 40-character commit SHA. Submit this, a ref, or both. | ||
| placeholder: 0123456789abcdef0123456789abcdef01234567 | ||
| validations: | ||
| required: false |
| if (source.ref !== undefined) { | ||
| validateImmutableRef(source.ref, prefix, errors); | ||
| } else if (requireImmutableRef) { | ||
| errors.push(`${prefix}: "source.ref" is required for public external plugin submissions`); | ||
| } | ||
|
|
||
| if (source.sha !== undefined) { | ||
| validateCommitSha(source.sha, prefix, errors); | ||
| } | ||
|
|
||
| if (requireImmutableLocator && source.ref === undefined && source.sha === undefined) { | ||
| errors.push(`${prefix}: one of "source.ref" or "source.sha" is required for public external plugin submissions`); | ||
| } |
Pull Request Checklist
npm startand verified thatREADME.mdis up to date.stagedbranch for this pull request.Description
Type of Contribution
Additional Notes
By submitting this pull request, I confirm that my contribution abides by the Code of Conduct and will be licensed under the MIT License.