issues

package
v0.3.10 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusReady      = "herd/status:ready"
	StatusInProgress = "herd/status:in-progress"
	StatusDone       = "herd/status:done"
	StatusFailed     = "herd/status:failed"
	StatusBlocked    = "herd/status:blocked"
	StatusCancelled  = "herd/status:cancelled"
)

Status labels (mutually exclusive)

View Source
const (
	// CIFixPending is added to a batch PR when the monitor posts /herd fix-ci.
	// It is removed once CI passes, allowing future failures to re-trigger the command.
	CIFixPending = "herd/ci-fix-pending"

	// RetryPending is added to a failed issue when the monitor posts /herd retry.
	// It is removed by the retry handler, preventing duplicate retry comments
	// when two patrol runs execute before the first retry is processed.
	RetryPending = "herd/retry-pending"

	// RebasePending is added to a batch PR when the monitor detects a merge
	// conflict with the base branch and dispatches a rebase conflict resolution
	// worker. It is removed once the conflict is resolved (PR becomes mergeable
	// again), preventing duplicate dispatches from concurrent patrol runs.
	RebasePending = "herd/rebase-pending"
)

PR state labels

View Source
const (
	TypeFeature = "herd/type:feature"
	TypeBugfix  = "herd/type:bugfix"
	TypeFix     = "herd/type:fix"
	TypeManual  = "herd/type:manual"
)

Type labels

Variables

This section is empty.

Functions

func AllStatusLabels

func AllStatusLabels() []string

AllStatusLabels returns all status labels.

func AllTypeLabels

func AllTypeLabels() []string

AllTypeLabels returns all type labels.

func HasLabel

func HasLabel(labels []string, label string) bool

HasLabel returns true if the label list contains the given label.

func IsStatusLabel

func IsStatusLabel(label string) bool

IsStatusLabel returns true if the label is a herd status label.

func RenderBody

func RenderBody(body IssueBody) string

RenderBody generates the full issue body from structured data.

func StatusLabel

func StatusLabel(labels []string) string

StatusLabel returns the status label from a list of labels, or empty string.

func ValidateTransition

func ValidateTransition(from, to string) error

ValidateTransition checks whether transitioning from one status to another is allowed.

Types

type FrontMatter

type FrontMatter struct {
	Version             int      `yaml:"version"`
	Batch               int      `yaml:"batch,omitempty"`
	DependsOn           []int    `yaml:"depends_on,omitempty"`
	Scope               []string `yaml:"scope,omitempty"`
	EstimatedComplexity string   `yaml:"estimated_complexity,omitempty"`
	RunnerLabel         string   `yaml:"runner_label,omitempty"`
	// Integrator-generated fields
	Type                string   `yaml:"type,omitempty"`
	FixCycle            int      `yaml:"fix_cycle,omitempty"`
	BatchPR             int      `yaml:"batch_pr,omitempty"`
	CIFixCycle          int      `yaml:"ci_fix_cycle,omitempty"`
	ConflictResolution  bool     `yaml:"conflict_resolution,omitempty"`
	ConflictingBranches []string `yaml:"conflicting_branches,omitempty"`
}

FrontMatter holds the YAML front matter fields for a herd issue.

type IssueBody

type IssueBody struct {
	FrontMatter           FrontMatter
	Task                  string
	ImplementationDetails string
	Conventions           []string
	ContextFromDeps       []string
	Criteria              []string
	Context               string
	ConversationHistory   string
	FilesToModify         []string
}

IssueBody holds the parsed content of a herd issue body.

func ParseBody

func ParseBody(raw string) (*IssueBody, error)

ParseBody parses a herd issue body into structured data.

type LabelDef

type LabelDef struct {
	Name        string
	Color       string
	Description string
}

LabelDef defines a label with its name, color, and description.

func AllLabels

func AllLabels() []LabelDef

AllLabels returns all herd labels.

Jump to

Keyboard shortcuts

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