Documentation
¶
Overview ¶
Package waitrun observes bounded PR conditions and composes wait metadata effects. It does not import CLI packages or change pull requests.
Index ¶
Constants ¶
const ( Settled = "settled" Pending = "pending" ReadError = "error" )
TargetStatus values. "settled" means the requested condition holds; "pending" means it does not yet. "error" is a read that failed in a way a retry is unlikely to fix — a transient read stays pending on purpose, so a GitHub blip resumes instead of ending the wait with a false verdict.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ListRequest ¶
type ListResult ¶
type ListResult struct {
Records []waitregistry.Record
Removed int
Pruned bool
}
type Observer ¶
type Observer struct {
Read func(context.Context, Reference) Target
Now func() time.Time
Sleep func(context.Context, time.Duration) error
}
Observer retains the existing per-instance effects; nil uses real observations, the monotonic system clock and a context-cancelable timer.
type Registration ¶
type Registry ¶
type Registry struct {
EnsureRoot func(string) (string, error)
Register func(string, waitregistry.Record) (func(), error)
List func(string, waitregistry.Options) ([]waitregistry.Record, error)
Prune func(string, waitregistry.Options) (int, error)
Now func() time.Time
PID func() int
Identity func() (worktrees.AgentIdentity, bool)
}
func DefaultRegistry ¶
func DefaultRegistry() Registry
func (Registry) Inspect ¶
func (registry Registry) Inspect(request ListRequest) (ListResult, error)
func (Registry) RegisterWait ¶
func (registry Registry) RegisterWait(request Registration) func()
RegisterWait retains best-effort metadata and a nonnil release on every path.
type Target ¶
type Target struct {
Selector string `json:"selector"`
Repository string `json:"repository"`
Number string `json:"number"`
Status string `json:"status"`
State string `json:"state,omitempty"`
Draft bool `json:"draft,omitempty"`
Head string `json:"head,omitempty"`
Base string `json:"base,omitempty"`
Mergeable string `json:"mergeable,omitempty"`
Checks map[string]int `json:"checks,omitempty"`
Failed []string `json:"failed_checks,omitempty"`
Failures []githubchecks.CIFailureDetail `json:"failures,omitempty"`
Blocked []string `json:"unsatisfied_required_checks,omitempty"`
Reason string `json:"reason,omitempty"`
URL string `json:"url,omitempty"`
}
func ObservePullRequest ¶
ObservePullRequest reads one pull request and the checks on its exact head. It delegates to prsnapshot.Observe — one shared implementation of both facts, reused by the herdr-session-transport daemon watcher (internal/prwatch) rather than a second dialect of the same GitHub reads — and adapts the result onto Target so `wb wait pr`'s own behavior is unchanged by the move (see reader_test.go).