Skip to content

Add the plugin submission issue form and workflow - #4

Merged
compscidr merged 7 commits into
mainfrom
feat/submissions
Sep 18, 2026
Merged

compscidr merged 7 commits into
mainfrom
feat/submissions

Conversation

@compscidr

Copy link
Copy Markdown
Contributor

Adds a "Submit a plugin" issue form and a Submission workflow: the check job (contents: read only) parses owner/name from the form and runs registry build against it in the sandbox; the respond job opens the registry.yaml pull request when validation passes, or comments the failure (or an "already listed" notice) on the issue when it doesn't. Updates docs/CONTRACT.md and README.md to describe the new flow and the SUBMIT_TOKEN repository secret needed for the bot's PRs to trigger Validate.

Depends on #3 (feat/stars) — this branch is based on it so registry build sees the stars field; please merge #3 first, then this one.

issues events run from the default branch, so the live end-to-end proof (opening real submission issues) can only happen after this merges; see the report for the exact two-issue proof procedure.

🤖 Generated with Claude Code

compscidr and others added 2 commits September 17, 2026 17:56
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 18, 2026 01:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new Submission workflow references non-existent artifact action versions and the new stars lookup currently makes builds/submissions fail on transient GitHub API errors.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds a “Submit a plugin” GitHub issue form and a new Submission workflow that validates a submitted owner/name repository and automatically opens a registry.yaml PR, while also extending the published plugin index/detail docs to include GitHub stars for directory ordering.

Changes:

  • Introduces .github/ISSUE_TEMPLATE/submit-plugin.yml and .github/workflows/submit.yml to turn submission issues into registry.yaml PRs and comment validation results back to the issue.
  • Extends the registry build output contract to include stars in index.json and per-plugin detail JSON, backed by a new Source.RepoInfo() GitHub API call plus tests.
  • Updates README.md and docs/CONTRACT.md to document the new submission flow and required SUBMIT_TOKEN secret behavior.
File summaries
File Description
README.md Documents stars in the index contract and the new issue-form-based submission flow.
docs/CONTRACT.md Updates submission instructions to prefer the submission issue workflow, with manual PR as fallback.
internal/registry/source.go Extends Source with RepoInfo() and implements it for GitHubSource.
internal/registry/build.go Adds stars to IndexEntry and populates it during buildDetail.
internal/registry/source_test.go Extends fake GitHub API server/test coverage to include RepoInfo() behavior.
internal/registry/build_test.go Updates build expectations to assert Stars in index and detail output.
internal/registry/validate_test.go Updates the in-memory source stub to support returning stars.
cmd/registry/main_test.go Updates the Source stub to satisfy the new RepoInfo() interface method.
.github/workflows/submit.yml Adds the new issue-driven submission/PR-opening automation.
.github/ISSUE_TEMPLATE/submit-plugin.yml Adds the “Submit a plugin” issue form with required repository + contract checkbox.
.github/ISSUE_TEMPLATE/config.yml Enables blank issues.
Review details
  • Files reviewed: 11/11 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/submit.yml
Comment thread internal/registry/build.go Outdated
compscidr and others added 5 commits September 17, 2026 18:11
Without SUBMIT_TOKEN the org blocks Action-created PRs, so a passing
submission previously wedged: it pushed a branch, failed at gh pr
create, posted no comment, and every re-run then failed to push
(non-fast-forward). Guard on HAS_TOKEN to comment and stop before
pushing when the secret is unset, force-with-lease the bot branch push,
and comment (then exit 1) if PR creation still fails. Document
SUBMIT_TOKEN as required, from a dedicated machine identity.

Sanitize submitted-plugin output before echoing it into issue comments
(zero-width space after '@', modifier-letter grave for backticks, a
~~~~ fence) so a submission can't inject mentions or close the fence;
cut the 6000-byte cap on a line boundary. Give empty-REPO parses a
friendly comment instead of the generic failure text.

Tighten the owner half of the repo pattern to exclude '.', matching
goblogplatform/goblog#570; apply the same tightening to
internal/registry/registry.go's repoPattern. Reject submission names
that are '.'/'..' or still end in '.git' after the URL strip. Add a
submit-scoped concurrency group, persist-credentials: false on check's
checkout, and a build test covering a RepoInfo failure being skipped
rather than failing the whole build.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A submitted plugin could still print a line of tildes to close the
~~~~ fence around its echoed output; replace every tilde (in addition
to '@' and backtick) with a lookalike so no fence-syntax character
survives sanitisation.

head -c 6000 | head -n -1 emptied the comment when result.txt was a
single line at or past the cap (head -n -1 drops the only line).
Compute the capped chunk first, then only trim a trailing partial line
when the file was actually truncated and the chunk contains a newline
to trim, appending a "(truncated)" marker either way.

internal/registry/registry.go: repoPattern's tightened owner charset
still let the name half be "." or "..", or end in ".git" (e.g.
owner/.. or owner/repo.git). Reject those explicitly in LoadRegistry
after the regex match, with two new TestLoadRegistry_Errors cases.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@compscidr

Copy link
Copy Markdown
Contributor Author

Re the summary's action-version claim: actions/upload-artifact@v7 and actions/download-artifact@v8 both resolve via the tags API; Validate on this PR is green with checkout@v7/setup-go@v7.

@compscidr
compscidr merged commit 0d150f3 into main Sep 18, 2026
1 check passed
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.

2 participants