Documentation
¶
Overview ¶
Package releaseapproval describes a release as it moves through the release workflow: the Slack message the workflow posts and keeps up to date, and the summary it shows on the workflow run page.
Index ¶
Constants ¶
const MaxPullRequests = 50
MaxPullRequests caps how many pull requests the message lists, so a large release stays within Slack's message limits.
Variables ¶
var Statuses = []Status{StatusTesting, StatusWaiting, StatusApproved, StatusReleased, StatusFailed, StatusRejected, StatusCanceled}
Statuses lists every valid Status, in the order a release moves through them.
Functions ¶
func Headline ¶ added in v1.55.20
Headline returns a one-line Slack mrkdwn description of r's status. It opens Message, and on its own is the thread reply posted when the status changes.
func Message ¶
Message returns the Slack mrkdwn text describing r and its status, followed by the pull requests it includes. The workflow posts it once and then edits it as the status changes.
Types ¶
type PullRequest ¶
PullRequest is a pull request included in a release.
func ParsePullRequests ¶
func ParsePullRequests(subjects string) []PullRequest
ParsePullRequests extracts the pull requests from commit subjects, one per line, in the order given. Subjects without a trailing "(#123)" are commits pushed without a pull request, and are skipped.
type Release ¶
type Release struct {
ServerURL string // e.g. https://github.com
Repository string // e.g. stripe/stripe-cli
Tag string
PreviousTag string // the latest release before this one
Commit string // full sha of the commit being released
Actor string
RunURL string
TestsURL string // optional: the Test workflow run that passed on Commit
Status Status
Approver string // who approved or rejected the release, if known
// ApproverGroup is the id of the Slack user group that approves releases,
// e.g. S0123ABCD. If set, Reply mentions it once the release is waiting.
ApproverGroup string
PullRequests []PullRequest
}
Release describes a release and where it is in the release workflow.
type Status ¶ added in v1.55.20
type Status string
Status is where a release is in the release workflow.
const ( StatusTesting Status = "testing" StatusWaiting Status = "waiting" StatusApproved Status = "approved" StatusReleased Status = "released" StatusFailed Status = "failed" StatusRejected Status = "rejected" StatusCanceled Status = "canceled" )
The statuses a release moves through. A release starts out testing, while canary tests run, then waits for approval, is approved or rejected, and an approved release ends up released. It can fail or be canceled at any point.