rollout

package
v0.182.2 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: BSD-3-Clause Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package rollout holds what the commands that land one change as a pull request per repository (`dashfix`, `orgedit`) share: the subprocess seam, the hourly ledger, the REST reserve check and the wait for a pushed head.

Index

Constants

This section is empty.

Variables

View Source
var (
	HeadPollEvery = 5 * time.Second
	HeadPollTries = 24
)

Overridable by tests.

Functions

func Budget

func Budget(stderr io.Writer, name string, l Ledger, reserve, max int) int

Budget refuses to start another pull request when the REST reserve is spent or the hourly cap is reached; an unreadable answer is a refusal too. It returns 0 to go on and 2 to stop, after saying why on stderr as `name: ...`.

func Call

func Call(dir, name string, args ...string) (string, error)

Call runs a program with stdin closed. A non-zero exit is an error carrying the program's own words. Tests fake the programs by putting stand-ins first on PATH.

func HeadIs

func HeadIs(repo, number, want string) error

HeadIs waits until the pull request's head is the commit just pushed. ⛔ prwait judges the head it reads, and right after a push GitHub still answers the old one: measured on go-ndarray/.github#25, where prwait judged the previous, red head and the run stopped on a fix that was in fact green.

Types

type Ledger

type Ledger struct {
	Path string
	Now  func() time.Time
}

Ledger records one merged pull request per line: unix seconds, a space, the target.

func (Ledger) InLastHour

func (l Ledger) InLastHour() (int, error)

InLastHour counts lines newer than an hour. A missing ledger is zero; an unreadable line is an error.

func (Ledger) Record

func (l Ledger) Record(target string) error

Record appends a line for target.

Jump to

Keyboard shortcuts

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