apply

package
v0.21.4 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package apply implements the `apply` verb: carry what a commit asserted to the forge object it names.

Index

Constants

This section is empty.

Variables

View Source
var ErrInstructionsFailed = errors.New("apply: some instructions were not carried")

ErrInstructionsFailed reports a run that carried what it could and had at least one instruction the forge refused.

The run is still complete: every other instruction was applied and the report names each one. This exists so the outcome reaches the pipeline as well as the log, which it did not before — a job whose only instruction failed went green, and the drift it existed to prevent happened anyway (spec 0022 D3, colophon#28).

View Source
var ErrUnknownForge = errors.New("apply: unrecognised forge host")

ErrUnknownForge reports a remote whose forge could not be identified.

Functions

func CapabilitiesFrom

func CapabilitiesFrom(provider forge.Provider) deps

CapabilitiesFrom discovers the three capabilities a provider offers. Any may be missing: Bitbucket has merge-request comments and neither issues nor a wiki.

func NewCmdApply

func NewCmdApply(props *props.Props) *setup.Command

func Run

func Run(ctx context.Context, p *props.Props, opts *ApplyOptions, w io.Writer) error

Run is RunApply with its output injected.

func RunApply

func RunApply(ctx context.Context, p *props.Props, opts *ApplyOptions, _ []string) error

RunApply is the `apply` verb.

Types

type ApplyOptions

type ApplyOptions struct {
	Repo   string
	Remote string
	Forge  string
	From   string
	To     string
}

type Options

type Options struct {
	Repo   string
	Remote string
	Forge  string

	// From and To bound the commits this run reads. From empty, or the
	// all-zero SHA a forge sends for the first push to a branch, means the
	// tip alone (spec 0012 D6).
	From string
	To   string
}

Options are the command's inputs.

type Prepared

type Prepared struct {
	Request apply.Request

	Forge remote.Remote
}

Prepared is everything resolved before a forge is touched.

func Build

func Build(opts Options) (Prepared, error)

Build reads the span and the trailers in it, without touching a forge.

Jump to

Keyboard shortcuts

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