-
Notifications
You must be signed in to change notification settings - Fork 30
fix(webhook): avoid panics #671
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
Conversation
| // check if the retry limit has been exceeded | ||
| if i < retryLimit { | ||
| logrus.WithError(retErr).Warning("retrying") | ||
|
|
||
| // continue to the next iteration of the loop | ||
| continue | ||
| } | ||
|
|
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.
opted to remove this retry logic since ConfigBackoff is already retrying 5x. if that fails it's likely this is just failing, period.
Codecov Report
@@ Coverage Diff @@
## master #671 +/- ##
==========================================
- Coverage 55.07% 54.96% -0.11%
==========================================
Files 195 195
Lines 15926 15956 +30
==========================================
Hits 8771 8771
- Misses 6781 6811 +30
Partials 374 374
|
| b, _ = database.GetBuild(b.GetNumber(), r) | ||
| // TODO: this can be dropped once we return | ||
| // the created build above | ||
| b, err = database.GetBuild(b.GetNumber(), r) |
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.
if we don't handle any potential errors here, we will get issues downstream from here
| h.SetStatus(constants.StatusFailure) | ||
| h.SetError(retErr.Error()) | ||
|
|
||
| return |
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.
we probably don't want to return a build if there was an error. this also creates a conflict because this sets a 500 return code that later gets changed to a 200.
jbrockopp
left a comment
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.
LGTM
ecrupper
left a comment
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.
lgtm
KellyMerrick
left a comment
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.
lgtm
closes go-vela/community#643
most details on this can be found in the issue above. i commented some of the changes.
we also added some TODOs for things to look at in lieu of creating new issues to start some conversation and not lose track of it.
we are adding to top of HEAD since there were only two minor merges that only impact tests.