scope

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 5 Imported by: 1 module, 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 scope turns the configured sources into the people, teams and repositories the inventory follows, and the searches that find them.

Index

Constants

View Source
const MaxQueryLen = 250

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	People []string `json:"people"`
	Teams  []string `json:"teams"`
	Repos  []string `json:"repos"`
	Watch  []string `json:"watch"`
}

Config is the scope [plugins.github.scope] configures.

type Query

type Query struct {
	Reason string // author, review-requested, team-review-requested, watch, repo, discover
	Q      string
}

type Resolved

type Resolved struct {
	People []string // sorted, lower-case, unique: scope people plus team members
	Teams  []string
	// MyTeams are the teams of Teams the viewer belongs to.
	MyTeams []string
	Repos   []string // sorted, unique; the slow sweep appends discovered ones
	Watch   []string
	Viewer  string
}

func Resolve

func Resolve(ctx context.Context, cfg Config, viewer string, teams TeamReader) (Resolved, []error)

func (Resolved) ClosedQueries

func (r Resolved) ClosedQueries(since time.Time) []Query

ClosedQueries find the pull requests of the area and of the scope repositories closed or merged since the given instant.

func (Resolved) DiscoveryQueries

func (r Resolved) DiscoveryQueries(since time.Time) []Query

DiscoveryQueries find where the area opened pull requests since the given instant, any state.

func (*Resolved) Normalize

func (r *Resolved) Normalize()

Normalize sorts and dedupes every list.

func (Resolved) Queries

func (r Resolved) Queries(since time.Time) []Query

Queries builds the searches of a fast sweep. With a zero since they list the open pull requests; otherwise they return the pull requests updated at or after since in any state, so a close or merge in the window is seen. Every query stays under MaxQueryLen.

func (Resolved) Reasons

func (r Resolved) Reasons(author, ownerRepo string, requested []string) []string

type TeamReader

type TeamReader interface {
	TeamMembers(ctx context.Context, org, slug string) ([]string, error)
}

Jump to

Keyboard shortcuts

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