Skip to content

Commit

Permalink
Cherry-pick 274756@main (68b27b7). rdar://122151119
Browse files Browse the repository at this point in the history
    [git-webkit] Error message for git webkit commit for non existing issues could be improved.
    rdar://122151119
    https://bugs.webkit.org/show_bug.cgi?id=268134

    Reviewed by Jonathan Bedard.

    Added reason for failure and cleaned up error.

    * Tools/Scripts/libraries/webkitbugspy/webkitbugspy/bugzilla.py:
    (Tracker.populate): If the bug does not exist, populate returns None and prints an error message. This should help future error handling as well.
    * Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/commit.py:
    (Commit.main):

    Canonical link: https://commits.webkit.org/274756@main

Canonical link: https://commits.webkit.org/272448.574@safari-7618-branch
  • Loading branch information
briannafan authored and JonWBedard committed Feb 19, 2024
1 parent 49d0bdf commit ea4b0a7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Tools/Scripts/libraries/webkitbugspy/webkitbugspy/bugzilla.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ def populate(self, issue, member=None):
)
if response.status_code // 100 == 4 and self._logins_left:
self._logins_left -= 1
if response.json().get('code') == 101:
sys.stderr.write("{}\n".format(response.json().get('message')))
return None
response = response.json().get('bugs', []) if response.status_code == 200 else None
if response:
response = response[0]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def main(cls, args, repository, command=None, representation=None, **kwargs):
issue = Tracker.instance().issue(int(args.issue))
else:
issue = Tracker.from_string(args.issue)
if not issue:
if not issue or not issue.title:
sys.stderr.write("'{}' cannot be converted to an issue\n".format(args.issue))
return 1

Expand Down

0 comments on commit ea4b0a7

Please sign in to comment.