prfilter

package
v0.8.5 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package prfilter holds the Model-independent PR-list domain logic: the GitHub-search-like filter query DSL, the CI health it filters on, and base/head stack grouping.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CIHealth

func CIHealth(pr gh.PR) string

CIHealth is the health word the ci: filter matches on, falling back to the list rollup state when the individual checks have not been loaded yet.

func CheckCounts

func CheckCounts(checks []gh.PRCheck) (pending, failed, passed int)

CheckCounts buckets a PR's checks into pending, failed, and passed.

func CheckHealth

func CheckHealth(checks []gh.PRCheck) (string, int)

CheckHealth reduces a PR's checks to one health word and the count that decided it: any failure wins, then anything pending, then passes.

func Matches

func Matches(pr gh.PR, query, viewer string) bool

Matches evaluates a GitHub-search-like query against one PR. Parenthesized alternatives — "(assignee:@me OR review-requested:@me)" — match when any alternative matches; everything else is ANDed.

func Split

func Split(query string) (server, local string)

Split partitions a filter query into the part GitHub's search evaluates server-side and the part that has to be applied locally.

Types

type Stack

type Stack struct {
	ID    string
	Title string

	Entries []StackEntry
	// contains filtered or unexported fields
}

Stack groups the PRs that chain onto one root via base/head branches.

func BuildStacks

func BuildStacks(prs []gh.PR) []Stack

BuildStacks groups PRs whose base branch is another PR's head branch into stacks, walking the exact base/head graph.

func SingleStacks

func SingleStacks(prs []gh.PR) []Stack

SingleStacks wraps each PR in its own stack, for lists (like closed PRs) where base/head grouping is meaningless.

type StackEntry

type StackEntry struct {
	PR    gh.PR
	Depth int
}

StackEntry is one PR inside a stack, at its depth in the base/head chain.

Jump to

Keyboard shortcuts

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