Skip to content

Commit

Permalink
Fix the stale PR code to create the proper message and add a wait timer
Browse files Browse the repository at this point in the history
  • Loading branch information
pmaslana committed Jun 24, 2024
1 parent fc45264 commit 5cec8e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cmd/notifyStale.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,11 @@ var notifyStaleCmd = &cobra.Command{
}

if shouldSendMessage {
message := fmt.Sprintf("The following pull request is waiting for approval for CI checks to run: %s", pr.URL)
message := fmt.Sprintf("The following pull request has activity from a Chia team member in the last 7 days: %s", pr.URL)
slogs.Logr.Info("Sending message via keybase")
if err := keybase.SendKeybaseMsg(message); err != nil {
slogs.Logr.Error("Failed to send message", "error", err)
time.Sleep(15 * time.Second) // This is to prevent "error response: 429 Too Many Requests""
} else {
slogs.Logr.Info("Message sent for PR", "URL", pr.URL)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/github/checkStalePRs.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func CheckStalePRs(ctx context.Context, githubClient *github.Client, cfg *config
continue // Skip this PR or handle the error appropriately
}
if stale {
slogs.Logr.Info("PR is has no team member within the last seven days", "PR", pr.GetNumber(), "repository", fullRepo.Name, "user", pr.User.GetLogin(), "created_at", pr.CreatedAt)
slogs.Logr.Info("PR has no team member activity within the last seven days", "PR", pr.GetNumber(), "repository", fullRepo.Name, "user", pr.User.GetLogin(), "created_at", pr.CreatedAt)
stalePRs = append(stalePRs, StalePR{
Repo: repo,
PRNumber: pr.GetNumber(),
Expand Down

0 comments on commit 5cec8e2

Please sign in to comment.