Skip to content
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

Merged
merged 4 commits into from Apr 16, 2021

Conversation

milind009
Copy link
Contributor

@milind009 milind009 commented Apr 14, 2021

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

@milind009 milind009 requested a review from a team as a code owner April 14, 2021 15:59
Copy link
Member

@jurre jurre left a 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 👍

@@ -71,6 +71,15 @@ def initialize(source, msg = nil)
end
end

class PullRequestUpdateFailed < DependabotError
Copy link
Contributor

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?

Copy link
Contributor Author

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

@milind009
Copy link
Contributor Author

@jurre @feelepxyz can we merge this PR?

@jurre jurre merged commit 28f1dcf into dependabot:main Apr 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants