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, logger *slog.Logger) *Reporter
NewReporter constructs a Reporter. now defaults to time.Now.
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler runs a Job on a cron schedule (server-local time). It mirrors cleanup.Scheduler's Run(ctx) shape so main can start both the same way.
func NewScheduler ¶
NewScheduler validates the cron spec up front so a malformed schedule fails fast at startup rather than silently never firing. spec is a standard 5-field cron expression (e.g. "0 9 * * *").
type StuckFinder ¶
type StuckFinder interface {
FindStuck(ctx context.Context, cutoff time.Time) ([]store.SlackMessage, error)
}
StuckFinder returns open PRs whose last activity predates cutoff.