sourcecontrol

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: MIT Imports: 21 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

Index

Constants

View Source
const (
	PendingReviewKind = "Pending Review"
	ReReviewKind      = "Re-review"
	ReviewedKind      = "Reviewed"
	CommitKind        = "Commit"
)
View Source
const SectionCount = 4

Variables

View Source
var ErrCloneInProgress = errors.New("the running review is still cloning; try again shortly")
View Source
var ReviewNoteStates = map[string]bool{"APPROVED": true, "CHANGES_REQUESTED": true, "COMMENTED": true}

Functions

func ClonePR

func ClonePR(ctx context.Context, root string, pr review.QueuedPR) (string, error)

func ConfiguredRepoNames

func ConfiguredRepoNames(cfg *config.Config) map[string]bool

func FetchLocalCommitsBetween

func FetchLocalCommitsBetween(ctx context.Context, cfg *config.Config, since, until time.Time) map[string][]PRItem

func FetchLocalCommitsForDays

func FetchLocalCommitsForDays(ctx context.Context, cfg *config.Config, dates ...time.Time) []map[string][]PRItem

func FilterQueuedPRs

func FilterQueuedPRs(prs []review.QueuedPR, allowed map[string]bool) []review.QueuedPR

func FilterReviewRecords

func FilterReviewRecords(reviews []review.ActivityPR, allowed map[string]bool) []review.ActivityPR

func RepoNameAllowed

func RepoNameAllowed(repository string, allowed map[string]bool) bool

func RepoScopes

func RepoScopes(cfg *config.Config) map[string][]string

func ReviewRecord

func ReviewRecord(pr review.QueuedPR, state string, reviewedAt time.Time) review.ActivityPR

func SortItems

func SortItems(items []PRItem, activeSort Sort)

func Sync

func Sync(ctx context.Context, params SyncParams) <-chan Section

Types

type Day

type Day int
const (
	Today Day = iota
	Yesterday
)

type DayResult

type DayResult struct {
	Day         Day
	Date        string
	Reviewed    []PRItem
	Reviews     []review.ActivityPR
	Details     map[string]json.RawMessage
	FailedHosts []string
	Err         error
}

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

func NewEngine

func NewEngine(cfg *config.Config) *Engine

func (*Engine) AuthoredPRs

func (e *Engine) AuthoredPRs(ctx context.Context, start, end time.Time) ([]review.QueuedPR, []review.QueuedPR, error)

func (*Engine) FetchDay

func (e *Engine) FetchDay(ctx context.Context, day Day, date time.Time) DayResult

func (*Engine) FetchMyPRs

func (e *Engine) FetchMyPRs(ctx context.Context, known []review.PRRef) MyPRsResult

func (*Engine) FetchPendingPRs

func (e *Engine) FetchPendingPRs(ctx context.Context, activeSort Sort) PendingResult

type MyPRsResult

type MyPRsResult struct {
	PRs         []review.QueuedPR
	Closed      map[string]string
	StartedAt   time.Time
	FailedHosts []string
	Err         error
}

type PRItem

type PRItem struct {
	Title      string `json:"title"`
	URL        string `json:"url"`
	Kind       string `json:"kind"`
	Number     int    `json:"number"`
	Repository string `json:"repository,omitempty"`

	PR *review.QueuedPR `json:"-"`
}

func FilterPRItems

func FilterPRItems(items []PRItem, allowed map[string]bool) []PRItem

func NewPRItem

func NewPRItem(pr review.QueuedPR, kind string) PRItem

type PendingResult

type PendingResult struct {
	Items       []PRItem
	Details     map[string]json.RawMessage
	StartedAt   time.Time
	FailedHosts []string
	Err         error
}

type Section

type Section struct {
	Day     *DayResult
	Pending *PendingResult
	MyPRs   *MyPRsResult
}

type Sort

type Sort struct {
	ByCreated bool `json:"by_created"`
	Ascending bool `json:"ascending"`
}

type SyncParams

type SyncParams struct {
	Config      *config.Config
	Today       time.Time
	PreviousDay time.Time
	Sort        Sort
	KnownMyPRs  []review.PRRef
}

Jump to

Keyboard shortcuts

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