migrate

package
v0.0.41 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package migrate converts aqua-registry's package definitions into the form aqua-registry-g2 keeps them in.

The two registries say the same things about a package; they order them differently. v1 lists version_overrides oldest first and ends with a catch-all, because entries were appended as upstream changed. g2 lists them newest first, so that adding a rule is an insertion at the top and leaves every existing entry untouched, which is what makes the file something a tool can maintain.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Attestations

Attestations writes the signing workflow under the name aqua reads first.

aqua-registry still holds entries written as signer-workflow, which aqua accepts and has deprecated. A registry being written now has no reason to carry the old spelling into its first version of a file.

being translated away from.

func Config

func Config(pkgName string, base *aquaregistry.PackageInfo, scaffold *genrgst.RawConfig) (*g2.Config, []string)

Config builds a package's aqua-registry-g2 definition from its aqua-registry one.

The second return value names the constraints that couldn't be turned into a boundary. The result is still usable, but what those entries matched in v1 isn't what they match here, so a person has to look at them.

func ReverseVersionOverrides

func ReverseVersionOverrides(overrides []*aquaregistry.VersionOverride) ([]*aquaregistry.VersionOverride, []string)

ReverseVersionOverrides returns the overrides in g2's order.

Reversing the list is not enough on its own. v1's entries carry upper bounds and rely on being read top down, so the smallest bound that matches wins; read from the other end, the largest bound swallows every version below it. Each entry therefore takes the bound of the entry below it as its own lower bound, which is the boundary v1 expressed by position.

An entry that names versions instead of bounding them — Version == "v0.5.15", or semver("= 0.5.0") — is not part of that chain. It can't give the entry above it a bound, and reversed it sinks below the ranges, which then answer for the very version it was written for: Aloxaf/silicon's v0.5.0 took the entry meant for everything newer and looked for pc-windows-gnu instead of pc-windows-msvc.

So those entries are lifted out and put first, where matching one version means answering for that version and nothing else. What is left is a chain of bounds with no gaps in it, which is what the derivation needs.

The catch-all at the end of a v1 list becomes the first of the ranges and gains a lower bound in the same way, so it is evaluated like any other. g2 also falls back to the first entry when nothing matches, which is what answers a version that isn't a semver at all.

The second return value names the constraints that were lifted out without naming a version — a compound range, say. Those matched more than one version, so where they sit changes what they answer for, and a person has to look.

Types

This section is empty.

Jump to

Keyboard shortcuts

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