versions

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: MIT Imports: 7 Imported by: 0

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, baseBranch string) *Controller

New creates a Controller. automerge may be nil, and then the pull request waits for somebody.

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.

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)
}

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