Changeset 214238 in webkit


Ignore:
Timestamp:
Mar 21, 2017 5:45:15 PM (7 years ago)
Author:
aakash_jain@apple.com
Message:

EWS fails to parse_bug_id_from_attachment_page after bugzilla upgrade
https://bugs.webkit.org/show_bug.cgi?id=169937
<rdar://problem/31181859>

Reviewed by Alexey Proskuryakov.

  • Scripts/webkitpy/common/net/bugzilla/bugzilla.py:

(Bugzilla._parse_bug_id_from_attachment_page): Since rel tag is no longer present, parsing the bug id from bug_title.

  • Scripts/webkitpy/common/net/bugzilla/bugzilla_unittest.py: Fixed unit test.
Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r214233 r214238  
     12017-03-21  Aakash Jain  <aakash_jain@apple.com>
     2
     3        EWS fails to parse_bug_id_from_attachment_page after bugzilla upgrade
     4        https://bugs.webkit.org/show_bug.cgi?id=169937
     5        <rdar://problem/31181859>
     6
     7        Reviewed by Alexey Proskuryakov.
     8
     9        * Scripts/webkitpy/common/net/bugzilla/bugzilla.py:
     10        (Bugzilla._parse_bug_id_from_attachment_page): Since rel tag is no longer present, parsing the bug id from bug_title.
     11        * Scripts/webkitpy/common/net/bugzilla/bugzilla_unittest.py: Fixed unit test.
     12
    1132017-03-21  Aakash Jain  <aakash_jain@apple.com>
    214
  • trunk/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py

    r214233 r214238  
    487487    def _parse_bug_id_from_attachment_page(self, page):
    488488        # The "Up" relation happens to point to the bug.
    489         up_link = BeautifulSoup(page).find('link', rel='Up')
    490         if not up_link:
     489        title = BeautifulSoup(page).find('div', attrs={'id':'bug_title'})
     490        if not title :
    491491            _log.warning("This attachment does not exist (or you don't have permissions to view it).")
    492492            return None
    493         match = re.search("show_bug.cgi\?id=(?P<bug_id>\d+)", up_link['href'])
     493        match = re.search("show_bug.cgi\?id=(?P<bug_id>\d+)", str(title))
     494        if not match:
     495            _log.warning("Unable to parse bug id from attachment")
     496            return None
    494497        return int(match.group('bug_id'))
    495498
  • trunk/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla_unittest.py

    r202362 r214238  
    239239    <title>
    240240  Attachment 41073 Details for Bug 27314</title>
    241 <link rel="Top" href="https://bugs.webkit.org/">
    242     <link rel="Up" href="show_bug.cgi?id=27314">
     241<div id="bug_title">
     242  Attachment 41073 Details for
     243  <a class="bz_bug_link bz_status_ASSIGNED " title="Sample bug" href="show_bug.cgi?id=27314">Bug 27314</a>: Sample bug</div>
    243244"""
    244245
Note: See TracChangeset for help on using the changeset viewer.