Documentation
¶
Overview ¶
Package tidy takes out of the definitions on the package branches what a release can be read for.
The conversion stopped writing it in, so a definition written since says only the part a release can't answer. The ones written before still say the rest, and nothing else would ever reach them: a definition is read on every generation and rewritten on none.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Args ¶
type Args struct {
// Packages limits the tidy to the ones named. Empty is every package the registry
// holds a definition of.
Packages []string
// Limit bounds how many pull requests one run opens. A pull request per package is
// what one branch per package makes of a change to them all.
Limit int
// DryRun says what would change and writes nothing.
DryRun bool
}
Args are the command's own options.
type AutoMerger ¶
AutoMerger turns a pull request over to its checks.
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller tidies definitions.
func New ¶
func New(registry Registry, defs Definitions, automerge AutoMerger) *Controller
New creates a Controller. automerge may be nil, and then the pull requests wait for someone.
type Definitions ¶
type Definitions interface {
Files(ctx context.Context, logger *slog.Logger, prefix, path string) (map[string]string, error)
}
Definitions reads every package branch's definition in one pass.
type Registry ¶
type Registry interface {
File(ctx context.Context, ref, path string) (string, error)
PackagesInFlight(ctx context.Context) (map[string]struct{}, error)
BranchSHA(ctx context.Context, branch string) (string, error)
Commit(ctx context.Context, branch, parent, message string, files []*g2.File) error
CreatePullRequest(ctx context.Context, pkgName, title, body string) (*gogithub.PullRequest, error)
}
Registry is what a tidy reads and writes.