Skip to content
Permalink
Browse files
2010-10-26 Eric Seidel <eric@webkit.org>
        Reviewed by Ojan Vafai.

        Remove rietveld code now that it's unused
        https://bugs.webkit.org/show_bug.cgi?id=48359

        Was cool that we added this support, but now that it's
        not used it makes little sense to keep it around.
        We can always restore this code from SVN if we need it.

        * Scripts/webkitpy/common/config/__init__.py:
        * Scripts/webkitpy/common/net/bugzilla.py:
        * Scripts/webkitpy/common/net/bugzilla_unittest.py:
        * Scripts/webkitpy/common/net/rietveld.py: Removed.
        * Scripts/webkitpy/common/net/rietveld_unittest.py: Removed.
        * Scripts/webkitpy/thirdparty/__init__.py:
        * Scripts/webkitpy/tool/commands/download.py:
        * Scripts/webkitpy/tool/commands/download_unittest.py:
        * Scripts/webkitpy/tool/commands/queues.py:
        * Scripts/webkitpy/tool/commands/queues_unittest.py:
        * Scripts/webkitpy/tool/main.py:
        * Scripts/webkitpy/tool/mocktool.py:
        * Scripts/webkitpy/tool/steps/__init__.py:
        * Scripts/webkitpy/tool/steps/postcodereview.py: Removed.

Canonical link: https://commits.webkit.org/61102@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@70570 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
eseidel committed Oct 26, 2010
1 parent c9d42f4 commit 1684bf23dbb823fc8678452ccac87272345fe4cb
Showing 15 changed files with 26 additions and 325 deletions.
@@ -1,3 +1,29 @@
2010-10-26 Eric Seidel <eric@webkit.org>

Reviewed by Ojan Vafai.

Remove rietveld code now that it's unused
https://bugs.webkit.org/show_bug.cgi?id=48359

Was cool that we added this support, but now that it's
not used it makes little sense to keep it around.
We can always restore this code from SVN if we need it.

* Scripts/webkitpy/common/config/__init__.py:
* Scripts/webkitpy/common/net/bugzilla.py:
* Scripts/webkitpy/common/net/bugzilla_unittest.py:
* Scripts/webkitpy/common/net/rietveld.py: Removed.
* Scripts/webkitpy/common/net/rietveld_unittest.py: Removed.
* Scripts/webkitpy/thirdparty/__init__.py:
* Scripts/webkitpy/tool/commands/download.py:
* Scripts/webkitpy/tool/commands/download_unittest.py:
* Scripts/webkitpy/tool/commands/queues.py:
* Scripts/webkitpy/tool/commands/queues_unittest.py:
* Scripts/webkitpy/tool/main.py:
* Scripts/webkitpy/tool/mocktool.py:
* Scripts/webkitpy/tool/steps/__init__.py:
* Scripts/webkitpy/tool/steps/postcodereview.py: Removed.

2010-10-26 Anders Carlsson <andersca@apple.com>

Reviewed by Sam Weinig.
@@ -1,6 +1 @@
# Required for Python to search this directory for module files

import re

codereview_server_host = "wkrietveld.appspot.com"
codereview_server_url = "https://%s/" % codereview_server_host
@@ -113,9 +113,6 @@ def review(self):
def commit_queue(self):
return self._attachment_dictionary.get("commit-queue")

def in_rietveld(self):
return self._attachment_dictionary.get("in-rietveld")

def url(self):
# FIXME: This should just return
# self._bugzilla().attachment_url_for_id(self.id()). scm_unittest.py
@@ -221,9 +218,6 @@ def commit_queued_patches(self, include_invalid=False):
# a valid committer.
return filter(lambda patch: patch.committer(), patches)

def in_rietveld_queue_patches(self):
return [patch for patch in self.patches() if patch.in_rietveld() == None]


# A container for all of the logic for making and parsing buzilla queries.
class BugzillaQueries(object):
@@ -287,16 +281,6 @@ def fetch_patches_from_commit_queue(self):
return sum([self._fetch_bug(bug_id).commit_queued_patches()
for bug_id in self.fetch_bug_ids_from_commit_queue()], [])

def fetch_first_patch_from_rietveld_queue(self):
# rietveld-queue processes all patches that don't have in-rietveld set.
query_url = "buglist.cgi?query_format=advanced&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&field0-0-0=flagtypes.name&type0-0-0=notsubstring&value0-0-0=in-rietveld&field0-1-0=attachments.ispatch&type0-1-0=equals&value0-1-0=1&order=Last+Changed&field0-2-0=attachments.isobsolete&type0-2-0=equals&value0-2-0=0"
bugs = self._fetch_bug_ids_advanced_query(query_url)
if not len(bugs):
return None

patches = self._fetch_bug(bugs[0]).in_rietveld_queue_patches()
return patches[0] if len(patches) else None

def _fetch_bug_ids_from_review_queue(self):
review_queue_url = "buglist.cgi?query_format=advanced&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&field0-0-0=flagtypes.name&type0-0-0=equals&value0-0-0=review?"
return self._fetch_bug_ids_advanced_query(review_queue_url)
@@ -501,8 +485,6 @@ def _parse_attachment_element(self, element, bug_id):
attachment['type'] = self._string_contents(element.find('type'))
self._parse_attachment_flag(
element, 'review', attachment, 'reviewer_email')
self._parse_attachment_flag(
element, 'in-rietveld', attachment, 'rietveld_uploader_email')
self._parse_attachment_flag(
element, 'commit-queue', attachment, 'committer_email')
return attachment
@@ -767,8 +749,6 @@ def _find_select_element_for_flag(self, flag_name):
return self.browser.find_control(type='select', nr=0)
elif flag_name == "commit-queue":
return self.browser.find_control(type='select', nr=1)
elif flag_name == "in-rietveld":
return self.browser.find_control(type='select', nr=2)
raise Exception("Don't know how to find flag named \"%s\"" % flag_name)

def clear_attachment_flags(self,
@@ -83,11 +83,6 @@ class BugzillaTest(unittest.TestCase):
status="+"
setter="two@test.com"
/>
<flag name="in-rietveld"
id="17933"
status="+"
setter="three@test.com"
/>
</attachment>
'''
_expected_example_attachment_parsing = {
@@ -103,8 +98,6 @@ class BugzillaTest(unittest.TestCase):
'reviewer_email' : 'one@test.com',
'commit-queue' : '+',
'committer_email' : 'two@test.com',
'in-rietveld': '+',
'rietveld_uploader_email': 'three@test.com',
'attacher_email' : 'christian.plesner.hansen@gmail.com',
}

This file was deleted.

This file was deleted.

@@ -77,12 +77,6 @@
installer.install(url="http://www.adambarth.com/webkit/eliza",
target_name="eliza.py")

rietveld_dir = os.path.join(autoinstalled_dir, "rietveld")
installer = AutoInstaller(target_dir=rietveld_dir)
installer.install(url="http://webkit-rietveld.googlecode.com/svn/trunk/upload_v26/upload.py",
target_name="upload.py")


# Since irclib and ircbot are two top-level packages, we need to import
# them separately. We group them into an irc package for better
# organization purposes.
@@ -221,18 +221,6 @@ class BuildAndTestAttachment(AbstractPatchSequencingCommand, ProcessAttachmentsM
]


class PostAttachmentToRietveld(AbstractPatchSequencingCommand, ProcessAttachmentsMixin):
name = "post-attachment-to-rietveld"
help_text = "Uploads a bugzilla attachment to rietveld"
arguments_names = "ATTACHMENTID"
main_steps = [
steps.CleanWorkingDirectory,
steps.Update,
steps.ApplyPatch,
steps.PostCodeReview,
]


class AbstractPatchApplyingCommand(AbstractPatchSequencingCommand):
prepare_steps = [
steps.EnsureLocalCommitIfNeeded,
@@ -118,10 +118,6 @@ def test_build_attachment(self):
expected_stderr = "Processing 1 patch from 1 bug.\nUpdating working directory\nProcessing patch 197 from bug 42.\nBuilding WebKit\n"
self.assert_execute_outputs(BuildAttachment(), [197], options=self._default_options(), expected_stderr=expected_stderr)

def test_post_attachment_to_rietveld(self):
expected_stderr = "Processing 1 patch from 1 bug.\nUpdating working directory\nProcessing patch 197 from bug 42.\nMOCK: Uploading patch to rietveld\nMOCK setting flag 'in-rietveld' to '+' on attachment '197' with comment 'None' and additional comment 'None'\n"
self.assert_execute_outputs(PostAttachmentToRietveld(), [197], options=self._default_options(), expected_stderr=expected_stderr)

def test_land_attachment(self):
# FIXME: This expected result is imperfect, notice how it's seeing the same patch as still there after it thought it would have cleared the flags.
expected_stderr = """Processing 1 patch from 1 bug.
@@ -348,52 +348,6 @@ def handle_checkout_needs_update(cls, tool, state, options, error):
raise TryAgain()


# FIXME: All the Rietveld code is no longer used and should be deleted.
class RietveldUploadQueue(AbstractPatchQueue, StepSequenceErrorHandler):
name = "rietveld-upload-queue"

def __init__(self):
AbstractPatchQueue.__init__(self)

# AbstractPatchQueue methods

def next_work_item(self):
patch_id = self._tool.bugs.queries.fetch_first_patch_from_rietveld_queue()
if patch_id:
return patch_id
self._update_status("Empty queue")

def should_proceed_with_work_item(self, patch):
self._update_status("Uploading patch", patch)
return True

def process_work_item(self, patch):
try:
self.run_webkit_patch(["post-attachment-to-rietveld", "--force-clean", "--non-interactive", "--parent-command=rietveld-upload-queue", patch.id()])
self._did_pass(patch)
return True
except ScriptError, e:
if e.exit_code != QueueEngine.handled_error_code:
self._did_fail(patch)
raise e

@classmethod
def _reject_patch(cls, tool, patch_id):
tool.bugs.set_flag_on_attachment(patch_id, "in-rietveld", "-")

def handle_unexpected_error(self, patch, message):
log(message)
self._reject_patch(self._tool, patch.id())

# StepSequenceErrorHandler methods

@classmethod
def handle_script_error(cls, tool, state, script_error):
log(script_error.message_with_output())
cls._update_status_for_script_error(tool, state, script_error)
cls._reject_patch(tool, state["patch"].id())


class AbstractReviewQueue(AbstractPatchQueue, StepSequenceErrorHandler):
"""This is the base-class for the EWS queues and the style-queue."""
def __init__(self, options=None):
@@ -361,17 +361,6 @@ def test_layout_test_results(self):
queue._read_file_contents = lambda path: ""
self.assertEquals(queue.layout_test_results(), None)

class RietveldUploadQueueTest(QueuesTest):
def test_rietveld_upload_queue(self):
expected_stderr = {
"begin_work_queue": self._default_begin_work_queue_stderr("rietveld-upload-queue", MockSCM.fake_checkout_root),
"should_proceed_with_work_item": "MOCK: update_status: rietveld-upload-queue Uploading patch\n",
"process_work_item": "MOCK: update_status: rietveld-upload-queue Pass\nMOCK: release_work_item: rietveld-upload-queue 197\n",
"handle_unexpected_error": "Mock error message\nMOCK setting flag 'in-rietveld' to '-' on attachment '197' with comment 'None' and additional comment 'None'\n",
"handle_script_error": "ScriptError error message\nMOCK: update_status: rietveld-upload-queue ScriptError error message\nMOCK setting flag 'in-rietveld' to '-' on attachment '197' with comment 'None' and additional comment 'None'\n",
}
self.assert_queue_outputs(RietveldUploadQueue(), expected_stderr=expected_stderr)


class StyleQueueTest(QueuesTest):
def test_style_queue(self):
@@ -37,7 +37,6 @@
from webkitpy.common.config.ports import WebKitPort
from webkitpy.common.net.bugzilla import Bugzilla
from webkitpy.common.net.buildbot import BuildBot
from webkitpy.common.net.rietveld import Rietveld
from webkitpy.common.net.irc.ircproxy import IRCProxy
from webkitpy.common.system.executive import Executive
from webkitpy.common.system.user import User
@@ -79,7 +78,6 @@ def __init__(self, path):
self._scm = None
self._checkout = None
self.status_server = StatusServer()
self.codereview = Rietveld(self.executive)
self.port_factory = port.factory

def scm(self):
@@ -126,7 +124,6 @@ def handle_global_options(self, options):
if options.dry_run:
self.scm().dryrun = True
self.bugs.dryrun = True
self.codereview.dryrun = True
if options.status_host:
self.status_server.set_host(options.status_host)
if options.bot_id:

0 comments on commit 1684bf2

Please sign in to comment.