+2009-11-27 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] Kill WebKitLandingScripts
+ https://bugs.webkit.org/show_bug.cgi?id=31904
+
+ Step 6: Kill the rest.
+
+ * Scripts/modules/buildsteps.py:
+ * Scripts/modules/commands/download.py:
+ * Scripts/modules/commands/queries.py:
+ * Scripts/modules/commands/upload.py:
+ * Scripts/modules/landingsequence.py:
+ * Scripts/modules/scm.py:
+ * Scripts/modules/webkitlandingscripts.py: Removed.
+
2009-11-27 Adam Barth <abarth@webkit.org>
Reviewed by Eric Seidel.
import os
+from optparse import make_option
+
from modules.logging import log, error
from modules.processutils import run_and_throw_if_fail
-from modules.webkitlandingscripts import WebKitLandingScripts
from modules.webkitport import WebKitPort
class BuildSteps:
+ # FIXME: The options should really live on each "Step" object.
+ @staticmethod
+ def cleaning_options():
+ return [
+ make_option("--force-clean", action="store_true", dest="force_clean", default=False, help="Clean working directory before applying patches (removes local changes and commits)"),
+ make_option("--no-clean", action="store_false", dest="clean", default=True, help="Don't check if the working directory is clean before applying patches"),
+ ]
+
+ @staticmethod
+ def build_options():
+ return [
+ make_option("--ignore-builders", action="store_false", dest="check_builders", default=True, help="Don't check to see if the build.webkit.org builders are green before landing."),
+ make_option("--quiet", action="store_true", dest="quiet", default=False, help="Produce less console output."),
+ make_option("--non-interactive", action="store_true", dest="non_interactive", default=False, help="Never prompt the user, fail as fast as possible."),
+ ] + WebKitPort.port_options()
+
+ @staticmethod
+ def land_options():
+ return [
+ make_option("--no-update", action="store_false", dest="update", default=True, help="Don't update the working directory."),
+ make_option("--no-build", action="store_false", dest="build", default=True, help="Commit without building first, implies --no-test."),
+ make_option("--no-test", action="store_false", dest="test", default=True, help="Commit without running run-webkit-tests."),
+ make_option("--no-close", action="store_false", dest="close_bug", default=True, help="Leave bug open after landing."),
+ ]
+
def _run_script(cls, script_name, quiet=False, port=WebKitPort):
log("Running %s" % script_name)
run_and_throw_if_fail(port.script_path(script_name), quiet)
from modules.bugzilla import Bugzilla, parse_bug_id
from modules.buildbot import BuildBot
+from modules.buildsteps import BuildSteps
from modules.changelogs import ChangeLog
from modules.comments import bug_comment_from_commit_text
from modules.grammar import pluralize
from modules.patchcollection import PatchCollection
from modules.scm import CommitMessage, detect_scm_system, ScriptError, CheckoutNeedsUpdate
from modules.statusbot import StatusBot
-from modules.webkitlandingscripts import WebKitLandingScripts, commit_message_for_this_commit
from modules.webkitport import WebKitPort
from modules.workqueue import WorkQueue, WorkQueueDelegate
name = "build"
show_in_main_help = False
def __init__(self):
- options = WebKitLandingScripts.cleaning_options()
- options += WebKitLandingScripts.build_options()
- options += WebKitLandingScripts.land_options()
+ options = BuildSteps.cleaning_options()
+ options += BuildSteps.build_options()
+ options += BuildSteps.land_options()
Command.__init__(self, "Update working copy and build", "", options)
def execute(self, options, args, tool):
name = "apply-attachment"
show_in_main_help = True
def __init__(self):
- options = WebKitApplyingScripts.apply_options() + WebKitLandingScripts.cleaning_options()
+ options = WebKitApplyingScripts.apply_options()
+ options += BuildSteps.cleaning_options()
Command.__init__(self, "Apply an attachment to the local working directory", "ATTACHMENT_ID", options=options)
def execute(self, options, args, tool):
name = "apply-patches"
show_in_main_help = True
def __init__(self):
- options = WebKitApplyingScripts.apply_options() + WebKitLandingScripts.cleaning_options()
+ options = WebKitApplyingScripts.apply_options()
+ options += BuildSteps.cleaning_options()
Command.__init__(self, "Apply reviewed patches from provided bugs to the local working directory", "BUGID", options=options)
def execute(self, options, args, tool):
log("Applying attachment %s from bug %s" % (patch["id"], patch["bug_id"]))
scm.apply_patch(patch)
if options.local_commit:
- commit_message = commit_message_for_this_commit(scm)
+ commit_message = scm.commit_message_for_this_commit()
scm.commit_locally_with_message(commit_message.message() or patch["name"])
options = [
make_option("-r", "--reviewer", action="store", type="string", dest="reviewer", help="Update ChangeLogs to say Reviewed by REVIEWER."),
]
- options += WebKitLandingScripts.build_options()
- options += WebKitLandingScripts.land_options()
+ options += BuildSteps.build_options()
+ options += BuildSteps.land_options()
Command.__init__(self, "Land the current working directory diff and updates the associated bug if any", "[BUGID]", options=options)
def guess_reviewer_from_bug(self, bugs, bug_id):
name = "check-style"
show_in_main_help = False
def __init__(self):
- options = WebKitLandingScripts.cleaning_options()
- options += WebKitLandingScripts.build_options()
+ options = BuildSteps.cleaning_options()
+ options += BuildSteps.build_options()
AbstractPatchProcessingCommand.__init__(self, "Run check-webkit-style on the specified attachments", "ATTACHMENT_ID [ATTACHMENT_IDS]", options)
def _fetch_list_of_patches_to_process(self, options, args, tool):
name = "build-attachment"
show_in_main_help = False
def __init__(self):
- options = WebKitLandingScripts.cleaning_options()
- options += WebKitLandingScripts.build_options()
+ options = BuildSteps.cleaning_options()
+ options += BuildSteps.build_options()
AbstractPatchProcessingCommand.__init__(self, "Apply and build patches from bugzilla", "ATTACHMENT_ID [ATTACHMENT_IDS]", options)
def _fetch_list_of_patches_to_process(self, options, args, tool):
class AbstractPatchLandingCommand(AbstractPatchProcessingCommand):
def __init__(self, help_text, args_description):
- options = WebKitLandingScripts.cleaning_options()
- options += WebKitLandingScripts.build_options()
- options += WebKitLandingScripts.land_options()
+ options = BuildSteps.cleaning_options()
+ options += BuildSteps.build_options()
+ options += BuildSteps.land_options()
AbstractPatchProcessingCommand.__init__(self, help_text, args_description, options)
def _prepare_to_process(self, options, args, tool):
name = "rollout"
show_in_main_help = True
def __init__(self):
- options = WebKitLandingScripts.cleaning_options()
- options += WebKitLandingScripts.build_options()
- options += WebKitLandingScripts.land_options()
+ options = BuildSteps.cleaning_options()
+ options += BuildSteps.build_options()
+ options += BuildSteps.land_options()
options.append(make_option("--complete-rollout", action="store_true", dest="complete_rollout", help="Commit the revert and re-open the original bug."))
Command.__init__(self, "Revert the given revision in the working copy and optionally commit the revert and re-open the original bug", "REVISION [BUGID]", options=options)
if not options.complete_rollout:
log("\nNOTE: Rollout support is experimental.\nPlease verify the rollout diff and use \"bugzilla-tool land-diff %s\" to commit the rollout." % bug_id)
else:
- comment_text = WebKitLandingScripts.build_and_commit(tool.scm(), options)
+ # FIXME: This function does not exist!!
+ # comment_text = WebKitLandingScripts.build_and_commit(tool.scm(), options)
+ raise ScriptError("OOPS! This option is not implemented (yet).")
self._reopen_bug_after_rollout(tool, bug_id, comment_text)
from modules.patchcollection import PatchCollection
from modules.scm import CommitMessage, detect_scm_system, ScriptError, CheckoutNeedsUpdate
from modules.statusbot import StatusBot
-from modules.webkitlandingscripts import WebKitLandingScripts, commit_message_for_this_commit
from modules.webkitport import WebKitPort
from modules.workqueue import WorkQueue, WorkQueueDelegate
from modules.patchcollection import PatchCollection
from modules.scm import CommitMessage, detect_scm_system, ScriptError, CheckoutNeedsUpdate
from modules.statusbot import StatusBot
-from modules.webkitlandingscripts import WebKitLandingScripts, commit_message_for_this_commit
from modules.webkitport import WebKitPort
from modules.workqueue import WorkQueue, WorkQueueDelegate
-# FIXME: Requires unit test. Blocking issue: commit_message_for_this_commit.
+# FIXME: Requires unit test.
class CommitMessageForCurrentDiff(Command):
name = "commit-message"
show_in_main_help = False
def execute(self, options, args, tool):
os.chdir(tool.scm().checkout_root)
- print "%s" % commit_message_for_this_commit(tool.scm()).message()
+ print "%s" % tool.scm().commit_message_for_this_commit().message()
class ObsoleteAttachments(Command):
if options.prompt:
(bug_title, comment_text) = self.prompt_for_bug_title_and_comment()
else:
- commit_message = commit_message_for_this_commit(tool.scm())
+ commit_message = tool.scm().commit_message_for_this_commit()
bug_title = commit_message.description(lstrip=True, strip_url=True)
comment_text = commit_message.body(lstrip=True)
from modules.comments import bug_comment_from_commit_text
from modules.logging import log
from modules.scm import ScriptError, CheckoutNeedsUpdate
-from modules.webkitlandingscripts import WebKitLandingScripts, commit_message_for_this_commit
from modules.webkitport import WebKitPort
from modules.workqueue import WorkQueue
self._tool.run_tests(launch_safari=not self._options.non_interactive, fail_fast=self._options.non_interactive, quiet=self._options.quiet, port=self._port)
def commit(self):
- commit_message = commit_message_for_this_commit(self._tool.scm())
+ commit_message = self._tool.scm().commit_message_for_this_commit()
return self._tool.scm().commit_with_message(commit_message.message())
def close_patch(self, commit_log):
import subprocess
# Import WebKit-specific modules.
+from modules.changelogs import ChangeLog
from modules.logging import error, log
def detect_scm_system(path):
changelog_paths.append(path)
return changelog_paths
+ # FIXME: Requires unit test
+ # FIXME: commit_message_for_this_commit and modified_changelogs don't
+ # really belong here. We should have a separate module for
+ # handling ChangeLogs.
+ def commit_message_for_this_commit(self):
+ changelog_paths = self.modified_changelogs()
+ if not len(changelog_paths):
+ raise ScriptError(message="Found no modified ChangeLogs, cannot create a commit message.\n"
+ "All changes require a ChangeLog. See:\n"
+ "http://webkit.org/coding/contributing.html")
+
+ changelog_messages = []
+ for changelog_path in changelog_paths:
+ log("Parsing ChangeLog: %s" % changelog_path)
+ changelog_entry = ChangeLog(changelog_path).latest_entry()
+ if not changelog_entry:
+ raise ScriptError(message="Failed to parse ChangeLog: " + os.path.abspath(changelog_path))
+ changelog_messages.append(changelog_entry)
+
+ # FIXME: We should sort and label the ChangeLog messages like commit-log-editor does.
+ return CommitMessage("".join(changelog_messages).splitlines())
+
@staticmethod
def in_working_directory(path):
raise NotImplementedError, "subclasses must implement"
+++ /dev/null
-#!/usr/bin/env python
-# Copyright (c) 2009, Google Inc. All rights reserved.
-# Copyright (c) 2009 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import os
-import StringIO
-import subprocess
-import sys
-
-from optparse import make_option
-
-from modules.changelogs import ChangeLog
-from modules.logging import error, log, tee
-from modules.scm import CommitMessage, detect_scm_system, ScriptError, CheckoutNeedsUpdate
-from modules.webkitport import WebKitPort
-
-def commit_message_for_this_commit(scm):
- changelog_paths = scm.modified_changelogs()
- if not len(changelog_paths):
- raise ScriptError(message="Found no modified ChangeLogs, cannot create a commit message.\n"
- "All changes require a ChangeLog. See:\n"
- "http://webkit.org/coding/contributing.html")
-
- changelog_messages = []
- for changelog_path in changelog_paths:
- log("Parsing ChangeLog: %s" % changelog_path)
- changelog_entry = ChangeLog(changelog_path).latest_entry()
- if not changelog_entry:
- raise ScriptError(message="Failed to parse ChangeLog: " + os.path.abspath(changelog_path))
- changelog_messages.append(changelog_entry)
-
- # FIXME: We should sort and label the ChangeLog messages like commit-log-editor does.
- return CommitMessage("".join(changelog_messages).splitlines())
-
-
-class WebKitLandingScripts:
- @staticmethod
- def cleaning_options():
- return [
- make_option("--force-clean", action="store_true", dest="force_clean", default=False, help="Clean working directory before applying patches (removes local changes and commits)"),
- make_option("--no-clean", action="store_false", dest="clean", default=True, help="Don't check if the working directory is clean before applying patches"),
- ]
-
- @staticmethod
- def build_options():
- return [
- make_option("--ignore-builders", action="store_false", dest="check_builders", default=True, help="Don't check to see if the build.webkit.org builders are green before landing."),
- make_option("--quiet", action="store_true", dest="quiet", default=False, help="Produce less console output."),
- make_option("--non-interactive", action="store_true", dest="non_interactive", default=False, help="Never prompt the user, fail as fast as possible."),
- ] + WebKitPort.port_options()
-
- @staticmethod
- def land_options():
- return [
- make_option("--no-update", action="store_false", dest="update", default=True, help="Don't update the working directory."),
- make_option("--no-build", action="store_false", dest="build", default=True, help="Commit without building first, implies --no-test."),
- make_option("--no-test", action="store_false", dest="test", default=True, help="Commit without running run-webkit-tests."),
- make_option("--no-close", action="store_false", dest="close_bug", default=True, help="Leave bug open after landing."),
- ]
-
-
-
-