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 ¶
- Variables
- func Check(ctx context.Context, r Release, s Sources) (string, error)
- func Skipped(r Release) []string
- type CIJob
- type CIRun
- type Live
- func (l Live) CIRuns(ctx context.Context, commit string) ([]CIRun, error)
- func (l Live) CorpusRegistered(ctx context.Context, commit, dir string) (exists, registered bool, err error)
- func (l Live) OnMain(ctx context.Context, commit string) (bool, error)
- func (l Live) PublishedCommit(ctx context.Context, tag string) (string, error)
- type Release
- type Sources
Constants ¶
This section is empty.
Variables ¶
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 ¶
Types ¶
type CIJob ¶
CIJob is one job of a CIRun.
func (*CIJob) UnmarshalJSON ¶
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 ¶
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.
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. |