dailyreport

package
v0.0.0-...-72f1ef6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package dailyreport provides functionality for generating and sending daily PR reports to users.

Index

Constants

View Source
const (
	// MinHoursBetweenReports is the minimum time between daily reports (23 hours).
	MinHoursBetweenReports = 23

	// WindowStartHour is when the daily report window opens (6am local time).
	WindowStartHour = 6

	// WindowEndHour is when the daily report window closes (11:30am local time).
	// We use hour 11 and check minutes separately to support 11:30am cutoff.
	WindowEndHour = 12 // Exclusive, so 11:59am is the last valid time
)

Variables

This section is empty.

Functions

func BuildReportBlocks

func BuildReportBlocks(incoming, outgoing []home.PR) []slack.Block

BuildReportBlocks creates Block Kit blocks for a daily report with greeting. Uses home.BuildPRSections for consistent formatting with the dashboard.

Types

type Sender

type Sender struct {
	// contains filtered or unexported fields
}

Sender handles sending daily reports to users.

func NewSender

func NewSender(stateStore StateStore, slackClient SlackClient) *Sender

NewSender creates a new daily report sender.

func (*Sender) SendReport

func (s *Sender) SendReport(ctx context.Context, userInfo UserBlockingInfo) error

SendReport sends a daily report to a user.

func (*Sender) ShouldSendReport

func (s *Sender) ShouldSendReport(ctx context.Context, userInfo UserBlockingInfo) bool

ShouldSendReport determines if a report should be sent to a user now.

type SlackClient

type SlackClient interface {
	SendDirectMessageWithBlocks(ctx context.Context, userID string, blocks []slack.Block) (dmChannelID, messageTS string, err error)
	UserTimezone(ctx context.Context, userID string) (string, error)
	IsUserActive(ctx context.Context, userID string) bool
}

SlackClient handles Slack API operations.

type StateStore

type StateStore interface {
	LastReportSent(ctx context.Context, userID string) (time.Time, bool)
	RecordReportSent(ctx context.Context, userID string, sentAt time.Time) error
}

StateStore handles persistence of report send times.

type UserBlockingInfo

type UserBlockingInfo struct {
	GitHubUsername string
	SlackUserID    string
	IncomingPRs    []home.PR // PRs user needs to review
	OutgoingPRs    []home.PR // PRs user authored that need action
}

UserBlockingInfo contains information about PRs a user is blocking.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL