Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2014 the V8 project authors. All rights reserved. | 2 # Copyright 2014 the V8 project authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import argparse | 6 import argparse |
| 7 import os | 7 import os |
| 8 import sys | 8 import sys |
| 9 | 9 |
| 10 from common_includes import * | 10 from common_includes import * |
| 11 | 11 |
| 12 ROLL_SUMMARY = ("Summary of changes available at:\n" | 12 ROLL_SUMMARY = ("Summary of changes available at:\n" |
| 13 "https://chromium.googlesource.com/v8/v8/+log/%s..%s") | 13 "https://chromium.googlesource.com/v8/v8/+log/%s..%s") |
| 14 | 14 |
| 15 ISSUE_MSG = ( | 15 ISSUE_MSG = ( |
| 16 """Please follow these instructions for assigning/CC'ing issues: | 16 """Please follow these instructions for assigning/CC'ing issues: |
| 17 https://code.google.com/p/v8-wiki/wiki/TriagingIssues | 17 https://code.google.com/p/v8-wiki/wiki/TriagingIssues |
| 18 | 18 |
| 19 Please close rolling in case of a roll revert: | 19 Please close rolling in case of a roll revert: |
| 20 https://v8-roll.appspot.com/ | 20 https://v8-roll.appspot.com/ |
| 21 This only works with a Google account.""") | 21 This only works with a Google account.""") |
| 22 | 22 |
| 23 class Preparation(Step): | 23 class Preparation(Step): |
| 24 MESSAGE = "Preparation." | 24 MESSAGE = "Preparation." |
| 25 | 25 |
| 26 def RunStep(self): | 26 def RunStep(self): |
| 27 self['json_output']['monitoring_state'] = 'started' | |
|
Michael Hablich
2015/11/24 09:32:54
It seems the state is reported when the script is
Michael Achenbach
2015/11/24 10:08:35
That'd be the meaning behind started. I didn't wan
Michael Hablich
2015/11/24 10:30:55
How about making it more verbose: Set 'monitoring_
Michael Achenbach
2015/11/24 10:44:48
OK. Done. Not sure if that verbosity helps, but it
| |
| 27 # Update v8 remote tracking branches. | 28 # Update v8 remote tracking branches. |
| 28 self.GitFetchOrigin() | 29 self.GitFetchOrigin() |
| 29 self.Git("fetch origin +refs/tags/*:refs/tags/*") | 30 self.Git("fetch origin +refs/tags/*:refs/tags/*") |
| 30 | 31 |
| 31 | 32 |
| 32 class DetectLastRoll(Step): | 33 class DetectLastRoll(Step): |
| 33 MESSAGE = "Detect commit ID of the last Chromium roll." | 34 MESSAGE = "Detect commit ID of the last Chromium roll." |
| 34 | 35 |
| 35 def RunStep(self): | 36 def RunStep(self): |
| 36 self["last_roll"] = self._options.last_roll | 37 self["last_roll"] = self._options.last_roll |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 71 for revision in revisions: | 72 for revision in revisions: |
| 72 version = self.GetVersionTag(revision) | 73 version = self.GetVersionTag(revision) |
| 73 assert version, "Internal error. All recent releases should have a tag" | 74 assert version, "Internal error. All recent releases should have a tag" |
| 74 | 75 |
| 75 if SortingKey(self["last_version"]) < SortingKey(version): | 76 if SortingKey(self["last_version"]) < SortingKey(version): |
| 76 self["roll"] = revision | 77 self["roll"] = revision |
| 77 break | 78 break |
| 78 else: | 79 else: |
| 79 print("There is no newer v8 revision than the one in Chromium (%s)." | 80 print("There is no newer v8 revision than the one in Chromium (%s)." |
| 80 % self["last_roll"]) | 81 % self["last_roll"]) |
| 82 self['json_output']['monitoring_state'] = 'up_to_date' | |
|
Michael Hablich
2015/11/24 09:32:54
Why is this not a 'success'?
Michael Achenbach
2015/11/24 10:08:35
Because I wan't to be able to monitor this case di
Michael Hablich
2015/11/24 10:30:55
See above comment. Interpretation of each exit sta
| |
| 81 return True | 83 return True |
| 82 | 84 |
| 83 | 85 |
| 84 class PrepareRollCandidate(Step): | 86 class PrepareRollCandidate(Step): |
| 85 MESSAGE = "Robustness checks of the roll candidate." | 87 MESSAGE = "Robustness checks of the roll candidate." |
| 86 | 88 |
| 87 def RunStep(self): | 89 def RunStep(self): |
| 88 self["roll_title"] = self.GitLog(n=1, format="%s", | 90 self["roll_title"] = self.GitLog(n=1, format="%s", |
| 89 git_hash=self["roll"]) | 91 git_hash=self["roll"]) |
| 90 | 92 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 154 else: | 156 else: |
| 155 print "Dry run - don't upload." | 157 print "Dry run - don't upload." |
| 156 | 158 |
| 157 self.GitCheckout("master", cwd=cwd) | 159 self.GitCheckout("master", cwd=cwd) |
| 158 self.GitDeleteBranch("work-branch", cwd=cwd) | 160 self.GitDeleteBranch("work-branch", cwd=cwd) |
| 159 | 161 |
| 160 class CleanUp(Step): | 162 class CleanUp(Step): |
| 161 MESSAGE = "Done!" | 163 MESSAGE = "Done!" |
| 162 | 164 |
| 163 def RunStep(self): | 165 def RunStep(self): |
| 166 self['json_output']['monitoring_state'] = 'success' | |
| 164 print("Congratulations, you have successfully rolled %s into " | 167 print("Congratulations, you have successfully rolled %s into " |
| 165 "Chromium." | 168 "Chromium." |
| 166 % self["roll"]) | 169 % self["roll"]) |
| 167 | 170 |
| 168 # Clean up all temporary files. | 171 # Clean up all temporary files. |
| 169 Command("rm", "-f %s*" % self._config["PERSISTFILE_BASENAME"]) | 172 Command("rm", "-f %s*" % self._config["PERSISTFILE_BASENAME"]) |
| 170 | 173 |
| 171 | 174 |
| 172 class AutoRoll(ScriptsBase): | 175 class AutoRoll(ScriptsBase): |
| 173 def _PrepareOptions(self, parser): | 176 def _PrepareOptions(self, parser): |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 211 PrepareRollCandidate, | 214 PrepareRollCandidate, |
| 212 SwitchChromium, | 215 SwitchChromium, |
| 213 UpdateChromiumCheckout, | 216 UpdateChromiumCheckout, |
| 214 UploadCL, | 217 UploadCL, |
| 215 CleanUp, | 218 CleanUp, |
| 216 ] | 219 ] |
| 217 | 220 |
| 218 | 221 |
| 219 if __name__ == "__main__": # pragma: no cover | 222 if __name__ == "__main__": # pragma: no cover |
| 220 sys.exit(AutoRoll().Run()) | 223 sys.exit(AutoRoll().Run()) |
| OLD | NEW |