Documentation
¶
Overview ¶
Package digest posts the scheduled stuck-PR reminder: a per-channel summary of open PRs that nobody has touched since before today. It rides the same slack_messages rows and repo→channel mappings the webhook flow already uses, adding only a cron-driven read pass — no new persistence.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MappingLookup ¶
type MappingLookup interface {
Get(ctx context.Context, repository string) (store.RepoMapping, error)
}
MappingLookup resolves a repository to its Slack channel and mentions.
type Poster ¶
type Poster interface {
PostMessage(ctx context.Context, channel string, msg slack.Message) (string, error)
PostReply(ctx context.Context, channel, threadTS string, msg slack.Message) (string, error)
}
Poster posts a composed message to a Slack channel, either as a top-level post (PostMessage, returning its ts) or as a reply threaded under one (PostReply).
type Reporter ¶
type Reporter struct {
// contains filtered or unexported fields
}
Reporter builds and posts the stuck-PR digest for every channel that owns at least one stuck PR.
func NewReporter ¶
func NewReporter(finder StuckFinder, mappings MappingLookup, poster Poster, composer *slack.Composer, digests Resolver, logger *slog.Logger) *Reporter
NewReporter constructs a Reporter. now defaults to time.Now.
type Resolver ¶ added in v0.18.0
type Resolver interface {
DigestFor(repository string) mappings.DigestConfig
}
Resolver looks up the effective digest configuration for a repository.
type ScheduleJob ¶ added in v0.18.0
ScheduleJob is the unit the Scheduler fires on each cron tick. *Reporter satisfies it.
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler runs one cron per distinct schedule spec, calling its job for each tick with the matching spec. It mirrors cleanup.Scheduler's Run(ctx) shape so main can start both the same way.
func NewScheduler ¶
NewScheduler validates every cron spec up front so a malformed schedule fails fast at startup rather than silently never firing. specs is a list of standard 5-field cron expressions (e.g. ["0 9 * * *", "0 18 * * *"]).
type StuckFinder ¶
type StuckFinder interface {
FindStuck(ctx context.Context, cutoff time.Time) ([]store.SlackMessage, error)
}
StuckFinder returns open PRs whose last activity predates cutoff.