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

Side by Side Diff: tools/release/releases.py

Issue 1095483002: Store hashes of current and previous shipped V8 version (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Removed more than 80 character line Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « tools/release/git_recipes.py ('k') | tools/release/test_scripts.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 DEPS_RE = re.compile(r"""^\s*(?:["']v8_revision["']: ["']""" 53 DEPS_RE = re.compile(r"""^\s*(?:["']v8_revision["']: ["']"""
54 """|\(Var\("googlecode_url"\) % "v8"\) \+ "\/trunk@""" 54 """|\(Var\("googlecode_url"\) % "v8"\) \+ "\/trunk@"""
55 """|"http\:\/\/v8\.googlecode\.com\/svn\/trunk@)""" 55 """|"http\:\/\/v8\.googlecode\.com\/svn\/trunk@)"""
56 """([^"']+)["'].*$""", re.M) 56 """([^"']+)["'].*$""", re.M)
57 57
58 # Expression to pick tag and revision for bleeding edge tags. To be used with 58 # Expression to pick tag and revision for bleeding edge tags. To be used with
59 # output of 'svn log'. 59 # output of 'svn log'.
60 BLEEDING_EDGE_TAGS_RE = re.compile( 60 BLEEDING_EDGE_TAGS_RE = re.compile(
61 r"A \/tags\/([^\s]+) \(from \/branches\/bleeding_edge\:(\d+)\)") 61 r"A \/tags\/([^\s]+) \(from \/branches\/bleeding_edge\:(\d+)\)")
62 62
63 OMAHA_PROXY_URL = "http://omahaproxy.appspot.com/"
63 64
64 def SortBranches(branches): 65 def SortBranches(branches):
65 """Sort branches with version number names.""" 66 """Sort branches with version number names."""
66 return sorted(branches, key=SortingKey, reverse=True) 67 return sorted(branches, key=SortingKey, reverse=True)
67 68
68 69
69 def FilterDuplicatesAndReverse(cr_releases): 70 def FilterDuplicatesAndReverse(cr_releases):
70 """Returns the chromium releases in reverse order filtered by v8 revision 71 """Returns the chromium releases in reverse order filtered by v8 revision
71 duplicates. 72 duplicates.
72 73
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 releases_dict.get(revision, {})["chromium_branch"] = ranges 434 releases_dict.get(revision, {})["chromium_branch"] = ranges
434 435
435 436
436 class RetrieveInformationOnChromeReleases(Step): 437 class RetrieveInformationOnChromeReleases(Step):
437 MESSAGE = 'Retrieves relevant information on the latest Chrome releases' 438 MESSAGE = 'Retrieves relevant information on the latest Chrome releases'
438 439
439 def Run(self): 440 def Run(self):
440 441
441 params = None 442 params = None
442 result_raw = self.ReadURL( 443 result_raw = self.ReadURL(
443 "http://omahaproxy.appspot.com/all.json", 444 OMAHA_PROXY_URL + "all.json",
444 params, 445 params,
445 wait_plan=[5, 20] 446 wait_plan=[5, 20]
446 ) 447 )
447 recent_releases = json.loads(result_raw) 448 recent_releases = json.loads(result_raw)
448 449
449 canaries = [] 450 canaries = []
450 451
451 for current_os in recent_releases: 452 for current_os in recent_releases:
452 for current_version in current_os["versions"]: 453 for current_version in current_os["versions"]:
453 current_candidate = { 454 if current_version["channel"] != "canary":
454 "chrome_version": current_version["version"], 455 continue
455 "os": current_version["os"],
456 "release_date": current_version["current_reldate"],
457 "v8_version": current_version["v8_version"],
458 }
459 456
460 if current_version["channel"] == "canary": 457 current_candidate = self._CreateCandidate(current_version)
461 canaries.append(current_candidate) 458 canaries.append(current_candidate)
462 459
463 chrome_releases = {"canaries": canaries} 460 chrome_releases = {"canaries": canaries}
464 self["chrome_releases"] = chrome_releases 461 self["chrome_releases"] = chrome_releases
465 462
463 def _GetGitHashForV8Version(self, v8_version):
464 if v8_version.split(".")[3]== "0":
465 return self.GitGetHashOfTag(v8_version[:-2])
466
467 return self.GitGetHashOfTag(v8_version)
468
469 def _CreateCandidate(self, current_version):
470 params = None
471 url_to_call = (OMAHA_PROXY_URL + "v8.json?version="
472 + current_version["previous_version"])
473 result_raw = self.ReadURL(
474 url_to_call,
475 params,
476 wait_plan=[5, 20]
477 )
478 previous_v8_version = json.loads(result_raw)["v8_version"]
479 v8_previous_version_hash = self._GetGitHashForV8Version(previous_v8_version)
480
481 current_v8_version = current_version["v8_version"]
482 v8_version_hash = self._GetGitHashForV8Version(current_v8_version)
483
484 current_candidate = {
485 "chrome_version": current_version["version"],
486 "os": current_version["os"],
487 "release_date": current_version["current_reldate"],
488 "v8_version": current_v8_version,
489 "v8_version_hash": v8_version_hash,
490 "v8_previous_version": previous_v8_version,
491 "v8_previous_version_hash": v8_previous_version_hash,
492 }
493 return current_candidate
494
466 495
467 class CleanUp(Step): 496 class CleanUp(Step):
468 MESSAGE = "Clean up." 497 MESSAGE = "Clean up."
469 498
470 def RunStep(self): 499 def RunStep(self):
471 self.CommonCleanup() 500 self.CommonCleanup()
472 501
473 502
474 class WriteOutput(Step): 503 class WriteOutput(Step):
475 MESSAGE = "Print output." 504 MESSAGE = "Print output."
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 RetrieveChromiumV8Releases, 560 RetrieveChromiumV8Releases,
532 RetrieveChromiumBranches, 561 RetrieveChromiumBranches,
533 RetrieveInformationOnChromeReleases, 562 RetrieveInformationOnChromeReleases,
534 CleanUp, 563 CleanUp,
535 WriteOutput, 564 WriteOutput,
536 ] 565 ]
537 566
538 567
539 if __name__ == "__main__": # pragma: no cover 568 if __name__ == "__main__": # pragma: no cover
540 sys.exit(Releases().Run()) 569 sys.exit(Releases().Run())
OLDNEW
« no previous file with comments | « tools/release/git_recipes.py ('k') | tools/release/test_scripts.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698