Skip to content

Commit

Permalink
feat: More tracing logs
Browse files Browse the repository at this point in the history
  • Loading branch information
msvticket committed Jul 25, 2022
1 parent 87f7980 commit fdc0ee1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions pkg/jobutil/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ func FilterPresubmits(filter Filter, changes job.ChangedFilesProvider, branch st
for _, presubmit := range presubmits {
matches, forced, defaults := filter(presubmit)
if !matches {
logger.WithField("presubmit", presubmit).Trace("doesn't match command filter")
continue
}
shouldRun, err := presubmit.ShouldRun(branch, changes, forced, defaults)
Expand Down
4 changes: 2 additions & 2 deletions pkg/plugins/trigger/generic-comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ func handleGenericComment(c Client, trigger *plugins.Trigger, gc scmprovider.Gen
if commentAuthor == botName {
c.Logger.Warn("Comment is made by the bot, for production installs it is recommended to use a different bot user account that your personal one")
}

c.Logger.WithField("event", gc).Trace("Generic comment event")
pr, err := c.SCMProviderClient.GetPullRequest(org, repo, number)
if err != nil {
return err
}
c.Logger.Tracef("Fetched pull request: %+v", pr)
c.Logger.WithField("pull_request", pr).Trace("Fetched pull request")

// Skip untrusted users comments.
trusted, err := TrustedUser(c.SCMProviderClient, trigger, commentAuthor, org, repo)
Expand Down
1 change: 1 addition & 0 deletions pkg/scmprovider/pull_requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ type MergeDetails struct {
func (c *Client) GetPullRequest(owner, repo string, number int) (*scm.PullRequest, error) {
ctx := context.Background()
fullName := c.repositoryName(owner, repo)
// Isn't pr.Base.Ref populated?
pr, _, err := c.client.PullRequests.Find(ctx, fullName, number)
if err != nil {
return nil, err
Expand Down

0 comments on commit fdc0ee1

Please sign in to comment.