-
Notifications
You must be signed in to change notification settings - Fork 33
chore remove a nil deference #765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: emirot <[email protected]>
Bundle ReportBundle size has no change ✅ |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #765 +/- ##
==========================================
- Coverage 56.79% 56.53% -0.26%
==========================================
Files 37 37
Lines 4004 4008 +4
==========================================
- Hits 2274 2266 -8
- Misses 1446 1455 +9
- Partials 284 287 +3 ☔ View full report in Codecov by Sentry. |
internal/scms/gitlab/pullrequest.go
Outdated
| metrics.RecordSCMCall(repo, metrics.SCMAPIPullRequest, metrics.SCMOperationList, resp.StatusCode, time.Since(start), nil) | ||
| } | ||
| if err != nil { | ||
| return false, "", time.Time{}, fmt.Errorf("failed to list pull requests: %w", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the gitlab client return an error for non-200 responses? If so, we still want to make sure we push the metric for the failed request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I see it does return an error for non-200 response code https://gitlab.com/gitlab-org/api/client-go/-/blob/main/merge_requests.go#L316
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then I don't think we can move the metrics call down...
But we can still add the if resp == nil check, I think that's valid and fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @crenshaw-dev for the explanation, I have updated
Signed-off-by: emirot <[email protected]>
What
Return error if resp is nil
Why
Nilway detected