Merge lp:~jelmer/brz/fix-graph-error into lp:brz

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: 7873
Merged at revision: 7872
Proposed branch: lp:~jelmer/brz/fix-graph-error
Merge into: lp:brz
Diff against target: 38 lines (+11/-3)
1 file modified
breezy/plugins/github/forge.py (+11/-3)
To merge this branch: bzr merge lp:~jelmer/brz/fix-graph-error
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Review via email: mp+451053@code.launchpad.net

Commit message

Fix handling of github graphql errors

Description of the change

Fix handling of github graphql errors

To post a comment you must log in.
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :
Download full text (106.4 KiB)

The attempt to merge lp:~jelmer/brz/fix-graph-error into lp:brz failed. Command exited with 1.
Below is the output from the failed tests.

... OUTPUT TRIMMED ...

breezy.symbol_versioning.deprecated_in OK 2ms
breezy.plugins.bash_completion.tests.test_bashcomp.TestBashCodeGen.test_command_cases OK 2ms
test_workspace.WorkspaceTests.test_abspath(with_inotify,git) OK 32ms
breezy.plugins.email.tests.testemail.TestGetTo.test_body OK 44ms
test_workspace.WorkspaceTests.test_open_containing(with_inotify,git) OK 22ms
breezy.plugins.email.tests.testemail.TestGetTo.test_public_url_set OK 42ms
test_workspace.WorkspaceTests.test_root_add(with_inotify,git) OK 34ms
test_reconfigure.TestReconfigure.test_lightweight_conversion_uses_shared_repo OK 71ms
breezy.plugins.bash_completion.tests.test_bashcomp.TestBashCompletion.test_init_format_any OK 84ms
breezy.plugins.email.tests.testemail.TestGetTo.test_url_precedence OK 42ms
test_reconfigure.TestReconfigure.test_repository_tree_reconfiguration_not_supported OK 30ms
breezy.plugins.upload.tests.test_upload.TestFullUpload.test_upload_revision(SFTPTransport,SFTPAbsoluteServer) OK 126ms
test_workspace.WorkspaceTests.test_subpath_add(with_inotify,git) OK 41ms
breezy.plugins.fastimport.tests.test_generic_processor.TestImportToPackRenameModified.test_rename_of_modified_file_to_new_dir(pack-0.92) OK 344ms
test_workingtree.TestAutoResolve.test_auto_resolve_dir OK 32ms
test_reconfigure.TestReconfigure.test_tree_to_branch OK 39ms
breezy.plugins.bash_completion.tests.test_bashcomp.TestDataCollector.test_commands OK 55ms
breezy.plugins.changelog_merge.tests.test_changelog_merge.TestMergeCoreLogic.test_acceptance_bug_723968 OK 2ms
breezy.plugins.fastimport.tests.test_commands.TestFastExport.test_symlink OK 46ms
breezy.plugins.fastimport.tests.test_exporter.CheckRefFormatTests.test_invalid OK 2ms
breezy.plugins.fastimport.tests.test_generic_processor.TestImportToPackRenameModified.test_rename_of_modified_symlink_in_subdir(2a) OK 35ms
breezy.plugins.fastimport.tests.test_branch_mapper.TestBranchMapper.test_git_to_bzr_for_trunk OK 2ms
breezy.plugins.fastimport.tests.test_generic_processor.TestImportToPackRenameTricky.test_rename_directory_becomes_file(1.9-rich-root) OK 273ms
breezy.plugins.commitfromnews.tests.test_committemplate.TestCommitTemplate.test_initial OK 26ms
test_reconfigure.TestReconfigure.test_unsynced_checkout_to_lightweight OK 71ms
breezy.plugins.email.tests.testemail.TestGetTo.test_custom_subject OK 42ms
test_registry.TestRegistry.test_registry_alias_exists OK 2ms
test_registry.TestRegistryWithDirs.test_lazy_import_registry OK 4ms
test_rename_map.TestRenameMap.test_guess_rename_handles_new_directories OK 38ms
breezy.plugins.email.tests.testemail.TestGetTo.test_should_not_send_sender_configured OK 47ms
breezy.plugins.upload.tests.test_upload.TestIncrementalUpload.test_change_file_into_dir(SFTPTransport,SFTPAbsoluteServer) OK 172ms
breezy.plugins.rewrite.tests.test_...

lp:~jelmer/brz/fix-graph-error updated
7873. By Jelmer Vernooij

Rename message => msg

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/plugins/github/forge.py'
2--- breezy/plugins/github/forge.py 2023-06-24 13:01:43 +0000
3+++ breezy/plugins/github/forge.py 2023-09-08 22:09:11 +0000
4@@ -39,7 +39,7 @@
5 )
6 from ...git.urls import git_url_to_bzr_url
7 from ...i18n import gettext
8-from ...trace import note
9+from ...trace import mutter, note
10 from ...transport import get_transport
11
12 GITHUB_HOST = 'github.com'
13@@ -100,6 +100,15 @@
14 self.url = url
15
16
17+class AutoMergeUnavailable(errors.BzrError):
18+
19+ _fmt = "Unable to enable auto-merge: %(msg)s"
20+
21+ def __init__(self, msg):
22+ errors.BzrError.__init__(self)
23+ self.msg = msg
24+
25+
26 class GitHubLoginRequired(ForgeLoginRequired):
27
28 _fmt = "Action requires GitHub login."
29@@ -235,8 +244,7 @@
30 first_error = e.errors[0]
31 if (first_error['type'] == 'UNPROCESSABLE' and
32 first_error['path'] == 'enablePullRequestAutoMerge'):
33- # TODO(jelmer): better exception type
34- raise Exception(first_error['message']) from e
35+ raise AutoMergeUnavailable(first_error['message']) from e
36 raise Exception(first_error['message']) from e
37 else:
38 # https://developer.github.com/v3/pulls/#merge-a-pull-request-merge-button

Subscribers

People subscribed via source and target branches