Skip to content

Splitting ref and sha into two fields correctly for the intake form#1788

Open
aaronpowell wants to merge 5 commits into
stagedfrom
external-plugin-submission-sha-support
Open

Splitting ref and sha into two fields correctly for the intake form#1788
aaronpowell wants to merge 5 commits into
stagedfrom
external-plugin-submission-sha-support

Conversation

@aaronpowell
Copy link
Copy Markdown
Contributor

Pull Request Checklist

  • I have read and followed the CONTRIBUTING.md guidelines.
  • I have read and followed the Guidance for submissions involving paid services.
  • My contribution adds a new instruction, prompt, agent, skill, or workflow file in the correct directory.
  • The file follows the required naming convention.
  • The content is clearly structured and follows the example format.
  • I have tested my instructions, prompt, agent, skill, or workflow with GitHub Copilot.
  • I have run npm start and verified that README.md is up to date.
  • I am targeting the staged branch for this pull request.

Description


Type of Contribution

  • New instruction file.
  • New prompt file.
  • New agent file.
  • New plugin.
  • New skill file.
  • New agentic workflow.
  • Update to existing instruction, prompt, agent, plugin, skill, or workflow.
  • Other (please specify):

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.

Copilot AI review requested due to automatic review settings May 21, 2026 05:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.sha and require at least one immutable locator (ref and/or sha) 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

Comment thread eng/external-plugin-intake.mjs Outdated
"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.",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@copilot action this 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.

Done in commits e881641 and f36d8b3. Both the checklist item text and the immutableRef field title now support old and new values:

  • REQUIRED_CHECKLIST_ITEMS is now an array of Sets; 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 immutableRef field, 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.

Comment on lines 271 to 286
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`);
}
}
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.

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.

Copilot AI and others added 3 commits May 21, 2026 05:56
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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot's findings

  • Files reviewed: 5/5 changed files
  • Comments generated: 3

Comment thread CONTRIBUTING.md
Comment on lines +205 to +206
- 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
Comment on lines +54 to +66
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
Comment on lines 279 to 289
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`);
}
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.

3 participants