Help us shape the future of Go! Take the 2026 Go Developer Survey

batchrelease

package
v0.134.0 Latest Latest
Warning

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

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

Documentation

Overview

Package batchrelease is `rlsbl monorepo release`: run releases several releasables of a workspace as one batch, init writes the batch release file naming them, and order reports the order a batch releases them in.

Every command reads the declarations of the repository holding the working directory and refuses a standalone layout, whose one releasable is released by `rlsbl release run`.

Index

Constants

View Source
const ArchiveCommitPrefix = "chore: archive the batch release file as "

ArchiveCommitPrefix begins the subject of the commit archiving a batch release file.

View Source
const InitCommitMessage = "release: scaffold the batch release file"

InitCommitMessage is the subject of the commit `rlsbl monorepo release init` makes.

View Source
const RootSelfdocCommitMessage = "selfdoc: regenerate (workspace root)"

RootSelfdocCommitMessage is the subject of the commit of what selfdoc wrote at a workspace's root.

Variables

This section is empty.

Functions

func MemberOrder

func MemberOrder(ws *workspace.Workspace) ([]string, *workspace.Graph, error)

MemberOrder is every member of the workspace, each after the members it depends on (its manifests' dependencies on other members and its depends_on); among members ready at once, by name. A manifest that cannot be read and a cycle are refused: the order would leave out a dependency nobody could read.

func ReleasableOrder

func ReleasableOrder(ws *workspace.Workspace, names []string) ([]string, error)

ReleasableOrder is the order a batch release releases the named releasables in: by the latest position any of a releasable's members takes in MemberOrder, so a releasable whose members depend on another releasable's members (a server on the clients its depends_on names) comes after it; ties by name. A name the declarations do not hold is refused, naming the declared releasables.

func Run

func Run(e *strictcli.Effects, req release.RunRequest) (err error)

Run is `rlsbl monorepo release run`: it takes the workspace for the write scope of a batch release (release.Enter with release.WorkspaceWriteScope) and releases the batch in it. Under --dry-run it validates every releasable the batch would release and reports the plan, writing nothing.

Types

type InitResult

type InitResult struct {
	// Path is the batch release file, repository-relative.
	Path string
	// Written is false when a batch release file nobody filled in was there
	// already, so nothing was written.
	Written bool
	// Releasables are the releasables given a table to fill in, and Idle
	// those written commented out, with no unreleased commit since their
	// latest release.
	Releasables []string
	Idle        []string
}

InitResult is what `rlsbl monorepo release init` did.

func Init

func Init(e *strictcli.Effects, liveRoot string, sel Selection, fork release.Fork) (InitResult, error)

Init is `rlsbl monorepo release init`: it writes the batch release file of the workspace whose root is liveRoot, one [releasables.<name>] table per releasable sel selects, with bump and description blank, context blank, every target of the releasable's members in include, and exclude empty, and commits it. A releasable with no unreleased commit since its latest release is written commented out. A batch release file nobody filled in is left as it is; one somebody filled in is refused, never overwritten. fork leaves a fork's upstream history out of the unreleased commits.

type OrderReport

type OrderReport struct {
	// Members are every member, each after the members it depends on.
	Members []string `json:"members"`
	// Independent is true when no member depends on another.
	Independent bool `json:"independent"`
	// Releasables are every releasable, in the order a batch release
	// releases them.
	Releasables []string `json:"releasables"`
}

OrderReport is what `rlsbl monorepo release order` reports.

func Order

func Order(dir string) (OrderReport, error)

Order reports the release order of the workspace holding the absolute directory dir.

func (OrderReport) Render

func (r OrderReport) Render() string

Render is the report as text.

type Selection

type Selection struct {
	Names []string
	All   bool
}

Selection is which releasables `rlsbl monorepo release init` writes a table for: the ones Names lists, or, with All, every declared one. One of the two is stated, never both: no table set is inferred from an empty list.

Jump to

Keyboard shortcuts

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