Documentation
¶
Overview ¶
Package remove stops the registry serving a package.
Which it doesn't do as a rule. What the registry promises is that a version it has published stays what it was, and a package it holds is a package somebody's configuration may name; removing one breaks that for whoever pinned it. The exceptions are a package that can't be installed by aqua whatever is generated for it, and malware, which goes without asking.
So it isn't ignoring a package, which is a package the registry never took on and never published. It is three things at once: the registry stops generating the package, stops listing it, and stops holding what it generated. Any one of them alone leaves a state nobody meant -- an entry for a package that can't be fetched, or files nothing lists that the next run adds to -- so they are one command.
What it cannot reach is a lock file. One that already holds the package carries the URL and the checksum of every file it needs, which is the point of it, and no change here takes that away. For malware, saying so where people will read it is the part that matters; this is only the part the registry can do.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller removes packages.
func (*Controller) Remove ¶
Remove opens the pull requests that stop the registry serving the package.
Two of them, because they are on different branches: the registry's configuration and the catalogue are on the default branch, and what was generated is on the package's. The first has to merge first -- a package still in the order has its files generated again by the next run -- so it is opened first and the second says so.
type Input ¶
type Input struct {
PkgName string
// Reason is why the registry stops serving it, in prose. It is what the ignored
// list carries, and the next person to wonder why the package isn't here reads
// that and nothing else.
Reason string
}
Input is the package to stop serving.
type PullRequests ¶ added in v0.14.2
type PullRequests interface {
CreatePullRequestFrom(ctx context.Context, logger *slog.Logger, head, base, title, body string) (*gogithub.PullRequest, error)
Label(ctx context.Context, logger *slog.Logger, number int, name string)
}
PullRequests is how a removal's pull requests are opened and marked.
type Registry ¶
type Registry interface {
PackagesInFlight(ctx context.Context) (map[string]struct{}, error)
File(ctx context.Context, ref, path string) (string, error)
Index(ctx context.Context, ref string) (*aquag2.Index, error)
BranchSHA(ctx context.Context, branch string) (string, error)
VersionFiles(ctx context.Context, pkgName string) ([]string, error)
// HeadBranch and RemoveBranch are the branches a removal's pull requests are opened
// from. They are named after the package's id, so they answer false for a package the
// registry doesn't hold -- which is a removal with nothing to do.
HeadBranch(pkgName string) (string, bool)
RemoveBranch(pkgName string) (string, bool)
Commit(ctx context.Context, branch, parent, message string, files []*g2.File) error
CommitPackage(ctx context.Context, logger *slog.Logger, pkgName, branch, parent, message string, files []*g2.File) error
PullRequests
}
Registry is what a package is removed from.