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 ¶
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).
var Parse = libmaintainerconfig.Parse
Parse is a thin alias to the lenient lib/maintainerconfig.Parse. The agent's planning step must tolerate a .maintainer.yaml carrying fields this binary's pinned maintainerconfig does not define yet — e.g. dockerBuild.pushSecret / dockerBuild.deadlineSeconds, which the github-release watcher's build job consumes. ParseStrict applies KnownFields(true) inside every namespace it knows and rejects exactly those, aborting the whole run with invalid_config before the Go-target decision — so an upstream schema addition would silently disable the Go-update sweep for that repo. The github-release watcher uses the same lenient Parse. Tradeoff accepted: a typo'd key inside a known namespace is now ignored rather than failing closed — a silent default is recoverable, a spurious invalid_config is not.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config = libmaintainerconfig.MaintainerConfig
Re-export the lib types so callers of this package need only one import for both the schema and the fetcher.
type Fetcher ¶
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 ¶
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.