This repository was archived by the owner on Sep 30, 2024. It is now read-only.
fix(batch-changes): disallow retry on deleted changesets#63336
Merged
Conversation
46c75fa to
a8376c1
Compare
camdencheek
approved these changes
Jun 19, 2024
camdencheek
left a comment
Member
There was a problem hiding this comment.
LGTM pending removal of the extra Unwrap!
4cb044b to
82b3750
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes SRCH-524
Slack Context
Bitbucket Server (v5.1) added the ability to decline and delete pull requests - this isn't replicated across other supported codehosts such as:
e.t.c
output.mp4
Due to this, whenever a pull request is deleted, Batch Changes services (like Syncer & Reconciler) keep retrying whatever operation they're running, thereby spamming the codehost in the process.
In this PR, I ensured whenever we encounter certain status code from a HTTP request to a codehost, it returns a NonRetryable error to reduce spamming.
The logic for handling non-existent pull requests lived here, however that condition was never met because
httpErrordid not fulfil theUnwrapinterface thereforeerrors.Ascouldn't unwrap the underlying error.Test plan
Create a test batch change targeting a bitbucket server codehost. Once the pull request has been created, delete the pull request.
Once the changeset has been synced on Sourcegraph, the status of the changeset will be updated to
CLOSED.Changelog