Bug 239741 - [git-webkit] Cannot create pull request branch using bug URL, fails to fetch comments from Bugzilla, fails to modify bug
Summary: [git-webkit] Cannot create pull request branch using bug URL, fails to fetch ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Michael Catanzaro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-04-25 14:42 PDT by Michael Catanzaro
Modified: 2022-04-28 10:38 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Catanzaro 2022-04-25 14:42:50 PDT
git-webkit cannot create pull request branch using bug URL. Pretty sure this worked a week or two ago:

$ git-webkit pr
'main' is not a pull request branch, enter name of new branch (or bug URL): https://bugs.webkit.org/show_bug.cgi?id=239724
Failed to fetch 'https://bugs.webkit.org/show_bug.cgi?id=239724'
'https://bugs.webkit.org/show_bug.cgi?id=239724' is an invalid branch name, cannot create it
Abandoning pushing pull-request because 'https://bugs.webkit.org/show_bug.cgi?id=239724' could not be created

I should debug it to see why it fails for me.
Comment 1 Michael Catanzaro 2022-04-25 14:45:41 PDT
More errors running 'webkit-patch pr' after creating a branch manually:

Created 'PR 383 | Several internationalization tests broken with ICU 69.1'!
Failed to fetch 'https://bugs.webkit.org/show_bug.cgi?id=239724'
Failed to fetch 'https://bugs.webkit.org/show_bug.cgi?id=239724'
Failed to modify 'https://bugs.webkit.org/show_bug.cgi?id=239724 None'
Failed to fetch 'https://bugs.webkit.org/show_bug.cgi?id=239724'
Assigning associated issue to Michael Catanzaro <mcatanzaro@gnome.org>
Failed to fetch comments for 'https://bugs.webkit.org/show_bug.cgi?id=239724'
Failed to fetch 'https://bugs.webkit.org/show_bug.cgi?id=239724'
Failed to fetch 'https://bugs.webkit.org/show_bug.cgi?id=239724'
Failed to fetch 'https://bugs.webkit.org/show_bug.cgi?id=239724'
Failed to modify 'https://bugs.webkit.org/show_bug.cgi?id=239724 None'
Posted pull request link to https://bugs.webkit.org/show_bug.cgi?id=239724
Failed to fetch 'https://bugs.webkit.org/show_bug.cgi?id=239724'
Failed to fetch 'https://bugs.webkit.org/show_bug.cgi?id=239724'
https://github.com/WebKit/WebKit/pull/383
Comment 2 Michael Catanzaro 2022-04-26 11:28:48 PDT
Added some debugging:

diff --git a/Tools/Scripts/libraries/webkitbugspy/webkitbugspy/bugzilla.py b/Tools/Scripts/libraries/webkitbugspy/webkitbugspy/bugzilla.py
index 20243761c94d..870eb6a30923 100644
--- a/Tools/Scripts/libraries/webkitbugspy/webkitbugspy/bugzilla.py
+++ b/Tools/Scripts/libraries/webkitbugspy/webkitbugspy/bugzilla.py
@@ -149,6 +149,8 @@ class Tracker(GenericTracker):
 
         if member in ('title', 'timestamp', 'creator', 'opened', 'assignee', 'watchers', 'project', 'component', 'version'):
             response = requests.get('{}/rest/bug/{}{}'.format(self.url, issue.id, self._login_arguments(required=False)))
+            if response.status_code != 200:
+                print(response)
             response = response.json().get('bugs', []) if response.status_code == 200 else None
             if response:
                 response = response[0]

It prints:

Updated 'PR 394 | Test PR, ignore'!
<Response [401]>
Failed to fetch 'https://bugs.webkit.org/show_bug.cgi?id=239741'
<Response [401]>
Failed to fetch 'https://bugs.webkit.org/show_bug.cgi?id=239741'
Failed to modify 'https://bugs.webkit.org/show_bug.cgi?id=239741 None'
<Response [400]>
Failed to fetch 'https://bugs.webkit.org/show_bug.cgi?id=239741'
Assigning associated issue to Michael Catanzaro <mcatanzaro@gnome.org>
Failed to fetch comments for 'https://bugs.webkit.org/show_bug.cgi?id=239741'
<Response [400]>
Failed to fetch 'https://bugs.webkit.org/show_bug.cgi?id=239741'
<Response [400]>
Failed to fetch 'https://bugs.webkit.org/show_bug.cgi?id=239741'
<Response [400]>
Failed to fetch 'https://bugs.webkit.org/show_bug.cgi?id=239741'
Failed to modify 'https://bugs.webkit.org/show_bug.cgi?id=239741 None'
Posted pull request link to https://bugs.webkit.org/show_bug.cgi?id=239741
<Response [400]>
Failed to fetch 'https://bugs.webkit.org/show_bug.cgi?id=239741'
<Response [400]>
Failed to fetch 'https://bugs.webkit.org/show_bug.cgi?id=239741'
https://github.com/WebKit/WebKit/pull/394

So it's 401 Unauthorized and 400 Bad Request.

My password stored by python-keyring *seems* to be correct, I think. To be completely sure, I wanted to test it in an incognito browser window to make sure I can use it to sign in, but I've been IP banned from WebKit Bugzilla for the next couple hours for exceeding the maximum number of login attempts. Maybe the script should give up after the first failure, instead of failing so many times in a row.
Comment 4 Michael Catanzaro 2022-04-26 11:48:47 PDT
Some more debugging reveals that git-webkit is using the expected username and password. And using a VPN to bypass my IP ban, I checked to ensure these credentials actually work (they do).

I've hacked our bugzilla.py to fail after the first failed request, to hopefully avoid getting an IP ban on my VPN.

After debugging a little more, I notice bugzilla.py is just pasting my password into the URL unencoded. I think it's failing due to one or more special characters in the password. Probably the username and password should both be encoded somehow.
Comment 5 Michael Catanzaro 2022-04-26 12:40:15 PDT
Pull request: https://github.com/WebKit/WebKit/pull/395
Comment 6 Jonathan Bedard 2022-04-26 12:55:24 PDT
Thanks for getting to the bottom of this!
Comment 7 EWS 2022-04-26 19:49:29 PDT
Committed r293495 (250028@main): <https://commits.webkit.org/250028@main>

Reviewed commits have been landed. Closing PR #395 and removing active labels.
Comment 8 Radar WebKit Bug Importer 2022-04-26 19:50:14 PDT
<rdar://problem/92373578>