versions

package
v0.15.41 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 7 Imported by: 1 module, 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 versions brings the packages' lists of versions up to date with what the registry holds.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoMerger added in v0.15.0

type AutoMerger interface {
	EnableAutoMerge(ctx context.Context, pullRequestID string) error
}

AutoMerger turns on auto-merge for a pull request.

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

Controller updates the lists of versions.

func New

func New(registry Registry, automerge AutoMerger, blobs g2.Blobs, baseBranch string) *Controller

New creates a Controller. automerge may be nil, and then the pull request waits for somebody. blobs reads the lists when no ids are given, to find the ones behind.

func (*Controller) DryRun added in v0.15.0

func (c *Controller) DryRun()

DryRun makes Update say which lists are behind and commit nothing.

func (*Controller) Update added in v0.15.0

func (c *Controller) Update(ctx context.Context, logger *slog.Logger, ids []string) error

Update makes the versions.json of each package whose id is given say what its versions directory on the base branch holds, in one pull request.

A pull request adding a version leaves the package's list alone, because two of them open for one package would conflict on it. So the list falls behind when one merges, and this is what brings it up: it is run for the packages a merge touched.

Each list is made from the base branch, and committed onto the open pull request when there is one, which only ever changes lists: what it holds of an older base is replaced by what the base holds now, and nothing else the base gained since is touched.

No ids means every package whose list is behind. With a pull request open, behind is asked of the lists it holds rather than of the base branch's, since a list it already brings up to date has nothing left to do.

type Registry

type Registry interface {
	VersionsListFile(ctx context.Context, logger *slog.Logger, ref, id string) (*g2.File, error)
	File(ctx context.Context, ref, path string) (string, error)
	BranchSHA(ctx context.Context, branch string) (string, error)
	Commit(ctx context.Context, branch, parent, message string, files []*g2.File) error
	VersionsPullRequest(ctx context.Context) (*gogithub.PullRequest, error)
	CreateVersionsPullRequest(ctx context.Context, logger *slog.Logger, base, title, body string) (*gogithub.PullRequest, error)
	StaleVersionsLists(ctx context.Context, logger *slog.Logger, blobs g2.Blobs, listRef string) ([]string, error)
}

Registry is the part of aqua-registry-g2 an update of the lists reads and writes.

Jump to

Keyboard shortcuts

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