base

package
v1.2.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2026 License: MIT Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
const Name = "base"

Name is the canonical plugin slug.

Variables

View Source
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:

  1. GraphQL `Repository(login, repo)` — owner / name / counts / license / default branch / open-issue + open-PR totals.
  2. 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.
  3. 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).

func SetNowForTest added in v1.2.0

func SetNowForTest(fn func() time.Time) func()

SetNowForTest overrides the lifetime commit clock and returns a restore function.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL