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

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

Issue 113973003: Add better remote control to push-to-trunk auto-roll script. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years 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/test_scripts.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 c7de2a7067554e1473baa2b996a6af67405c59a5..3ba4481534f7903ef848cf36a30b5472a261f9e8 100755
--- a/tools/push-to-trunk/auto_roll.py
+++ b/tools/push-to-trunk/auto_roll.py
@@ -26,15 +26,20 @@
# (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 json
import optparse
+import os
import re
import sys
from common_includes import *
+SETTINGS_LOCATION = "SETTINGS_LOCATION"
+
CONFIG = {
PERSISTFILE_BASENAME: "/tmp/v8-auto-roll-tempfile",
DOT_GIT_LOCATION: ".git",
+ SETTINGS_LOCATION: "~/.auto-roll",
}
@@ -52,6 +57,29 @@ class Preparation(Step):
self.CommonPrepare()
+class CheckAutoRollSettings(Step):
+ MESSAGE = "Checking settings file."
+
+ def RunStep(self):
+ settings_file = os.path.realpath(self.Config(SETTINGS_LOCATION))
+ if os.path.exists(settings_file):
+ settings_dict = json.loads(FileToText(settings_file))
+ if settings_dict.get("enable_auto_roll") is False:
+ self.Die("Push to trunk disabled by auto-roll settings file: %s"
+ % settings_file)
+
+
+class CheckTreeStatus(Step):
+ MESSAGE = "Checking v8 tree status message."
+
+ def RunStep(self):
+ status_url = "https://v8-status.appspot.com/current?format=json"
+ status_json = self.ReadURL(status_url, wait_plan=[5, 20, 300, 300])
+ 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)
+
+
class FetchLatestRevision(Step):
MESSAGE = "Fetching latest V8 revision."
@@ -115,6 +143,8 @@ def RunAutoRoll(config,
side_effect_handler=DEFAULT_SIDE_EFFECT_HANDLER):
step_classes = [
Preparation,
+ CheckAutoRollSettings,
+ CheckTreeStatus,
FetchLatestRevision,
CheckLastPush,
FetchLKGR,
« no previous file with comments | « no previous file | tools/push-to-trunk/test_scripts.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698