Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions cmd/registrar/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,6 @@ func main() {
router.Handle("/install", rateLimitMiddleware(oauthLimiter)(http.HandlerFunc(oauthHandler.HandleInstall))).Methods("GET")
router.Handle("/oauth/callback", rateLimitMiddleware(oauthLimiter)(http.HandlerFunc(oauthHandler.HandleCallback))).Methods("GET")

// Debug endpoint - DO NOT EXPOSE IN PRODUCTION
// Remove this endpoint entirely or protect with strong authentication
// router.HandleFunc("/debug", oauthHandler.HandleDebug).Methods("GET")

// Determine port
port := os.Getenv("PORT")
if port == "" {
Expand Down
6 changes: 1 addition & 5 deletions cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,6 @@ func run(ctx context.Context, cancel context.CancelFunc, cfg *config.ServerConfi
router.Handle("/slack/install", rateLimitMiddleware(oauthLimiter)(http.HandlerFunc(oauthHandler.HandleInstall))).Methods("GET")
router.Handle("/slack/oauth/callback", rateLimitMiddleware(oauthLimiter)(http.HandlerFunc(oauthHandler.HandleCallback))).Methods("GET")

// Debug endpoint - DO NOT EXPOSE IN PRODUCTION
// Remove this endpoint entirely or protect with strong authentication
// router.HandleFunc("/slack/debug", oauthHandler.HandleDebug).Methods("GET")

slog.Info("registered OAuth endpoints with rate limiting",
"install_url", "/slack/install",
"callback_url", "/slack/oauth/callback",
Expand Down Expand Up @@ -710,7 +706,7 @@ func runBotCoordinators(
}

// Initialize daily digest scheduler
dailyDigest := notify.NewDailyDigestScheduler(notifier, githubManager, configManager, stateStore)
dailyDigest := notify.NewDailyDigestScheduler(notifier, githubManager, configManager, stateStore, slackManager)

// Start initial coordinators
cm.startCoordinators(ctx)
Expand Down
26 changes: 15 additions & 11 deletions internal/bot/bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -796,14 +796,14 @@ func (*Coordinator) extractBlockedUsersFromTurnclient(checkResult *turn.CheckRes

// prUpdateInfo groups PR information for DM updates.
type prUpdateInfo struct {
checkRes *turn.CheckResponse
owner string
repo string
title string
author string
state string
url string
number int
checkRes *turn.CheckResponse
owner string
repo string
title string
author string
state string
url string
number int
}

// updateDMMessagesForPR updates DM messages for all relevant users on a PR.
Expand Down Expand Up @@ -1409,14 +1409,18 @@ func (c *Coordinator) handlePullRequestFromSprinkler(
}

// handlePullRequestReviewFromSprinkler handles PR review events from sprinkler.
func (*Coordinator) handlePullRequestReviewFromSprinkler(ctx context.Context, owner, repo string, prNumber int, sprinklerURL string, _ time.Time) {
// Reviews update PR state (approved, changes requested, etc), so we treat them
// like regular pull_request events and let turnclient analyze the current state.
func (c *Coordinator) handlePullRequestReviewFromSprinkler(ctx context.Context, owner, repo string, prNumber int, sprinklerURL string, eventTimestamp time.Time) {
slog.Info("handling PR review event from sprinkler",
logFieldOwner, owner,
logFieldRepo, repo,
"pr_number", prNumber,
"sprinkler_url", sprinklerURL,
"note", "review events not fully implemented yet")
// TODO: Implement review event handling if needed
"note", "treating as pull_request event - turnclient will analyze review state")

// Reviews change PR state, so handle like any other PR update
c.handlePullRequestFromSprinkler(ctx, owner, repo, prNumber, sprinklerURL, eventTimestamp)
}

// createPRThread creates a new thread in Slack for a PR.
Expand Down
Loading