maintainerconfig

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2026 License: BSD-2-Clause Imports: 15 Imported by: 0

Documentation

Overview

Package maintainerconfig fetches and exposes the .maintainer.yaml bytes for the github-update-go agent's planning step. The schema itself lives in github.com/bborbe/maintainer/maintainerconfig (shared with the github-release watcher and pr-reviewer agent); this package adds ONLY the network seam.

Index

Constants

This section is empty.

Variables

View Source
var ErrFileNotFound = stderrors.New("maintainerconfig: .maintainer.yaml not found at ref")

ErrFileNotFound is returned by Fetch on HTTP 404. Callers use errors.Is(err, ErrFileNotFound) to treat the absent-file case as the default-valued config (same code path as "file absent"). Other errors are NOT covered by this sentinel and must NOT be silently downgraded to a default config.

Sentinel pattern mirrors pkg/githubreview.ErrTagNotFound and pkg/githubauth.ErrAppCredentialsRequired (project convention).

Parse is a thin alias to lib/maintainerconfig.ParseStrict so the agent's planning step fails closed on unknown/typo'd keys. The watcher uses the lenient lib.Parse directly (fleet tolerance — see lib comment on Parse).

Functions

This section is empty.

Types

type Config

Re-export the lib types so callers of this package need only one import for both the schema and the fetcher.

type Fetcher

type Fetcher interface {
	Fetch(ctx context.Context, owner, repo, ref string) ([]byte, error)
}

Fetcher reads .maintainer.yaml bytes from a remote GitHub repo at a ref. Implementations MUST be safe for concurrent use. Returned bytes are the raw decoded file contents (no base64, no JSON wrapper).

HTTP 404 (file absent at the ref's tip) returns the sentinel ErrFileNotFound

func NewHTTPFetcher

func NewHTTPFetcher(token string) Fetcher

NewHTTPFetcher constructs a Fetcher backed by net/http against api.github.com. token is the bearer token (GitHub App IAT or PAT); empty token sends no Authorization header. The internal http.Client has a 15-second timeout — operations that exceed this return a wrapped context-deadline-exceeded error.

type GoUpdateConfig

type GoUpdateConfig = libmaintainerconfig.GoUpdateConfig

Re-export the lib types so callers of this package need only one import for both the schema and the fetcher.

Jump to

Keyboard shortcuts

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