consolidate

package
v0.15.13 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package consolidate moves every package from a branch of its own onto the default branch.

It is done once. Each package was kept on an orphan branch, pkg_<id>, and is kept under pkgs/<shard>/<id>/ on the default branch from now on (aquaproj/aqua-registry-g2#695). The move is one pull request that names the objects the branches already hold, so it uploads nothing and changes no byte of what any package serves.

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 moves the packages.

func New

func New(registry Registry) *Controller

New creates a Controller.

func (*Controller) Consolidate

func (c *Controller) Consolidate(ctx context.Context, logger *slog.Logger, dryRun bool) error

Consolidate opens the pull request that moves every package onto the default branch.

Running it again is safe: an entry naming the object already at its path changes nothing, and the head branch is written again from the default branch's tip.

type Registry

type Registry interface {
	LegacyPackages(ctx context.Context) ([]*g2.LegacyPackage, error)
	BranchSHA(ctx context.Context, branch string) (string, error)
	CommitEntries(ctx context.Context, branch, parent, message string, entries []*gogithub.TreeEntry) error
	CreatePullRequestFrom(ctx context.Context, logger *slog.Logger, head, base, title, body string) (*gogithub.PullRequest, error)
}

Registry is what the move reads and writes.

Jump to

Keyboard shortcuts

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