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 # This script retrieves the history of all V8 branches and | 6 # This script retrieves the history of all V8 branches and |
| 7 # their corresponding Chromium revisions. | 7 # their corresponding Chromium revisions. |
| 8 | 8 |
| 9 # Requires a chromium checkout with branch heads: | 9 # Requires a chromium checkout with branch heads: |
| 10 # gclient sync --with_branch_heads | 10 # gclient sync --with_branch_heads |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 433 releases_dict.get(revision, {})["chromium_branch"] = ranges | 433 releases_dict.get(revision, {})["chromium_branch"] = ranges |
| 434 | 434 |
| 435 | 435 |
| 436 class RetrieveInformationOnChromeReleases(Step): | 436 class RetrieveInformationOnChromeReleases(Step): |
| 437 MESSAGE = 'Retrieves relevant information on the latest Chrome releases' | 437 MESSAGE = 'Retrieves relevant information on the latest Chrome releases' |
| 438 | 438 |
| 439 def Run(self): | 439 def Run(self): |
| 440 | 440 |
| 441 params = None | 441 params = None |
| 442 result_raw = self.ReadURL( | 442 result_raw = self.ReadURL( |
| 443 "http://omahaproxy.appspot.com/all.json", | 443 "http://omahaproxy.appspot.com/all.json", |
|
Michael Achenbach
2015/04/16 11:32:50
Maybe make "http://omahaproxy.appspot.com/" a glob
| |
| 444 params, | 444 params, |
| 445 wait_plan=[5, 20] | 445 wait_plan=[5, 20] |
| 446 ) | 446 ) |
| 447 recent_releases = json.loads(result_raw) | 447 recent_releases = json.loads(result_raw) |
| 448 | 448 |
| 449 canaries = [] | 449 canaries = [] |
| 450 | 450 |
| 451 for current_os in recent_releases: | 451 for current_os in recent_releases: |
| 452 for current_version in current_os["versions"]: | 452 for current_version in current_os["versions"]: |
| 453 | |
| 454 if current_version["channel"] != "canary": | |
| 455 continue | |
| 456 | |
| 457 url_to_call = "http://omahaproxy.appspot.com/v8.json?version=" + current _version["previous_version"] | |
|
Michael Achenbach
2015/04/16 11:32:50
nit: 80 chars
| |
| 458 result_raw = self.ReadURL( | |
| 459 url_to_call, | |
| 460 params, | |
| 461 wait_plan=[5, 20] | |
| 462 ) | |
| 463 previous_v8_version_wrapper = json.loads(result_raw) | |
|
Michael Achenbach
2015/04/16 11:32:50
inline local variable previous_v8_version_wrapper
Michael Hablich
2015/04/16 12:01:02
What do you mean by that?
Michael Achenbach
2015/04/16 12:17:56
I mean:
previous_v8_version = json.loads(result_ra
| |
| 464 previous_v8_version = previous_v8_version_wrapper["v8_version"] | |
| 465 v8_previous_version_hash = self._GetGitHashForV8Version(previous_v8_vers ion) | |
| 466 | |
| 467 current_V8_version = current_version["v8_version"] | |
|
Michael Achenbach
2015/04/16 11:32:50
nit: current_v8_version
Michael Hablich
2015/04/16 12:01:02
Acknowledged.
| |
| 468 v8_version_hash = self._GetGitHashForV8Version(current_V8_version) | |
| 469 | |
| 453 current_candidate = { | 470 current_candidate = { |
| 454 "chrome_version": current_version["version"], | 471 "chrome_version": current_version["version"], |
| 455 "os": current_version["os"], | 472 "os": current_version["os"], |
| 456 "release_date": current_version["current_reldate"], | 473 "release_date": current_version["current_reldate"], |
| 457 "v8_version": current_version["v8_version"], | 474 "v8_version": current_V8_version, |
| 475 "v8_version_hash": v8_version_hash, | |
| 476 "v8_previous_version": previous_v8_version, | |
| 477 "v8_previous_version_hash": v8_previous_version_hash , | |
| 458 } | 478 } |
| 459 | 479 |
| 460 if current_version["channel"] == "canary": | 480 canaries.append(current_candidate) |
| 461 canaries.append(current_candidate) | |
| 462 | 481 |
| 463 chrome_releases = {"canaries": canaries} | 482 chrome_releases = {"canaries": canaries} |
| 464 self["chrome_releases"] = chrome_releases | 483 self["chrome_releases"] = chrome_releases |
| 465 | 484 |
| 485 def _GetGitHashForV8Version(self, v8_version): | |
| 486 if v8_version.split(".")[3]== "0": | |
| 487 return self.GitGetHashOfTag(v8_version[:-2]) | |
|
Michael Achenbach
2015/04/16 11:32:50
nit: 2 space indentation + space before ==
Michael Hablich
2015/04/16 12:01:02
Acknowledged.
| |
| 488 | |
| 489 return self.GitGetHashOfTag(v8_version) | |
| 490 | |
| 466 | 491 |
| 467 class CleanUp(Step): | 492 class CleanUp(Step): |
| 468 MESSAGE = "Clean up." | 493 MESSAGE = "Clean up." |
| 469 | 494 |
| 470 def RunStep(self): | 495 def RunStep(self): |
| 471 self.CommonCleanup() | 496 self.CommonCleanup() |
| 472 | 497 |
| 473 | 498 |
| 474 class WriteOutput(Step): | 499 class WriteOutput(Step): |
| 475 MESSAGE = "Print output." | 500 MESSAGE = "Print output." |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 531 RetrieveChromiumV8Releases, | 556 RetrieveChromiumV8Releases, |
| 532 RetrieveChromiumBranches, | 557 RetrieveChromiumBranches, |
| 533 RetrieveInformationOnChromeReleases, | 558 RetrieveInformationOnChromeReleases, |
| 534 CleanUp, | 559 CleanUp, |
| 535 WriteOutput, | 560 WriteOutput, |
| 536 ] | 561 ] |
| 537 | 562 |
| 538 | 563 |
| 539 if __name__ == "__main__": # pragma: no cover | 564 if __name__ == "__main__": # pragma: no cover |
| 540 sys.exit(Releases().Run()) | 565 sys.exit(Releases().Run()) |
| OLD | NEW |