Documentation
¶
Index ¶
- Variables
- func CheckIncludedPR(pr *ReleasePR, milestones []Milestone, baseline string) error
- func CheckMilestonePR(pr *ReleasePR, milestones []Milestone, baseline string) error
- func MilestoneVersion(title string) (*semver.Version, error)
- func Pages[T any](c *Client, path string) ([]T, error)
- func ReleaseLabel(pr *ReleasePR) (string, error)
- func RequiredBump(baseline, target string) (string, error)
- type Client
- func (c *Client) CheckReleaseHistory(milestones []Milestone, baseline string) error
- func (c *Client) CompareCommits(base, head string) ([]string, error)
- func (c *Client) Get(path string, out any) error
- func (c *Client) LatestStable() (string, error)
- func (c *Client) ListMilestones() ([]Milestone, error)
- func (c *Client) OpenPRs(base string) ([]ReleasePR, error)
- func (c *Client) ReleaseChanges(baseline, head, branch string) ([]PullRequest, error)
- func (c *Client) Write(method, path string, body any) error
- type Milestone
- type MilestoneChange
- type Milestones
- type PullRequest
- type ReleasePR
Constants ¶
This section is empty.
Variables ¶
var ErrMilestonePolicy = errors.New("release milestone policy")
ErrMilestonePolicy means a PR is not eligible for the current release train.
Functions ¶
func CheckIncludedPR ¶
CheckIncludedPR reports why an already merged PR makes the next release invalid.
func CheckMilestonePR ¶
CheckMilestonePR enforces both ordering and minimum compatibility level. The no-release label is the sole exemption; drafts and bot PRs have no implicit bypass.
func MilestoneVersion ¶
MilestoneVersion accepts complete stable versions, with an optional v prefix. Prereleases derive from a stable milestone; planning milestones are not versions.
func ReleaseLabel ¶
func RequiredBump ¶
RequiredBump compares the milestone with the published stable baseline. Labels constrain compatibility; they never select, increment or replace this version.
Types ¶
type Client ¶
func (*Client) CheckReleaseHistory ¶
CheckReleaseHistory rejects milestones that cannot contain the unreleased changes already on the default branch. It never mutates release intent.
func (*Client) CompareCommits ¶
CompareCommits returns the complete source delta from a published baseline.
func (*Client) LatestStable ¶
func (*Client) ListMilestones ¶
func (*Client) ReleaseChanges ¶
func (c *Client) ReleaseChanges(baseline, head, branch string) ([]PullRequest, error)
ReleaseChanges resolves merged PRs from the exact commit range, including pagination and deduplication. Direct commits and incomplete evidence fail closed.
type Milestone ¶
type Milestone struct {
Number int `json:"number"`
Title string `json:"title"`
State string `json:"state"`
}
Milestone identifies a GitHub milestone independently of its mutable title.
func NextMilestone ¶
NextMilestone returns the lowest open stable version. Non-versioned planning milestones are ignored. Equivalent version titles are ambiguous, never ordered by creation time, due date, API order or lexical comparison.
type MilestoneChange ¶
MilestoneChange is a proposed minor-milestone mutation. A zero Number creates a milestone; a positive Number reopens that existing, unpublished milestone.
func MinorMilestoneWindow ¶
func MinorMilestoneWindow(baseline string, milestones []Milestone) ([]MilestoneChange, error)
MinorMilestoneWindow maintains exactly the next three minor slots after the latest stable version. It never creates patch/major versions or closes/deletes any manually maintained milestones (including farther-future minor versions).
type Milestones ¶
Milestones groups milestone lifecycle and merge-policy Mage targets.
func (Milestones) Check ¶
func (Milestones) Check(repo string) error
Check reconciles PR-head and merge-queue statuses using live metadata. It never checks out or executes a PR's source. Require the Release milestone status in branch protection/rulesets to enforce this policy at merge time.
func (Milestones) Create ¶
func (Milestones) Create(repo, version string) error
CreateMilestone creates a manually chosen patch, minor or major milestone. Repeating the operation reuses the exact semantic version; labels never pick it.
func (Milestones) Ensure ¶
func (Milestones) Ensure(repo string) error
EnsureMinorMilestones keeps the next three minor milestones open. Patch and major milestones are created only through the explicit CreateMilestone target.
func (Milestones) Run ¶
func (Milestones) Run(repo, operation, version string) error
Run is the action adapter. Invalid operations fail before any API request; workflow YAML only transports arguments, never implements dispatch policy.
type PullRequest ¶
type PullRequest struct {
ReleasePR
Title string `json:"title"`
Body string `json:"body"`
Merged bool `json:"merged"`
MergeCommit string `json:"merge_commit_sha"`
User struct {
Login string `json:"login"`
} `json:"user"`
}
PullRequest includes the live metadata and notes of an associated commit.
type ReleasePR ¶
type ReleasePR struct {
Number int `json:"number"`
State string `json:"state"`
Milestone *Milestone `json:"milestone"`
Labels []struct {
Name string `json:"name"`
} `json:"labels"`
Head struct {
SHA string `json:"sha"`
} `json:"head"`
Base struct {
Ref string `json:"ref"`
} `json:"base"`
}
ReleasePR is the live metadata needed by the merge and release checks.