patterns

package
v0.43.1-rc.2 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package patterns reads back the unhandled-failure markers the sweep writes on pull requests, and groups them by signature.

A sweep run groups the failures no rule recognised in memory and prints the groups; the run then ends and the grouping ends with it. The markers stay on the pull requests, so they are what a later command reads: the skeleton `marge rules draft` builds, and the count that says whether a pattern is seen often enough to be worth a rule.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Known

func Known(groups []Group) string

Known renders the signatures a search found, for the message that says a wanted one is not among them.

Types

type Group

type Group struct {
	Signature string
	Checks    []string
	// Excerpt is the log the first marker of the group recorded. Every
	// marker of one signature describes the same failure, so one excerpt
	// is enough to build a rule against.
	Excerpt string
	Count   int
	PRs     []string
	// LastSeen is the newest marker of the group.
	LastSeen time.Time
}

Group is one shape of failure, with the pull requests that carry it.

type Search struct {
	Client *github.Client
	Org    string
	// Since bounds the search to pull requests updated on or after it, and
	// drops markers written before it. A zero time reads the whole history
	// the search returns.
	Since time.Time
}

Search finds the markers over one organization.

func (Search) Signature

func (s Search) Signature(ctx context.Context, signature string) (*Group, error)

Signature returns the group of one signature, or nil when no pull request carries it.

func (Search) Top

func (s Search) Top(ctx context.Context) ([]Group, error)

Top returns every signature the search finds, the one on the most pull requests first.

Jump to

Keyboard shortcuts

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