Documentation
¶
Overview ¶
Package situation derives who a pull request is waiting on, and since when, from the pull request and its events alone. The host lays its own state over it: a run on the pull request, the user's mute and a pending round.
Index ¶
Constants ¶
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.
const ReasonMax = 200
ReasonMax bounds a reason that comes from an agent or a CI, so a row and a notification stay one line; the host cuts its own reasons alike.
Variables ¶
This section is empty.
Functions ¶
func ActiveBlock ¶
ActiveBlock is the newest round_blocked event of evs, oldest first, that no later event ended: a round_unblocked, a round sent or held, or a review by viewer.
Types ¶
type Input ¶
type Input struct {
PR pr.PR
Events []pr.Event
Viewer string // my login
MyTeams []string // "org/slug", any case
Ignore []string // actors whose comments and reviews never count: automated reviewers
// Now is when the situation is derived: a round held by the cap holds
// only on the local day it was held.
Now time.Time
Stalled Thresholds
// AddressedAt is when the pull request's driving turn, an address turn,
// reached its state; zero without one.
AddressedAt time.Time
}
type Kind ¶
type Kind string
Kind is a situation of plugin.toml's row_kinds.
const ( KindDone Kind = "done" KindHeldByCap Kind = "held" KindBlocked Kind = "blocked" KindToAddress Kind = "to_address" KindLoopWorking Kind = "loop_working" KindLoopWaiting Kind = "loop_waiting" 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" )
The situations the plugin derives.
type Result ¶
type Result struct {
Kind Kind
WaitingOn string // login(s), "me", "author", "nobody"
Since time.Time
Reason string
// Stalled is when the situation stalls: true once its threshold has
// passed since Since, in working days; zero never stalls.
Stalled src.Value
}
type Thresholds ¶
Thresholds are how long, in working days, a situation lasts before it is stalled; zero never stalls.