Skip to content

Add GitHub stars to the index - #3

Merged
compscidr merged 3 commits into
mainfrom
feat/stars
Sep 18, 2026
Merged

compscidr merged 3 commits into
mainfrom
feat/stars

Conversation

@compscidr

Copy link
Copy Markdown
Contributor

Adds stars (stargazers_count) to every index entry and detail doc; goblog's directory page and Admin → Plugins sort by it (goblogplatform/goblog#570).

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 18, 2026 00:57

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 build currently treats failures fetching stars as fatal and can unnecessarily drop otherwise-valid plugins from the published index, and the contract documentation needs updating.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

This PR extends the plugin registry’s published JSON schema to include GitHub stargazer counts (stars) so downstream consumers (goblog directory and Admin → Plugins UI) can sort plugins by popularity.

Changes:

  • Add stars to index.json entries and to per-plugin detail docs (via embedded IndexEntry).
  • Extend the Source abstraction with a GitHub-backed repo metadata call to fetch stargazers_count.
  • Update unit tests and fakes to cover the new RepoInfo/stars behavior.
File summaries
File Description
README.md Documents that the published index now includes stars.
internal/registry/validate_test.go Extends the in-memory Source test fake with stargazer data.
internal/registry/source.go Adds RepoInfo to Source and implements it for GitHubSource via Repositories.Get.
internal/registry/source_test.go Extends the HTTP fake and tests to validate RepoInfo behavior.
internal/registry/build.go Adds Stars to IndexEntry and populates it during detail/index build.
internal/registry/build_test.go Asserts stars is written into both index and detail docs.
cmd/registry/main_test.go Updates CLI test fake Source to satisfy the new interface method.
Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 3
  • 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 internal/registry/build.go Outdated
Comment on lines +146 to +150
stars, err := src.RepoInfo(ctx, v.Owner, v.Name)
if err != nil {
return DetailDoc{}, err
}
entry.Stars = stars

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.

Agreed — fixed in ffc0bca: buildDetail now logs a failed star lookup and publishes the entry with stars: 0 instead of skipping it; TestBuild_StarsAreBestEffort covers it.

Comment thread README.md

- `registry.yaml` — the list. Add your repository in a PR; see [docs/CONTRACT.md](docs/CONTRACT.md).
- `https://goblogplatform.github.io/plugins/index.json` — the machine-readable index (latest release of each plugin, with `download_url` and `sha256`); `plugins/<name>.json` adds the rendered README, changelog and release history.
- `https://goblogplatform.github.io/plugins/index.json` — the machine-readable index (latest release of each plugin, with `download_url` and `sha256`) and `stars` (GitHub stargazers, the directory's default ordering); `plugins/<name>.json` adds the rendered README, changelog and release history.

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.

Added a "What the directory publishes" section to docs/CONTRACT.md (ffc0bca) explaining that stars comes from the repo's GitHub star count and is best-effort. The full index field list stays in the README, which is the consumer-facing doc.

Comment thread internal/registry/source.go Outdated
Comment on lines +39 to +41
// RepoInfo returns the repository's GitHub stargazer count (the
// directory's "top plugins" ordering).
RepoInfo(ctx context.Context, owner, repo string) (stars int, err error)

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.

Renamed to RepoStars in ffc0bca (new API in this PR, so no compatibility concern).

compscidr and others added 2 commits September 18, 2026 08:31
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@compscidr
compscidr merged commit c93b499 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