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

releasecheck

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package releasecheck decides whether a pushed tag may become a tanGO release. The release workflow runs it (see cmd/releasecheck) and creates the GitHub release only when it passes; RELEASING.md describes the whole process.

Index

Constants

This section is empty.

Variables

View Source
var RequiredJobs = []string{"lint", "test (sqlite)", "test (postgres)", "test (mysql)", "cache adapters"}

RequiredJobs are the CI jobs that must all succeed on the exact commit a release tags.

"cache adapters" runs the Redis, Valkey and Memcached conformance suites against the exact server versions the documentation claims, so a release whose adapters were never run against a server cannot be tagged.

Functions

func Check

func Check(ctx context.Context, r Release, s Sources) (string, error)

Check returns the release notes for r — its CHANGELOG.md section — or an error listing every reason r may not be released.

func Skipped added in v0.3.0

func Skipped(r Release) []string

Skipped names the checks r does not get, so a dry run's output says what its pass does not prove.

Types

type CIJob

type CIJob struct {
	Name       string
	Status     string
	Conclusion string
}

CIJob is one job of a CIRun.

func (*CIJob) UnmarshalJSON

func (j *CIJob) UnmarshalJSON(data []byte) error

CIJob decodes from the GitHub API's job objects.

type CIRun

type CIRun struct {
	Status     string // queued, in_progress, completed, ...
	Conclusion string // success, failure, ... once completed
	Jobs       []CIJob
}

CIRun is one CI workflow run and its jobs.

type Live

type Live struct {
	Dir    string       // the git checkout, with main fetched as origin/main
	Repo   string       // owner/name on GitHub
	Module string       // the module path, e.g. github.com/angvp/tango
	Token  string       // a GitHub token that can read Actions runs
	Client *http.Client // nil means http.DefaultClient
	API    string       // "" means https://api.github.com
	Proxy  string       // "" means https://proxy.golang.org
}

Live looks things up in the git checkout, the GitHub Actions API and the Go module proxy.

func (Live) CIRuns

func (l Live) CIRuns(ctx context.Context, commit string) ([]CIRun, error)

CIRuns returns the CI workflow's runs for commit, each with the jobs of its latest attempt.

func (Live) CorpusRegistered added in v0.3.0

func (l Live) CorpusRegistered(ctx context.Context, commit, dir string) (exists, registered bool, err error)

CorpusRegistered reads commit, not the working tree: the fixture directory must be in the tree being tagged, and versions.go at that commit must list it as a generator.

func (Live) OnMain

func (l Live) OnMain(ctx context.Context, commit string) (bool, error)

OnMain asks git whether commit is an ancestor of origin/main.

func (Live) PublishedCommit

func (l Live) PublishedCommit(ctx context.Context, tag string) (string, error)

PublishedCommit asks the Go module proxy which commit it serves for tag.

type Release

type Release struct {
	Tag       string // the pushed tag, e.g. v0.1.1
	Commit    string // the full SHA the tag points to
	Changelog []byte // CHANGELOG.md at that commit
	// Gorelease is gorelease's report comparing the tagged commit with the
	// previous release, or "" if it wasn't run.
	Gorelease string
	// DryRun rehearses a release that cannot be real yet: the commit need
	// not be on main, and the module proxy is never asked about the tag
	// (asking would make it cache "unknown revision" and delay the real
	// release). Every other check runs. Skipped says what was not checked.
	DryRun bool
}

Release is a pushed tag and what the workflow gathered about it.

type Sources

type Sources interface {
	// OnMain reports whether commit is reachable from main.
	OnMain(ctx context.Context, commit string) (bool, error)
	// CIRuns returns every CI workflow run for exactly commit.
	CIRuns(ctx context.Context, commit string) ([]CIRun, error)
	// PublishedCommit returns the commit the Go module proxy already serves
	// for tag, or "" if it doesn't know the tag.
	PublishedCommit(ctx context.Context, tag string) (string, error)
	// CorpusRegistered reports, as of commit, whether the migration-compat
	// fixture directory dir (such as v0_3_0) exists, and whether it is
	// listed in the Generators the Generated-file contract tests read.
	CorpusRegistered(ctx context.Context, commit, dir string) (exists, registered bool, err error)
}

Sources looks up what the tag alone doesn't say.

Directories

Path Synopsis
cmd
releasecheck command
Command releasecheck decides whether a pushed tag may become a tanGO release, and writes its release notes.
Command releasecheck decides whether a pushed tag may become a tanGO release, and writes its release notes.

Jump to

Keyboard shortcuts

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