Documentation
¶
Overview ¶
Package proposals is the job that proposes what each enabled plugin proposes on its own units, such as GitHub's nudge. Every draft waits for its rule's approval policy. The drafts on tasks and Slack units come from the profile's workflows through draft.propose.
Index ¶
Constants ¶
const ReasonMoot = draft.WithdrawMoot
ReasonMoot is the discard reason of a plugin rule's draft on a unit whose closure is posted.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Job ¶
type Job struct {
Outbox Outbox
// Facts reads a unit's card facts; a plugin rule's draft on a unit whose closure is posted is withdrawn. nil: none.
Facts coretasks.Facts
Sources []Source
// Enabled says whether a provider's plugin is enabled; nil: every one is.
Enabled func(unit.ProviderID) bool
// Approval is the configured approval of a plugin's rules' drafts; nil: wait.
Approval func(unit.ProviderID) draft.Approval
// RepeatAfter is how long a sent, discarded or dry-run draft of a key keeps the key quiet.
RepeatAfter time.Duration
Clock port.Clock
Log func(format string, args ...any) // ids, rules, kinds and units; never text
// contains filtered or unexported fields
}
type Outbox ¶
type Outbox interface {
Propose(ctx context.Context, p outbox.Proposal) (draft.Draft, error)
List(ctx context.Context, f outbox.Filter) ([]draft.Draft, error)
Withdraw(ctx context.Context, id draft.ID, reason string) (draft.Draft, error)
}
Outbox is what the job needs of the outbox service (*outbox.Service).
type Pass ¶ added in v0.4.0
type Pass struct {
Proposals []outbox.Proposal
Withdrawals []Withdrawal
}
Pass is what a plugin's rules call for now: the drafts to propose, and the rules that no longer call for a draft on a unit.
type Source ¶
type Source struct {
Provider unit.ProviderID
Proposals func(ctx context.Context, now time.Time) (Pass, error)
}
Source is an enabled plugin's Proposals.
type Summary ¶
type Summary struct {
Proposed, Held, Discarded, Refused int
}
Summary counts what one pass did.
type Withdrawal ¶ added in v0.4.0
Withdrawal says the plugin's rule Rule no longer calls for a draft on Unit.