Changeset 84575 in webkit


Ignore:
Timestamp:
Apr 21, 2011 5:34:13 PM (13 years ago)
Author:
abarth@webkit.org
Message:

2011-04-21 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

webkit-patch upload should assign the bug to you
https://bugs.webkit.org/show_bug.cgi?id=33699

This patch only re-assigns the bug if it is currently unassigned. We
can be more aggressive in the future if people want us to be more
agressive.

  • Scripts/webkitpy/common/net/bugzilla/bugzilla.py:
  • Scripts/webkitpy/tool/commands/upload_unittest.py:
  • Scripts/webkitpy/tool/mocktool.py:
  • Scripts/webkitpy/tool/steps/postdiff.py:
Location:
trunk/Tools
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r84568 r84575  
     12011-04-21  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        webkit-patch upload should assign the bug to you
     6        https://bugs.webkit.org/show_bug.cgi?id=33699
     7
     8        This patch only re-assigns the bug if it is currently unassigned.  We
     9        can be more aggressive in the future if people want us to be more
     10        agressive.
     11
     12        * Scripts/webkitpy/common/net/bugzilla/bugzilla.py:
     13        * Scripts/webkitpy/tool/commands/upload_unittest.py:
     14        * Scripts/webkitpy/tool/mocktool.py:
     15        * Scripts/webkitpy/tool/steps/postdiff.py:
     16
    1172011-04-21  Ojan Vafai  <ojan@chromium.org>
    218
  • trunk/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py

    r84455 r84575  
    737737        self.browser.submit()
    738738
    739     def reassign_bug(self, bug_id, assignee, comment_text=None):
    740         self.authenticate()
     739    def _has_control(self, form, id):
     740        return id in [control.id for control in form.controls]
     741
     742    def reassign_bug(self, bug_id, assignee=None, comment_text=None):
     743        self.authenticate()
     744
     745        if not assignee:
     746            assignee = self.username
    741747
    742748        log("Assigning bug %s to %s" % (bug_id, assignee))
     
    747753        self.browser.open(self.bug_url_for_bug_id(bug_id))
    748754        self.browser.select_form(name="changeform")
     755
     756        if not self._has_control(self.browser, "assigned_to"):
     757            log("""Failed to assign bug to you (can't find assigned_to) control.
     758Do you have EditBugs privilages at bugs.webkit.org?
     759https://bugs.webkit.org/userprefs.cgi?tab=permissions
     760
     761If not, you should email webkit-committers@webkit.org or ask in #webkit for
     762someone to add EditBugs to your bugs.webkit.org account.""")
     763            return
     764
    749765        if comment_text:
    750766            log(comment_text)
  • trunk/Tools/Scripts/webkitpy/tool/commands/upload_unittest.py

    r84455 r84575  
    4343    def test_assign_to_committer(self):
    4444        tool = MockTool()
    45         expected_stderr = "Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)\nBug 77 is already assigned to foo@foo.com (None).\nBug 76 has no non-obsolete patches, ignoring.\n"
     45        expected_stderr = """Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
     46MOCK reassign_bug: bug_id=42, assignee=eric@webkit.org
     47-- Begin comment --
     48Attachment 128 was posted by a committer and has review+, assigning to Eric Seidel for commit.
     49-- End comment --
     50Bug 77 is already assigned to foo@foo.com (None).
     51Bug 76 has no non-obsolete patches, ignoring.
     52"""
    4653        self.assert_execute_outputs(AssignToCommitter(), [], expected_stderr=expected_stderr, tool=tool)
    47         tool.bugs.reassign_bug.assert_called_with(42, "eric@webkit.org", "Attachment 128 was posted by a committer and has review+, assigning to Eric Seidel for commit.")
    4854
    4955    def test_obsolete_attachments(self):
     
    6369Was that diff correct?
    6470Obsoleting 2 old patches on bug 42
     71MOCK reassign_bug: bug_id=42, assignee=None
    6572MOCK add_patch_to_bug: bug_id=42, description=MOCK description, mark_for_review=True, mark_for_commit_queue=False, mark_for_landing=False
    6673MOCK: user.open_url: http://example.com/42
     
    110117Was that diff correct?
    111118Obsoleting 2 old patches on bug 42
     119MOCK reassign_bug: bug_id=42, assignee=None
    112120MOCK add_patch_to_bug: bug_id=42, description=MOCK description, mark_for_review=True, mark_for_commit_queue=False, mark_for_landing=False
    113121MOCK: user.open_url: http://example.com/42
  • trunk/Tools/Scripts/webkitpy/tool/mocktool.py

    r84549 r84575  
    330330        return "%s/%s%s" % (self.bug_server_url, attachment_id, action_param)
    331331
     332    def reassign_bug(self, bug_id, assignee=None, comment_text=None):
     333        log("MOCK reassign_bug: bug_id=%s, assignee=%s" % (bug_id, assignee))
     334        if comment_text:
     335            log("-- Begin comment --")
     336            log(comment_text)
     337            log("-- End comment --")
     338
    332339    def set_flag_on_attachment(self,
    333340                               attachment_id,
  • trunk/Tools/Scripts/webkitpy/tool/steps/postdiff.py

    r84455 r84575  
    4646        description = self._options.description or "Patch"
    4747        comment_text = self._options.comment
    48         self._tool.bugs.add_patch_to_bug(state["bug_id"], diff, description, comment_text=comment_text, mark_for_review=self._options.review, mark_for_commit_queue=self._options.request_commit)
     48        bug_id = state["bug_id"]
     49
     50        # FIXME: We should find some way of caching the Bug object instead of
     51        # going back to the network here.
     52        if self._tool.bugs.fetch_bug(bug_id).is_unassigned():
     53            self._tool.bugs.reassign_bug(bug_id)
     54
     55        self._tool.bugs.add_patch_to_bug(bug_id, diff, description, comment_text=comment_text, mark_for_review=self._options.review, mark_for_commit_queue=self._options.request_commit)
    4956        if self._options.open_bug:
    50             self._tool.user.open_url(self._tool.bugs.bug_url_for_bug_id(state["bug_id"]))
     57            self._tool.user.open_url(self._tool.bugs.bug_url_for_bug_id(bug_id))
Note: See TracChangeset for help on using the changeset viewer.