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

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

Issue 1063073003: Retrieval of information by release channel (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Removed empty lines 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 | « no previous file | 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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 pass 374 pass
375 375
376 # Add the chromium ranges to the v8 candidates and master releases. 376 # Add the chromium ranges to the v8 candidates and master releases.
377 all_ranges = BuildRevisionRanges(cr_releases) 377 all_ranges = BuildRevisionRanges(cr_releases)
378 378
379 for hsh, ranges in all_ranges.iteritems(): 379 for hsh, ranges in all_ranges.iteritems():
380 releases_dict.get(hsh, {})["chromium_revision"] = ranges 380 releases_dict.get(hsh, {})["chromium_revision"] = ranges
381 381
382 382
383 # TODO(machenbach): Unify common code with method above. 383 # TODO(machenbach): Unify common code with method above.
384 class RietrieveChromiumBranches(Step): 384 class RetrieveChromiumBranches(Step):
385 MESSAGE = "Retrieve Chromium branch information." 385 MESSAGE = "Retrieve Chromium branch information."
386 386
387 def RunStep(self): 387 def RunStep(self):
388 cwd = self._options.chromium 388 cwd = self._options.chromium
389 389
390 # All v8 revisions we are interested in. 390 # All v8 revisions we are interested in.
391 releases_dict = dict((r["revision_git"], r) for r in self["releases"]) 391 releases_dict = dict((r["revision_git"], r) for r in self["releases"])
392 392
393 # Filter out irrelevant branches. 393 # Filter out irrelevant branches.
394 branches = filter(lambda r: re.match(r"branch-heads/\d+", r), 394 branches = filter(lambda r: re.match(r"branch-heads/\d+", r),
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 # Allow Ctrl-C interrupt. 426 # Allow Ctrl-C interrupt.
427 except (KeyboardInterrupt, SystemExit): # pragma: no cover 427 except (KeyboardInterrupt, SystemExit): # pragma: no cover
428 pass 428 pass
429 429
430 # Add the chromium branches to the v8 candidate releases. 430 # Add the chromium branches to the v8 candidate releases.
431 all_ranges = BuildRevisionRanges(cr_branches) 431 all_ranges = BuildRevisionRanges(cr_branches)
432 for revision, ranges in all_ranges.iteritems(): 432 for revision, ranges in all_ranges.iteritems():
433 releases_dict.get(revision, {})["chromium_branch"] = ranges 433 releases_dict.get(revision, {})["chromium_branch"] = ranges
434 434
435 435
436 class RetrieveInformationOnChromeReleases(Step):
437 MESSAGE = 'Retrieves relevant information on the latest Chrome releases'
438
439 def Run(self):
440
441 params = None
442 result_raw = self.ReadURL(
443 "http://omahaproxy.appspot.com/all.json",
444 params,
445 wait_plan=[5, 20]
446 )
447 recent_releases = json.loads(result_raw)
448
449 canaries = []
450
451 for current_os in recent_releases:
452 for current_version in current_os["versions"]:
453 current_candidate = {
454 "chrome_version": current_version["version"],
455 "os": current_version["os"],
456 "release_date": current_version["current_reldate"],
457 "v8_version": current_version["v8_version"],
458 }
459
460 if current_version["channel"] == "canary":
461 canaries.append(current_candidate)
462
463 chrome_releases = {"canaries": canaries}
464 self["chrome_releases"] = chrome_releases
465
466
436 class CleanUp(Step): 467 class CleanUp(Step):
437 MESSAGE = "Clean up." 468 MESSAGE = "Clean up."
438 469
439 def RunStep(self): 470 def RunStep(self):
440 self.CommonCleanup() 471 self.CommonCleanup()
441 472
442 473
443 class WriteOutput(Step): 474 class WriteOutput(Step):
444 MESSAGE = "Print output." 475 MESSAGE = "Print output."
445 476
446 def Run(self): 477 def Run(self):
478
479 output = {
480 "releases": self["releases"],
481 "chrome_releases": self["chrome_releases"],
482 }
483
447 if self._options.csv: 484 if self._options.csv:
448 with open(self._options.csv, "w") as f: 485 with open(self._options.csv, "w") as f:
449 writer = csv.DictWriter(f, 486 writer = csv.DictWriter(f,
450 ["version", "branch", "revision", 487 ["version", "branch", "revision",
451 "chromium_revision", "patches_merged"], 488 "chromium_revision", "patches_merged"],
452 restval="", 489 restval="",
453 extrasaction="ignore") 490 extrasaction="ignore")
454 for release in self["releases"]: 491 for release in self["releases"]:
455 writer.writerow(release) 492 writer.writerow(release)
456 if self._options.json: 493 if self._options.json:
457 with open(self._options.json, "w") as f: 494 with open(self._options.json, "w") as f:
458 f.write(json.dumps(self["releases"])) 495 f.write(json.dumps(output))
459 if not self._options.csv and not self._options.json: 496 if not self._options.csv and not self._options.json:
460 print self["releases"] # pragma: no cover 497 print output # pragma: no cover
461 498
462 499
463 class Releases(ScriptsBase): 500 class Releases(ScriptsBase):
464 def _PrepareOptions(self, parser): 501 def _PrepareOptions(self, parser):
465 parser.add_argument("-b", "--branch", default="recent", 502 parser.add_argument("-b", "--branch", default="recent",
466 help=("The branch to analyze. If 'all' is specified, " 503 help=("The branch to analyze. If 'all' is specified, "
467 "analyze all branches. If 'recent' (default) " 504 "analyze all branches. If 'recent' (default) "
468 "is specified, track beta, stable and " 505 "is specified, track beta, stable and "
469 "candidates.")) 506 "candidates."))
470 parser.add_argument("-c", "--chromium", 507 parser.add_argument("-c", "--chromium",
471 help=("The path to your Chromium src/ " 508 help=("The path to your Chromium src/ "
472 "directory to automate the V8 roll.")) 509 "directory to automate the V8 roll."))
473 parser.add_argument("--csv", help="Path to a CSV file for export.") 510 parser.add_argument("--csv", help="Path to a CSV file for export.")
474 parser.add_argument("-m", "--max-releases", type=int, default=0, 511 parser.add_argument("-m", "--max-releases", type=int, default=0,
475 help="The maximum number of releases to track.") 512 help="The maximum number of releases to track.")
476 parser.add_argument("--json", help="Path to a JSON file for export.") 513 parser.add_argument("--json", help="Path to a JSON file for export.")
477 514
478 def _ProcessOptions(self, options): # pragma: no cover 515 def _ProcessOptions(self, options): # pragma: no cover
479 options.force_readline_defaults = True 516 options.force_readline_defaults = True
480 return True 517 return True
481 518
482 def _Config(self): 519 def _Config(self):
483 return { 520 return {
484 "BRANCHNAME": "retrieve-v8-releases", 521 "BRANCHNAME": "retrieve-v8-releases",
485 "PERSISTFILE_BASENAME": "/tmp/v8-releases-tempfile", 522 "PERSISTFILE_BASENAME": "/tmp/v8-releases-tempfile",
486 } 523 }
487 524
488 def _Steps(self): 525 def _Steps(self):
526
489 return [ 527 return [
490 Preparation, 528 Preparation,
491 RetrieveV8Releases, 529 RetrieveV8Releases,
492 UpdateChromiumCheckout, 530 UpdateChromiumCheckout,
493 RetrieveChromiumV8Releases, 531 RetrieveChromiumV8Releases,
494 RietrieveChromiumBranches, 532 RetrieveChromiumBranches,
533 RetrieveInformationOnChromeReleases,
495 CleanUp, 534 CleanUp,
496 WriteOutput, 535 WriteOutput,
497 ] 536 ]
498 537
499 538
500 if __name__ == "__main__": # pragma: no cover 539 if __name__ == "__main__": # pragma: no cover
501 sys.exit(Releases().Run()) 540 sys.exit(Releases().Run())
OLDNEW
« no previous file with comments | « no previous file | tools/release/test_scripts.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698