Skip to content

Commit a514b84

Browse files
committed
pkg/repo: add debug logs to loadKEPPullRequests
1 parent d98f05c commit a514b84

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pkg/repo/repo.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ func (r *Repo) LoadLocalKEPs(sig string) ([]*api.Proposal, error) {
291291

292292
func (r *Repo) loadKEPPullRequests(sig string) ([]*api.Proposal, error) {
293293
// Initialize github client
294+
logrus.Debugf("Initializing github client to load PRs for sig: %v", sig)
294295
var auth *http.Client
295296
ctx := context.Background()
296297
if r.Token != "" {
@@ -301,6 +302,7 @@ func (r *Repo) loadKEPPullRequests(sig string) ([]*api.Proposal, error) {
301302

302303
// Fetch list of all PRs if none exists
303304
if r.allPRs == nil {
305+
logrus.Debugf("Initializing list of all PRs for %v/%v", remoteOrg, remoteRepo)
304306
r.allPRs = []*github.PullRequest{}
305307

306308
opt := &github.PullRequestListOptions{
@@ -330,9 +332,10 @@ func (r *Repo) loadKEPPullRequests(sig string) ([]*api.Proposal, error) {
330332
}
331333

332334
kepPRs := make([]*github.PullRequest, 10)
335+
sigLabel := strings.Replace(sig, "-", "/", 1)
336+
logrus.Debugf("Searching list of %v PRs for %v/%v with labels: [%v, %v]", len(r.allPRs), remoteOrg, remoteRepo, sigLabel, proposalLabel)
333337
for _, pr := range r.allPRs {
334338
foundKind, foundSIG := false, false
335-
sigLabel := strings.Replace(sig, "-", "/", 1)
336339

337340
for _, l := range pr.Labels {
338341
if *l.Name == proposalLabel {
@@ -348,8 +351,11 @@ func (r *Repo) loadKEPPullRequests(sig string) ([]*api.Proposal, error) {
348351
continue
349352
}
350353

354+
logrus.Debugf("Found #%v", pr.GetHTMLURL())
355+
351356
kepPRs = append(kepPRs, pr)
352357
}
358+
logrus.Debugf("Found %v PRs for %v/%v with labels: [%v, %v]", len(kepPRs), remoteOrg, remoteRepo, sigLabel, proposalLabel)
353359

354360
if len(kepPRs) == 0 {
355361
return nil, nil
@@ -375,6 +381,7 @@ func (r *Repo) loadKEPPullRequests(sig string) ([]*api.Proposal, error) {
375381
// touched by a PR. This may result in multiple versions of the same KEP.
376382
var allKEPs []*api.Proposal
377383
for _, pr := range kepPRs {
384+
logrus.Debugf("Getting list of files for %v", pr.GetHTMLURL())
378385
files, _, err := gh.PullRequests.ListFiles(
379386
context.Background(),
380387
remoteOrg,

0 commit comments

Comments
 (0)