relctl

package
v0.17.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package relctl drives and observes the release process from a terminal.

Release state is spread across three workflows, the tag graph and the release list, with no single place to see it. That is what this exists to be. The workflows remain the interface, and dispatching them with `gh` remains correct and remains the fallback when this tool is wrong, absent, or asked to do something it does not cover.

Index

Constants

View Source
const (
	// OutputText is the human-facing default.
	OutputText = "text"
	// OutputJSON is for scripting.
	OutputJSON = "json"
	// OutputGitHub emits key=value lines for $GITHUB_OUTPUT.
	//
	// Exists so the release workflows can call relctl in place of the shell
	// they used to, without their downstream steps changing at all.
	OutputGitHub = "github"
)

Output formats relctl can produce.

Variables

This section is empty.

Functions

func Root

func Root() *cobra.Command

Root builds the command tree.

func Run

func Run()

Run executes the root command and exits non-zero on failure.

The work happens in run so that deferred cleanup actually runs: os.Exit skips defers, so calling it here directly would leave the signal handler uninstalled on every failing invocation.

Types

type Options

type Options struct {
	// Repo is the owner/name slug commands talk to.
	Repo string
	// RepoPath is the local clone version resolution reads.
	//
	// Exists because release-prepare runs relctl built from main against a
	// RELEASE BRANCH's history: the branch supplies the history, main supplies
	// the tooling that computes against it. Getting this wrong resolves the
	// wrong series and is the sort of thing that only shows up at release time.
	RepoPath string
	// Output is text, json or github.
	Output string
	// Token supplies the GitHub credential. Nil means the ordinary lookup:
	// GITHUB_TOKEN, then an existing gh login.
	//
	// A seam rather than a flag, so tests need no ambient credential. Without
	// it the command tests passed on a machine with gh logged in and failed in
	// CI, which is the environment dependency they were written to avoid.
	Token gh.TokenSource
	// BaseURL points the GitHub client at another API root.
	//
	// Exists so command-level tests can aim status, preflight and watch at an
	// httptest server. Without it those three could only be exercised against
	// the real API, which is why they arrived untested while next, the one
	// command needing no client, did not.
	BaseURL string
}

Options carry the flags every command shares.

Directories

Path Synopsis
Package gh talks to the GitHub REST API on behalf of relctl.
Package gh talks to the GitHub REST API on behalf of relctl.
Package version resolves what a branch is allowed to release, and what the next tag on it should be.
Package version resolves what a branch is allowed to release, and what the next tag on it should be.

Jump to

Keyboard shortcuts

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