Documentation
¶
Overview ¶
Package base owns the special "base" plugin: it runs before every other plugin and populates the shared Data.User / Data.Organization / Data.Computed fields that downstream plugins depend on.
The M4 implementation covers:
- user-account branch (runUser) and organization-account branch (runOrganization)
- repository paging with batch-halving on transient 5xx / timeout (repositories.go), writing both totals into Computed.Repositories and the per-node accumulator into Computed.RepositoryList
- indepth GraphQL query (indepth.go) that augments Computed with contribution-calendar / commits / issues / PR totals when at least one indepth-dependent plugin is enabled
The repository-account branch (templates that target a single repository) is M7 territory and currently returns (nil, nil).
Index ¶
Constants ¶
const Name = "base"
Name is the canonical plugin slug.
Variables ¶
var Plugin plugins.Plugin = &basePlugin{}
Plugin is the singleton registered with the global plugin registry.
Functions ¶
func FetchRepo ¶
func FetchRepo(ctx context.Context, login, repo string, rest *githubapi.REST, gql *githubapi.GraphQL) (*plugins.Repo, error)
FetchRepo populates a *plugins.Repo for the M7 repository template flow. It runs once per request when the engine has selected the repository template and the user supplied a non-empty `repo` input.
Sequence:
- GraphQL `Repository(login, repo)` — owner / name / counts / license / default branch / open-issue + open-PR totals.
- REST `GET /repos/{owner}/{repo}/contributors?per_page=1` — the count is extracted from the `Link` header so we don't paginate the full contributor list when only the count is needed.
- REST `GET /repos/{owner}/{repo}/commits?per_page=100&since=<30d>` — count is the page length; "best-effort" (transient failures keep the rest of the response intact + log a Warn).
404 is surfaced as a typed *xerrors.InputError on "repo" so the M6 retry policy treats it as non-retryable (fail-fast).
Types ¶
This section is empty.