Skip to content

Commit

Permalink
Add more logging to troubleshoot issue and fix the bot names
Browse files Browse the repository at this point in the history
  • Loading branch information
pmaslana committed Jun 11, 2024
1 parent b45ee3d commit da46c84
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion internal/github/checkPendingCI.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func getLastCommitTime(client *github.Client, owner, repo string, prNumber int)

// Since GetDate() returns a Timestamp (not *Timestamp), use the address to call GetTime()
commitTime := commitDate.GetTime() // Correctly accessing GetTime(), which returns *time.Time

log.Printf("The last commit time is %s", commitTime.Format(time.RFC3339))
if commitTime == nil {
return time.Time{}, fmt.Errorf("commit time is nil for PR #%d", prNumber)
}
Expand All @@ -103,7 +103,9 @@ func checkTeamMemberActivity(client *github.Client, owner, repo string, prNumber
}

for _, comment := range comments {
log.Printf("Checking comment by %s at %s", comment.User.GetLogin(), comment.CreatedAt.Format(time.RFC3339))
if _, ok := teamMembers[comment.User.GetLogin()]; ok && comment.CreatedAt.After(lastCommitTime) {
log.Printf("Found team member comment after last commit time: %s", comment.CreatedAt.Format(time.RFC3339))
// Check if the comment is after the last commit
return true, nil // Active and relevant participation
}
Expand Down
2 changes: 1 addition & 1 deletion k8s/notify-pending-prs.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ image:

deployment:
args:
- notify-stale
- notify-pendingci
- --loop

# Creates a secret with the following values, and mounts as a file into the main deployment container
Expand Down
2 changes: 1 addition & 1 deletion k8s/notify-stale-prs.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ image:

deployment:
args:
- notify-pendingci
- notify-stale
- --loop

# Creates a secret with the following values, and mounts as a file into the main deployment container
Expand Down

0 comments on commit da46c84

Please sign in to comment.