situation

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: Apache-2.0 Imports: 8 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 situation derives who a pull request is waiting on, and since when, from its snapshot and its event history.

Index

Constants

View Source
const NudgeWindow = 2 * time.Hour

NudgeWindow bounds how long after a nudge is asked for its comment can be posted: the agent reads the pull request first.

View Source
const ReasonMax = 200

ReasonMax bounds a reason that comes from an agent or a CI, so a row and a notification stay one line.

Variables

Order is every kind as the cockpit ranks them: what needs the user first.

Functions

func WorkingDuration

func WorkingDuration(from, to time.Time) time.Duration

WorkingDuration counts the time between from and to, leaving out Saturdays and Sundays. Both instants are taken in UTC so the day boundaries agree.

Types

type Input

type Input struct {
	PR       dinv.PR
	Events   []dinv.Event
	Override dinv.Override
	Viewer   string   // my login
	MyTeams  []string // "org/slug", any case
	Ignore   []string // actors whose comments and reviews never count: automated reviewers
	Now      time.Time
	Stalled  config.Stalled
	// Turn is the pull request's newest review or address turn, else its
	// newest turn; nil without one.
	Turn *TurnFacts
	// SessionWaiting means Orca shows the session of Turn waiting.
	SessionWaiting bool
}

type Kind

type Kind string
const (
	KindDone         Kind = "done"
	KindMuted        Kind = "muted"
	KindHeldByCap    Kind = "held"
	KindBlocked      Kind = "blocked"
	KindToAddress    Kind = "to_address"
	KindRoundPending Kind = "round_pending"
	KindLoopWorking  Kind = "loop_working"
	KindLoopWaiting  Kind = "loop_waiting"
	KindLoopStopped  Kind = "loop_stopped"
	KindDraft        Kind = "draft"
	KindChecks       Kind = "checks"
	KindChanges      Kind = "changes"
	KindMerge        Kind = "merge"
	KindConflicts    Kind = "conflicts"
	KindReply        Kind = "reply"
	KindReviewerBack Kind = "reviewer_back"
	KindReview       Kind = "review"
	KindNoReviewer   Kind = "no_reviewer"
)

func (Kind) Label

func (k Kind) Label() string

Label is the kind in a few words, as the cockpit and the TUI show it.

type Result

type Result struct {
	Kind      Kind
	WaitingOn string // login(s), "me", "author", "nobody"
	Since     time.Time
	Reason    string
	Stalled   bool
}

func Derive

func Derive(in Input) Result

type TurnFacts

type TurnFacts struct {
	Intent         dintent.Name
	State, Summary string
	// At is when the turn reached its state; AnsweredAt is when an answer
	// was typed or resumed after its last record, zero without one.
	At, AnsweredAt time.Time
}

TurnFacts is what the loop's store says of a turn.

Jump to

Keyboard shortcuts

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