Changeset 56040 in webkit


Ignore:
Timestamp:
Mar 15, 2010 10:55:38 PM (14 years ago)
Author:
abarth@webkit.org
Message:

2010-03-15 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

Let commit-queue land rollout patches even when the tree is red
https://bugs.webkit.org/show_bug.cgi?id=36155

Now the commit-queue will land patches whose name begins with "ROLLOUT "
even if the tree is red. The patches still go through the usual build
and test process, but they can be landed while the tree is on fire.

  • Scripts/webkitpy/bugzilla.py:
  • Scripts/webkitpy/commands/queues.py:
  • Scripts/webkitpy/commands/queues_unittest.py:
  • Scripts/webkitpy/commands/queuestest.py:
  • Scripts/webkitpy/mock_bugzillatool.py:
Location:
trunk/WebKitTools
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r56034 r56040  
     12010-03-15  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Let commit-queue land rollout patches even when the tree is red
     6        https://bugs.webkit.org/show_bug.cgi?id=36155
     7
     8        Now the commit-queue will land patches whose name begins with "ROLLOUT "
     9        even if the tree is red.  The patches still go through the usual build
     10        and test process, but they can be landed while the tree is on fire.
     11
     12        * Scripts/webkitpy/bugzilla.py:
     13        * Scripts/webkitpy/commands/queues.py:
     14        * Scripts/webkitpy/commands/queues_unittest.py:
     15        * Scripts/webkitpy/commands/queuestest.py:
     16        * Scripts/webkitpy/mock_bugzillatool.py:
     17
    1182010-03-15  Adam Barth  <abarth@webkit.org>
    219
  • trunk/WebKitTools/Scripts/webkitpy/bugzilla.py

    r55969 r56040  
    6767class Attachment(object):
    6868
     69    rollout_preamble = "ROLLOUT of r"
     70
    6971    def __init__(self, attachment_dictionary, bug):
    7072        self._attachment_dictionary = attachment_dictionary
     
    9799    def is_obsolete(self):
    98100        return not not self._attachment_dictionary.get("is_obsolete")
     101
     102    def is_rollout(self):
     103        return self.name().startswith(self.rollout_preamble)
    99104
    100105    def name(self):
  • trunk/WebKitTools/Scripts/webkitpy/commands/queues.py

    r55880 r56040  
    152152        bug_ids = self.tool.bugs.queries.fetch_bug_ids_from_commit_queue()
    153153        all_patches = sum([self.tool.bugs.fetch_bug(bug_id).commit_queued_patches(include_invalid=True) for bug_id in bug_ids], [])
    154         return self.committer_validator.patches_after_rejecting_invalid_commiters_and_reviewers(all_patches)
     154        valid_patches = self.committer_validator.patches_after_rejecting_invalid_commiters_and_reviewers(all_patches)
     155        if not self._builders_are_green():
     156            return filter(lambda patch: patch.is_rollout(), valid_patches)
     157        return valid_patches
    155158
    156159    def next_work_item(self):
     
    181184
    182185    def should_proceed_with_work_item(self, patch):
    183         if not self._builders_are_green():
    184             return False
    185         if not self._can_build_and_test():
    186             return False
    187         if not self._builders_are_green():
    188             return False
     186        if not patch.is_rollout():
     187            if not self._builders_are_green():
     188                return False
     189            if not self._can_build_and_test():
     190                return False
     191            if not self._builders_are_green():
     192                return False
    189193        self._update_status("Landing patch", patch)
    190194        return True
  • trunk/WebKitTools/Scripts/webkitpy/commands/queues_unittest.py

    r55968 r56040  
    2929import os
    3030
     31from webkitpy.bugzilla import Attachment
    3132from webkitpy.commands_references import Mock
    3233from webkitpy.commands.commandtest import CommandsTest
     
    111112        self.assert_queue_outputs(CommitQueue(), expected_stderr=expected_stderr)
    112113
     114    def test_rollout(self):
     115        tool = MockBugzillaTool()
     116        tool.buildbot.light_tree_on_fire()
     117        expected_stderr = {
     118            "begin_work_queue" : "CAUTION: commit-queue will discard all local changes in \"%s\"\nRunning WebKit commit-queue.\n" % os.getcwd(),
     119            # FIXME: The commit-queue warns about bad committers twice.  This is due to the fact that we access Attachment.reviewer() twice and it logs each time.
     120            "next_work_item" : """Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
     121Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
     1221 patch in commit-queue [106]
     123""",
     124        }
     125        self.assert_queue_outputs(CommitQueue(), tool=tool, expected_stderr=expected_stderr)
     126
    113127
    114128class StyleQueueTest(QueuesTest):
  • trunk/WebKitTools/Scripts/webkitpy/commands/queuestest.py

    r55968 r56040  
    4545class QueuesTest(unittest.TestCase):
    4646    mock_work_item = Attachment({
    47         "id" : 1234,
    48         "bug_id" : 345,
     47        "id": 1234,
     48        "bug_id": 345,
     49        "name": "Patch",
    4950        "attacher_email": "adam@example.com",
    5051    }, None)
  • trunk/WebKitTools/Scripts/webkitpy/mock_bugzillatool.py

    r55968 r56040  
    5050    "bug_id": 42,
    5151    "url": "http://example.com/197",
     52    "name": "Patch1",
    5253    "is_obsolete": False,
    5354    "is_patch": True,
     
    6465    "bug_id": 42,
    6566    "url": "http://example.com/128",
     67    "name": "Patch2",
    6668    "is_obsolete": False,
    6769    "is_patch": True,
     
    7880    "bug_id": 75,
    7981    "url": "http://example.com/103",
     82    "name": "Patch3",
    8083    "is_obsolete": False,
    8184    "is_patch": True,
     
    8992    "bug_id": 77,
    9093    "url": "http://example.com/103",
     94    "name": "Patch3",
    9195    "is_obsolete": False,
    9296    "is_patch": True,
     
    102106    "bug_id": 77,
    103107    "url": "http://example.com/103",
     108    "name": "Patch5",
    104109    "is_obsolete": False,
    105110    "is_patch": True,
     
    114119    "bug_id": 77,
    115120    "url": "http://example.com/103",
     121    "name": "ROLLOUT of r3489",
    116122    "is_obsolete": False,
    117123    "is_patch": True,
     
    126132    "bug_id": 76,
    127133    "url": "http://example.com/103",
     134    "name": "Patch7",
    128135    "is_obsolete": True,
    129136    "is_patch": True,
     
    266273class MockBuildBot(Mock):
    267274
     275    def __init__(self):
     276        self._tree_is_on_fire = False
     277
    268278    def builder_statuses(self):
    269279        return [{
     
    272282        }, {
    273283            "name": "Builder2",
    274             "is_green": True,
     284            "is_green": not self._tree_is_on_fire,
    275285        }]
    276286
    277287    def red_core_builders_names(self):
     288        if self._tree_is_on_fire:
     289            return "Builder2"
    278290        return []
     291
     292    def light_tree_on_fire(self):
     293        self._tree_is_on_fire = True
    279294
    280295
     
    316331    def modified_changelogs(self):
    317332        # Ideally we'd return something more interesting here.  The problem is
    318         # that LandDiff will try to actually read the path from disk!
     333        # that LandDiff will try to actually read the patch from disk!
    319334        return []
    320335
  • trunk/WebKitTools/Scripts/webkitpy/steps/postdiffforrevert.py

    r56034 r56040  
    2929import StringIO
    3030
     31from webkitpy.bugzilla import Attachment
    3132from webkitpy.steps.abstractstep import AbstractStep
    3233
     
    3738            state["bug_id"],
    3839            StringIO.StringIO(self.cached_lookup(state, "diff")),
    39             "ROLLOUT of r%s" % state["revision"],
     40            "%s%s" % (Attachment.rollout_preamble, state["revision"]),
    4041            mark_for_review=False,
    4142            mark_for_commit_queue=True)
Note: See TracChangeset for help on using the changeset viewer.