Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Unified Diff: tools/push-to-trunk/auto_roll.py

Issue 130403006: Add tree control feature to auto-roll script. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/push-to-trunk/common_includes.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/push-to-trunk/auto_roll.py
diff --git a/tools/push-to-trunk/auto_roll.py b/tools/push-to-trunk/auto_roll.py
index 3ba4481534f7903ef848cf36a30b5472a261f9e8..94fd7b4c97eab30c1d96918752e2441cd59a3d07 100755
--- a/tools/push-to-trunk/auto_roll.py
+++ b/tools/push-to-trunk/auto_roll.py
@@ -31,6 +31,7 @@ import optparse
import os
import re
import sys
+import urllib
from common_includes import *
@@ -47,6 +48,7 @@ class AutoRollOptions(CommonOptions):
def __init__(self, options):
super(AutoRollOptions, self).__init__(options)
self.requires_editor = False
+ self.status_password = options.status_password
class Preparation(Step):
@@ -78,6 +80,7 @@ class CheckTreeStatus(Step):
message = json.loads(status_json)["message"]
if re.search(r"nopush|no push", message, flags=re.I):
self.Die("Push to trunk disabled by tree state: %s" % message)
+ self.Persist("tree_message", message)
class FetchLatestRevision(Step):
@@ -121,18 +124,36 @@ class FetchLKGR(Step):
class PushToTrunk(Step):
MESSAGE = "Pushing to trunk if possible."
+ def PushTreeStatus(self, message):
+ if not self._options.status_password:
+ print "Skipping tree status update without password file."
+ return
+ params = {
+ "message": message,
+ "username": "v8-auto-roll@chromium.org",
+ "password": FileToText(self._options.status_password).strip(),
+ }
+ params = urllib.urlencode(params)
+ print "Pushing tree status: '%s'" % message
+ self.ReadURL("https://v8-status.appspot.com/status", params,
+ wait_plan=[5, 20])
+
def RunStep(self):
self.RestoreIfUnset("latest")
self.RestoreIfUnset("lkgr")
+ self.RestoreIfUnset("tree_message")
latest = int(self._state["latest"])
lkgr = int(self._state["lkgr"])
if latest == lkgr:
print "ToT (r%d) is clean. Pushing to trunk." % latest
+ self.PushTreeStatus("Tree is closed (preparing to push)")
+
# TODO(machenbach): Call push to trunk script.
# TODO(machenbach): Update the script before calling it.
# self._side_effect_handler.Command(
# "tools/push-to-trunk/push-to-trunk.py",
# "-f -c %s -r %s" % (self._options.c, self._options.r))
+ self.PushTreeStatus(self._state["tree_message"])
else:
print("ToT (r%d) is ahead of the LKGR (r%d). Skipping push to trunk."
% (latest, lkgr))
@@ -163,6 +184,8 @@ def BuildOptions():
result.add_option("-s", "--step", dest="s",
help="Specify the step where to start work. Default: 0.",
default=0, type="int")
+ result.add_option("--status-password",
+ help="A file with the password to the status app.")
return result
« no previous file with comments | « no previous file | tools/push-to-trunk/common_includes.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698