Documentation
¶
Overview ¶
Package repositories owns the M4 "repositories" plugin. It filters, sorts, and presents the user's repository list — the data the base plugin's paging loop already produced into pc.Data.Computed.RepositoryList.
MVP scope (Phase 3 US1):
- Featured: filter by `_forks` / `_skipped` and sort by `_order` (stars / forks / watchers).
- Random: deterministic Fisher-Yates over Featured when `_random=true` (seed via `_random_seed`).
Inputs accepted for upstream-compat but NOT yet wired in this MVP:
- `plugin_repositories_affiliations`: parsed but ignored. Base surfaces OWNER repositories regardless. Future US2 work will route this through a dedicated GraphQL query.
- `plugin_repositories_pinned` / `_starred`: when set, the corresponding Result section is populated by reusing Featured as a placeholder. Dedicated `user.pinnedItems` / `user.starredRepositories` GraphQL fragments land alongside the P2 `stars` plugin in US2.
Contracts: specs/004-m4-github-plugins/contracts/plugin-p1-mvp.md §4 Data model: specs/004-m4-github-plugins/data-model.md E-015
Index ¶
Constants ¶
const Name = "repositories"
Name is the canonical plugin slug.
Variables ¶
var Plugin plugins.Plugin = &repositoriesPlugin{}
Plugin is the singleton registered with the global plugin registry.
Functions ¶
Types ¶
type Result ¶
type Result struct {
Skipped bool `json:"skipped,omitempty"`
SkippedReason string `json:"-"`
Featured []plugins.Repository `json:"featured"`
Pinned []plugins.Repository `json:"pinned,omitempty"`
Starred []plugins.Repository `json:"starred,omitempty"`
Random []plugins.Repository `json:"random,omitempty"`
}
Result is the JSON payload published under data.Plugins["repositories"].