-
Notifications
You must be signed in to change notification settings - Fork 27
Patchset source remote cherry-pick error handling #257
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
If a PatchSet cherry-pick source_remote step fails after a new remote is added, attempt to cleanup the added remote before raising exception. Signed-off-by: Nathaniel Haller <[email protected]>
In some cases where filter settings are enabled on the repo, the git fetch from a remote repo step will fail while the remote repo branch does exist. Running the git fetch step again with --refetch resolved one git fetch error case with --filter=tree:0 enabled, but adds additional time and resources to the PatchSet creation when it is required to run. Signed-off-by: Nathaniel Haller <[email protected]>
| repo.git.execute(['git', 'fetch', operation.source_remote, operation.source_branch, '--refetch']) | ||
| except: | ||
| try: | ||
| repo.git.execute(['git', 'remote', 'remove', operation.source_remote]) |
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.
Instead of adding an except here to remove the remote. Let's use a finally: across the whole block.
| if is_merge_conflict(repo): | ||
| repo.git.execute(['git', 'cherry-pick', '--abort']) | ||
| try: | ||
| repo.git.execute(['git', 'remote', 'remove', operation.source_remote]) |
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.
Instead of adding an except here to remove the remote. Let's use a finally: across the whole block.
ashedesimone
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.
Please split this into two PRs
|
Two commits for additional error handling and clean up during the PatchSet cherry-pick from a remote source operation.