Commit ccdbe3aa authored by abarth@webkit.org's avatar abarth@webkit.org
Browse files

2010-01-07 Adam Barth <abarth@webkit.org>

        Reviewed by Eric Seidel.

        bugzilla-tool needs a new name
        https://bugs.webkit.org/show_bug.cgi?id=28459

        Rename bugzilla-tool to webkit-patch.  Also, rename some commands to
        make more sense with the new name.

        * Scripts/bugzilla-tool: Removed.
        * Scripts/webkit-patch: Added.
        * Scripts/webkit-tools-completion.sh:
        * Scripts/webkitpy/bugzilla_unittest.py:
        * Scripts/webkitpy/commands/download.py:
        * Scripts/webkitpy/commands/download_unittest.py:
        * Scripts/webkitpy/commands/early_warning_system.py:
        * Scripts/webkitpy/commands/queries.py:
        * Scripts/webkitpy/commands/queues.py:
        * Scripts/webkitpy/commands/queues_unittest.py:
        * Scripts/webkitpy/commands/upload.py:
        * Scripts/webkitpy/commands/upload_unittest.py:
        * Scripts/webkitpy/queueengine.py:
        * Scripts/webkitpy/steps/completerollout.py:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52907 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 90d7c007
2010-01-07 Adam Barth <abarth@webkit.org>
Reviewed by Eric Seidel.
bugzilla-tool needs a new name
https://bugs.webkit.org/show_bug.cgi?id=28459
Rename bugzilla-tool to webkit-patch. Also, rename some commands to
make more sense with the new name.
* Scripts/bugzilla-tool: Removed.
* Scripts/webkit-patch: Added.
* Scripts/webkit-tools-completion.sh:
* Scripts/webkitpy/bugzilla_unittest.py:
* Scripts/webkitpy/commands/download.py:
* Scripts/webkitpy/commands/download_unittest.py:
* Scripts/webkitpy/commands/early_warning_system.py:
* Scripts/webkitpy/commands/queries.py:
* Scripts/webkitpy/commands/queues.py:
* Scripts/webkitpy/commands/queues_unittest.py:
* Scripts/webkitpy/commands/upload.py:
* Scripts/webkitpy/commands/upload_unittest.py:
* Scripts/webkitpy/queueengine.py:
* Scripts/webkitpy/steps/completerollout.py:
2010-01-07 Chris Jerdonek <chris.jerdonek@gmail.com>
 
Reviewed by Eric Seidel.
......
......@@ -46,7 +46,7 @@ from webkitpy.scm import detect_scm_system
from webkitpy.user import User
class BugzillaTool(MultiCommandTool):
class WebKitPatch(MultiCommandTool):
global_options = [
make_option("--dry-run", action="store_true", dest="dry_run", default=False, help="do not touch remote servers"),
make_option("--status-host", action="store", dest="status_host", type="string", nargs=1, help="Hostname (e.g. localhost or commit.webkit.org) where status updates should be posted."),
......@@ -105,4 +105,4 @@ class BugzillaTool(MultiCommandTool):
if __name__ == "__main__":
BugzillaTool().main()
WebKitPatch().main()
......@@ -32,12 +32,12 @@
# Add a line like this to your .bashrc:
# source /path/to/WebKitCode/WebKitTools/Scripts/webkit-tools-completion.sh
__bugzilla-tool_generate_reply()
__webkit-patch_generate_reply()
{
COMPREPLY=( $(compgen -W "$1" -- "${COMP_WORDS[COMP_CWORD]}") )
}
_bugzilla-tool_complete()
_webkit-patch_complete()
{
local command current_command="${COMP_WORDS[1]}"
case "$current_command" in
......@@ -50,41 +50,45 @@ _bugzilla-tool_complete()
esac
if [ $COMP_CWORD -eq 1 ]; then
__bugzilla-tool_generate_reply "--help apply-patches bugs-to-commit commit-message land-diff land-patches obsolete-attachments patches-to-commit post-commits post-diff reviewed-patches"
__webkit-patch_generate_reply "--help apply-from-bug bugs-to-commit commit-message land land-from-bug obsolete-attachments patches-to-commit post upload tree-status rollout reviewed-patches"
return
fi
case "$command" in
apply-patches)
__bugzilla-tool_generate_reply "--force-clean --local-commit --no-clean --no-update"
apply-from-bug)
__webkit-patch_generate_reply "--force-clean --local-commit --no-clean --no-update"
return
;;
commit-message)
return
;;
land-diff)
__bugzilla-tool_generate_reply "--no-build --no-close --no-test --reviewer= -r"
land)
__webkit-patch_generate_reply "--no-build --no-close --no-test --reviewer= -r"
return
;;
land-patches)
__bugzilla-tool_generate_reply "--force-clean --no-build --no-clean --no-test"
land-from-bug)
__webkit-patch_generate_reply "--force-clean --no-build --no-clean --no-test"
return
;;
obsolete-attachments)
return
;;
post-diff)
__bugzilla-tool_generate_reply "--description --no-obsolete --no-review -m"
post)
__webkit-patch_generate_reply "--description --no-obsolete --no-review --request-commit -m --open-bug"
return
;;
upload)
__webkit-patch_generate_reply "--description --no-obsolete --no-review --request-commit --cc -m --open-bug"
return
;;
post-commits)
__bugzilla-tool_generate_reply "--bug-id= --no-comment --no-obsolete --no-review -b"
__webkit-patch_generate_reply "--bug-id= --no-comment --no-obsolete --no-review -b"
return
;;
esac
}
complete -F _bugzilla-tool_complete bugzilla-tool
complete -F _webkit-patch_complete webkit-patch
complete -W "--continue --fix-merged --help --no-continue --no-warnings --warnings -c -f -h -w" resolve-ChangeLogs
complete -W "--bug --diff --git-commit --git-index --git-reviewer --help --no-update --no-write --open --update --write -d -h -o" prepare-ChangeLog
complete -W "--clean --debug --help -h" build-webkit
......
......@@ -115,7 +115,7 @@ class BugzillaTest(unittest.TestCase):
<bug>
<bug_id>32585</bug_id>
<creation_ts>2009-12-15 15:17 PST</creation_ts>
<short_desc>bug to test bugzilla-tool and commit-queue failures</short_desc>
<short_desc>bug to test webkit-patch and commit-queue failures</short_desc>
<delta_ts>2009-12-27 21:04:50 PST</delta_ts>
<reporter_accessible>1</reporter_accessible>
<cclist_accessible>1</cclist_accessible>
......@@ -138,9 +138,9 @@ class BugzillaTest(unittest.TestCase):
<long_desc isprivate="0">
<who name="Eric Seidel">eric@webkit.org</who>
<bug_when>2009-12-15 15:17:28 PST</bug_when>
<thetext>bug to test bugzilla-tool and commit-queue failures
<thetext>bug to test webkit-patch and commit-queue failures
Ignore this bug. Just for testing failure modes of bugzilla-tool and the commit-queue.</thetext>
Ignore this bug. Just for testing failure modes of webkit-patch and the commit-queue.</thetext>
</long_desc>
<attachment
isobsolete="0"
......@@ -172,7 +172,7 @@ ZEZpbmlzaExvYWRXaXRoUmVhc29uOnJlYXNvbl07Cit9CisKIEBlbmQKIAogI2VuZGlmCg==
"""
_expected_example_bug_parsing = {
"id" : 32585,
"title" : u"bug to test bugzilla-tool and commit-queue failures",
"title" : u"bug to test webkit-patch and commit-queue failures",
"cc_emails" : ["foo@bar.com", "example@example.com"],
"reporter_email" : "eric@webkit.org",
"assigned_to_email" : "webkit-unassigned@lists.webkit.org",
......
......@@ -66,8 +66,8 @@ class BuildAndTest(AbstractSequencedCommmand):
]
class LandDiff(AbstractSequencedCommmand):
name = "land-diff"
class Land(AbstractSequencedCommmand):
name = "land"
help_text = "Land the current working directory diff and updates the associated bug if any"
argument_names = "[BUGID]"
show_in_main_help = True
......@@ -80,9 +80,9 @@ class LandDiff(AbstractSequencedCommmand):
steps.Commit,
steps.CloseBugForLandDiff,
]
long_help = """land-diff commits the current working copy diff (just as svn or git commit would).
land-diff will build and run the tests before committing.
If a bug id is provided, or one can be found in the ChangeLog land-diff will update the bug after committing."""
long_help = """land commits the current working copy diff (just as svn or git commit would).
land will build and run the tests before committing.
If a bug id is provided, or one can be found in the ChangeLog land will update the bug after committing."""
def _prepare_state(self, options, args, tool):
return {
......@@ -198,8 +198,8 @@ class ApplyAttachment(AbstractPatchApplyingCommand, ProcessAttachmentsMixin):
show_in_main_help = True
class ApplyPatches(AbstractPatchApplyingCommand, ProcessBugsMixin):
name = "apply-patches"
class ApplyFromBug(AbstractPatchApplyingCommand, ProcessBugsMixin):
name = "apply-from-bug"
help_text = "Apply reviewed patches from provided bugs to the local working directory"
argument_names = "BUGID [BUGIDS]"
show_in_main_help = True
......@@ -237,8 +237,8 @@ class LandAttachment(AbstractPatchLandingCommand, ProcessAttachmentsMixin):
show_in_main_help = True
class LandPatches(AbstractPatchLandingCommand, ProcessBugsMixin):
name = "land-patches"
class LandFromBug(AbstractPatchLandingCommand, ProcessBugsMixin):
name = "land-from-bug"
help_text = "Land all patches on the given bugs, optionally building and testing them first"
argument_names = "BUGID [BUGIDS]"
show_in_main_help = True
......
......@@ -67,11 +67,11 @@ class DownloadCommandsTest(CommandsTest):
options.update = True
options.local_commit = True
expected_stderr = "Updating working directory\n2 reviewed patches found on bug 42.\nProcessing 2 patches from 1 bug.\nProcessing patch 197 from bug 42.\nProcessing patch 128 from bug 42.\n"
self.assert_execute_outputs(ApplyPatches(), [42], options=options, expected_stderr=expected_stderr)
self.assert_execute_outputs(ApplyFromBug(), [42], options=options, expected_stderr=expected_stderr)
def test_land_diff(self):
expected_stderr = "Building WebKit\nUpdating bug 42\n"
self.assert_execute_outputs(LandDiff(), [42], options=self._default_options(), expected_stderr=expected_stderr)
self.assert_execute_outputs(Land(), [42], options=self._default_options(), expected_stderr=expected_stderr)
def test_check_style(self):
expected_stderr = "Processing 1 patch from 1 bug.\nUpdating working directory\nProcessing patch 197 from bug 42.\nRunning check-webkit-style\n"
......@@ -87,10 +87,10 @@ class DownloadCommandsTest(CommandsTest):
def test_land_patches(self):
expected_stderr = "2 reviewed patches found on bug 42.\nProcessing 2 patches from 1 bug.\nUpdating working directory\nProcessing patch 197 from bug 42.\nBuilding WebKit\nUpdating working directory\nProcessing patch 128 from bug 42.\nBuilding WebKit\n"
self.assert_execute_outputs(LandPatches(), [42], options=self._default_options(), expected_stderr=expected_stderr)
self.assert_execute_outputs(LandFromBug(), [42], options=self._default_options(), expected_stderr=expected_stderr)
def test_rollout(self):
expected_stderr = "Updating working directory\nRunning prepare-ChangeLog\n\nNOTE: Rollout support is experimental.\nPlease verify the rollout diff and use \"bugzilla-tool land-diff 12345\" to commit the rollout.\n"
expected_stderr = "Updating working directory\nRunning prepare-ChangeLog\n\nNOTE: Rollout support is experimental.\nPlease verify the rollout diff and use \"webkit-patch land 12345\" to commit the rollout.\n"
self.assert_execute_outputs(Rollout(), [852, "Reason"], options=self._default_options(), expected_stderr=expected_stderr)
def test_complete_rollout(self):
......
......@@ -42,7 +42,7 @@ class AbstractEarlyWarningSystem(AbstractReviewQueue):
def should_proceed_with_work_item(self, patch):
try:
self.run_bugzilla_tool(["build", self.port.flag(), "--force-clean", "--quiet"])
self.run_webkit_patch(["build", self.port.flag(), "--force-clean", "--quiet"])
self._update_status("Building", patch)
except ScriptError, e:
self._update_status("Unable to perform a build")
......@@ -51,7 +51,7 @@ class AbstractEarlyWarningSystem(AbstractReviewQueue):
def process_work_item(self, patch):
try:
self.run_bugzilla_tool([
self.run_webkit_patch([
"build-attachment",
self.port.flag(),
"--force-clean",
......
......@@ -118,7 +118,6 @@ class ReviewedPatches(AbstractDeclarativeCommmand):
class TreeStatus(AbstractDeclarativeCommmand):
name = "tree-status"
show_in_main_help = True
help_text = "Print the status of the %s buildbots" % BuildBot.default_host
long_help = """Fetches build status from http://build.webkit.org/one_box_per_builder
and displayes the status of each builder."""
......
......@@ -106,12 +106,12 @@ class AbstractQueue(Command, QueueEngineDelegate):
def handle_unexpected_error(self, work_item, message):
raise NotImplementedError, "subclasses must implement"
def run_bugzilla_tool(self, args):
bugzilla_tool_args = [self.tool.path()]
def run_webkit_patch(self, args):
webkit_patch_args = [self.tool.path()]
# FIXME: This is a hack, we should have a more general way to pass global options.
bugzilla_tool_args += ["--status-host=%s" % self.tool.status_server.host]
bugzilla_tool_args += map(str, args)
self.tool.executive.run_and_throw_if_fail(bugzilla_tool_args)
webkit_patch_args += ["--status-host=%s" % self.tool.status_server.host]
webkit_patch_args += map(str, args)
self.tool.executive.run_and_throw_if_fail(webkit_patch_args)
def log_progress(self, patch_ids):
log("%s in %s [%s]" % (pluralize("patch", len(patch_ids)), self.name, ", ".join(map(str, patch_ids))))
......@@ -147,7 +147,7 @@ class CommitQueue(AbstractQueue, StepSequenceErrorHandler):
def _can_build_and_test(self):
try:
self.run_bugzilla_tool(["build-and-test", "--force-clean", "--non-interactive", "--build-style=both", "--quiet"])
self.run_webkit_patch(["build-and-test", "--force-clean", "--non-interactive", "--build-style=both", "--quiet"])
except ScriptError, e:
self._update_status("Unabled to successfully build and test", None)
return False
......@@ -177,7 +177,7 @@ class CommitQueue(AbstractQueue, StepSequenceErrorHandler):
# We pass --no-update here because we've already validated
# that the current revision actually builds and passes the tests.
# If we update, we risk moving to a revision that doesn't!
self.run_bugzilla_tool(["land-attachment", "--force-clean", "--non-interactive", "--no-update", "--parent-command=commit-queue", "--build-style=both", "--quiet", patch["id"]])
self.run_webkit_patch(["land-attachment", "--force-clean", "--non-interactive", "--no-update", "--parent-command=commit-queue", "--build-style=both", "--quiet", patch["id"]])
self._did_pass(patch)
except ScriptError, e:
self._did_fail(patch)
......@@ -255,7 +255,7 @@ class StyleQueue(AbstractReviewQueue):
def process_work_item(self, patch):
try:
self.run_bugzilla_tool(["check-style", "--force-clean", "--non-interactive", "--parent-command=style-queue", patch["id"]])
self.run_webkit_patch(["check-style", "--force-clean", "--non-interactive", "--parent-command=style-queue", patch["id"]])
message = "%s ran check-webkit-style on attachment %s without any errors." % (self.name, patch["id"])
self.tool.bugs.post_comment_to_bug(patch["bug_id"], message, cc=self.watchers)
self._did_pass(patch)
......
......@@ -49,18 +49,18 @@ class AbstractQueueTest(CommandsTest):
self._assert_log_progress_output(["1","2","3"], "3 patches in test-queue [1, 2, 3]\n")
self._assert_log_progress_output([1], "1 patch in test-queue [1]\n")
def _assert_run_bugzilla_tool(self, run_args):
def _assert_run_webkit_patch(self, run_args):
queue = TestQueue()
tool = MockBugzillaTool()
queue.bind_to_tool(tool)
queue.run_bugzilla_tool(run_args)
queue.run_webkit_patch(run_args)
expected_run_args = ["echo", "--status-host=example.com"] + map(str, run_args)
tool.executive.run_and_throw_if_fail.assert_called_with(expected_run_args)
def test_run_bugzilla_tool(self):
self._assert_run_bugzilla_tool([1])
self._assert_run_bugzilla_tool(["one", 2])
def test_run_webkit_patch(self):
self._assert_run_webkit_patch([1])
self._assert_run_webkit_patch(["one", 2])
class CommitQueueTest(QueuesTest):
......
......@@ -109,11 +109,10 @@ class AbstractPatchUploadingCommand(AbstractSequencedCommmand):
return bug_id
class PostDiff(AbstractPatchUploadingCommand):
name = "post-diff"
class Post(AbstractPatchUploadingCommand):
name = "post"
help_text = "Attach the current working directory diff to a bug as a patch file"
argument_names = "[BUGID]"
show_in_main_help = True
steps = [
steps.ConfirmDiff,
steps.ObsoletePatches,
......@@ -128,8 +127,8 @@ class PostDiff(AbstractPatchUploadingCommand):
return state
class PrepareDiff(AbstractSequencedCommmand):
name = "prepare-diff"
class Prepare(AbstractSequencedCommmand):
name = "prepare"
help_text = "Creates a bug (or prompts for an existing bug) and prepares the ChangeLogs"
argument_names = "[BUGID]"
steps = [
......@@ -143,10 +142,11 @@ class PrepareDiff(AbstractSequencedCommmand):
return { "bug_id" : bug_id }
class SubmitPatch(AbstractPatchUploadingCommand):
name = "submit-patch"
class Upload(AbstractPatchUploadingCommand):
name = "upload"
help_text = "Automates the process of uploading a patch for review"
argument_names = "[BUGID]"
show_in_main_help = True
steps = [
steps.PromptForBugOrTitle,
steps.CreateBug,
......@@ -156,10 +156,10 @@ class SubmitPatch(AbstractPatchUploadingCommand):
steps.ObsoletePatches,
steps.PostDiff,
]
long_help = """submit-patch uploads the current diff to bugs.webkit.org.
If no bug id is provided, submit-patch will create a bug.
If the current diff does not have a ChangeLog, submit-patch
will prepare a ChangeLog. Once a patch is read, submit-patch
long_help = """upload uploads the current diff to bugs.webkit.org.
If no bug id is provided, upload will create a bug.
If the current diff does not have a ChangeLog, upload
will prepare a ChangeLog. Once a patch is read, upload
will open the ChangeLogs for editing using the command in the
EDITOR environment variable and will display the diff using the
command in the PAGER environment variable."""
......@@ -170,9 +170,10 @@ class SubmitPatch(AbstractPatchUploadingCommand):
return state
class EditChangeLog(AbstractSequencedCommmand):
name = "edit-changelog"
class EditChangeLogs(AbstractSequencedCommmand):
name = "edit-changelogs"
help_text = "Opens modified ChangeLogs in $EDITOR"
show_in_main_help = True
steps = [
steps.EditChangeLog,
]
......@@ -180,10 +181,9 @@ class EditChangeLog(AbstractSequencedCommmand):
class PostCommits(AbstractDeclarativeCommmand):
name = "post-commits"
show_in_main_help = True
help_text = "Attach a range of local commits to bugs as patch files"
argument_names = "COMMITISH"
def __init__(self):
options = [
make_option("-b", "--bug-id", action="store", type="string", dest="bug_id", help="Specify bug id if no URL is provided in the commit log."),
......@@ -210,7 +210,7 @@ class PostCommits(AbstractDeclarativeCommmand):
def execute(self, options, args, tool):
commit_ids = tool.scm().commit_ids_from_commitish_arguments(args)
if len(commit_ids) > 10: # We could lower this limit, 10 is too many for one bug as-is.
error("bugzilla-tool does not support attaching %s at once. Are you sure you passed the right commit range?" % (pluralize("patch", len(commit_ids))))
error("webkit-patch does not support attaching %s at once. Are you sure you passed the right commit range?" % (pluralize("patch", len(commit_ids))))
have_obsoleted_patches = set()
for commit_id in commit_ids:
......
......@@ -54,17 +54,17 @@ class UploadCommandsTest(CommandsTest):
def test_post_diff(self):
expected_stderr = "Obsoleting 2 old patches on bug 42\n"
self.assert_execute_outputs(PostDiff(), [42], expected_stderr=expected_stderr)
self.assert_execute_outputs(Post(), [42], expected_stderr=expected_stderr)
def test_prepare_diff_with_arg(self):
self.assert_execute_outputs(PrepareDiff(), [42])
self.assert_execute_outputs(Prepare(), [42])
def test_prepare_diff(self):
self.assert_execute_outputs(PrepareDiff(), [])
self.assert_execute_outputs(Prepare(), [])
def test_submit_patch(self):
expected_stderr = "Obsoleting 2 old patches on bug 42\n"
self.assert_execute_outputs(SubmitPatch(), [42], expected_stderr=expected_stderr)
self.assert_execute_outputs(Upload(), [42], expected_stderr=expected_stderr)
def test_mark_bug_fixed(self):
tool = MockBugzillaTool()
......@@ -75,4 +75,4 @@ class UploadCommandsTest(CommandsTest):
self.assert_execute_outputs(MarkBugFixed(), [], expected_stderr=expected_stderr, tool=tool, options=options)
def test_edit_changelog(self):
self.assert_execute_outputs(EditChangeLog(), [])
self.assert_execute_outputs(EditChangeLogs(), [])
......@@ -107,7 +107,7 @@ class QueueEngine:
# handled in the child process and we should just keep looping.
if e.exit_code == self.handled_error_code:
continue
message = "Unexpected failure when landing patch! Please file a bug against bugzilla-tool.\n%s" % e.message_with_output()
message = "Unexpected failure when landing patch! Please file a bug against webkit-patch.\n%s" % e.message_with_output()
self._delegate.handle_unexpected_error(work_item, message)
except KeyboardInterrupt, e:
log("\nUser terminated queue.")
......
......@@ -51,7 +51,7 @@ class CompleteRollout(MetaStep):
# FIXME: Fully automated rollout is not 100% idiot-proof yet, so for now just log with instructions on how to complete the rollout.
# Once we trust rollout we will remove this option.
if not self._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)
log("\nNOTE: Rollout support is experimental.\nPlease verify the rollout diff and use \"webkit-patch land %s\" to commit the rollout." % bug_id)
return
MetaStep.run(self, state)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment