pr

package
v7.36.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractDependencyName added in v7.34.1

func ExtractDependencyName(title string) string

ExtractDependencyName applies clustering algorithms in sequence. Algorithm 1: Pattern-based extraction (primary) Algorithm 2: Version-stripped normalization (fallback) Algorithm 3: Exact title match (last resort)

func MakeHyperlink(url, text string) string

MakeHyperlink creates an ANSI hyperlink (OSC 8) for terminals that support it.

func ParseRepoFromURL

func ParseRepoFromURL(url string) (string, string, error)

ParseRepoFromURL extracts owner and repo name from GitHub PR URL. Example: "https://github.com/giantswarm/backstage/pull/1033" -> "giantswarm", "backstage"

func PrintTableHeader

func PrintTableHeader(w io.Writer, columnHeader string)

PrintTableHeader prints the header for the PR status table. The columnHeader parameter controls the label of the second column (e.g. "Repository" or "Dependency").

func UpdateTable

func UpdateTable(w io.Writer, prStatuses []*PRStatus)

UpdateTable redraws the PR status table. Each PRStatus.DisplayLabel is shown in the second column.

Types

type PRGroup added in v7.26.0

type PRGroup struct {
	Name        string
	PRs         []*PRInfo
	SearchQuery string
}

PRGroup represents a group of related PRs (e.g. by dependency or repository).

func GroupRenovatePRs added in v7.26.0

func GroupRenovatePRs(prs []*PRInfo) []*PRGroup

GroupRenovatePRs clusters PRs by dependency name. Returns groups sorted by PR count (descending). ALL groups are included, even those with only 1 PR.

func GroupRenovatePRsByRepo added in v7.34.1

func GroupRenovatePRsByRepo(prs []*PRInfo) []*PRGroup

GroupRenovatePRsByRepo clusters PRs by repository (owner/repo). Returns groups sorted by PR count (descending).

type PRInfo added in v7.26.0

type PRInfo struct {
	Number int
	Owner  string
	Repo   string
	Title  string
	URL    string
}

PRInfo contains essential information about a PR.

type PRStatus

type PRStatus struct {
	Number       int
	Owner        string
	Repo         string
	Title        string
	URL          string
	Status       string
	DisplayLabel string
	LastUpdate   time.Time
	// contains filtered or unexported fields
}

PRStatus tracks the status of a PR during processing.

func (*PRStatus) GetStatus

func (ps *PRStatus) GetStatus() string

GetStatus returns the current status of a PR in a thread-safe manner.

func (*PRStatus) UpdateStatus

func (ps *PRStatus) UpdateStatus(status string)

UpdateStatus updates the status of a PR in a thread-safe manner.

Jump to

Keyboard shortcuts

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