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
Add error handling for failure while updating Pull request in azure #3493
Conversation
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.
I left an inline suggestion, but overall this seems like an improvement to me 👍
common/lib/dependabot/errors.rb
Outdated
@@ -71,6 +71,15 @@ def initialize(source, msg = nil) | |||
end | |||
end | |||
|
|||
class PullRequestUpdateFailed < DependabotError |
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.
Sorry for the slow review. Do we want to add this as a top-level error? Not sure we want to backport this to the other updaters, for github there are so many different reasons for a PR update failing so will be hard to reuse there. Maybe better to just add it in the Azure class for now?
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.
Cool makes sense! I'll add this in azure pr updater class
Co-authored-by: Jurre <jurre@github.com>
@jurre @feelepxyz can we merge this PR? |
Added logic in the azure PR updater to raise an error of type
Dependabot::PullRequestUpdateFailed
when the update ref call to update the source branch is unsuccessful. Currently the update_ref API in azure returns a 200 response code even when the update operation is unsuccessful hence need to check the response body to verify if the update operation is successful@feelepxyz @jurre Does this way of error handling makes sense? Apologies for creating a separate PR for this small change