|
|
Created:
8 years, 7 months ago by anantha Modified:
8 years, 6 months ago Reviewers:
Robert Sesek CC:
chromium-reviews Visibility:
Public. |
DescriptionModified the bisect script to work for official Chrome builds.
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=139374
Patch Set 1 #Patch Set 2 : #
Total comments: 40
Patch Set 3 : #Patch Set 4 : #Patch Set 5 : #
Total comments: 16
Patch Set 6 : #
Total comments: 12
Patch Set 7 : #
Total comments: 2
Patch Set 8 : #Patch Set 9 : #Messages
Total messages: 9 (0 generated)
https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py File bisect-builds.py (left): https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ol... bisect-builds.py:239: if progress_event and progress_event.isSet(): Why'd you remove this? https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py File bisect-builds.py (right): https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ne... bisect-builds.py:19: OFFICIAL_BASE_URL = 'http://chrome4linux.mtv.corp.google.com/archives/' Do not end this with a / for consistency with the above URL. Also update any format strings that use this. https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ne... bisect-builds.py:19: OFFICIAL_BASE_URL = 'http://chrome4linux.mtv.corp.google.com/archives/' This instead of chrome-master2.mtv/official_builds/? https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ne... bisect-builds.py:64: self.build_type = build_type self.is_official per comment in Main() https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ne... bisect-builds.py:75: if build_type != 'Official': This is getting messy. Beak this down into two top-level if branches: if self.is_official: if self.platform == 'linux' ... else: ... https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ne... bisect-builds.py:187: if self.build_type != 'Official': This logic doesn't belong in this function, as it's not talking to the Google Data Storage. Why is this here if you have GetBuildsList()? https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ne... bisect-builds.py:215: def GetBuildsList(self): naming: GetOfficialBuildsList https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ne... bisect-builds.py:216: """Gets the list of revision numbers between self.good_revision and nit: this isn't returning revision numbers, this is returning Chrome version numbers https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ne... bisect-builds.py:224: build_numbers = re.findall(r'<a href="([0-9][0-9].*)/">', dirindex) This logic is duplicated above. https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ne... bisect-builds.py:232: path = OFFICIAL_BASE_URL + str(build_number) + '/' + \ nit: should be indented 2 https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ne... bisect-builds.py:236: connection = urllib.urlopen(path) nit: over-indented https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ne... bisect-builds.py:292: if context.build_type != 'Official': Don't do this. Just cast rev to a string and format it as such. Here and elsewhere. https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ne... bisect-builds.py:312: pass nit: over-indented https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ne... bisect-builds.py:331: testargs = [context.GetLaunchPath(), '--no-sandbox', Why this? I think this should just be done manually and this logic shouldn't be in the script. https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ne... bisect-builds.py:371: def Bisect(platform, build_type, nit: goes on its own line, and the parameter also needs to be documented below https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ne... bisect-builds.py:570: parser.add_option('-o', '--build_type', type = 'str', This should just be type bool and make the flag --official-chrome or --official-builds https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ne... bisect-builds.py:601: if opts.bad is None: Join this and the previous line with an |and| https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ne... bisect-builds.py:602: print ' Need a bad build range' print >>sys.stderr, 'Needs...' https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ne... bisect-builds.py:675: sys.exit(main()) What's this change?
Robert, Please review the changes. https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py File bisect-builds.py (right): https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ne... bisect-builds.py:19: OFFICIAL_BASE_URL = 'http://chrome4linux.mtv.corp.google.com/archives/' On 2012/05/21 21:39:47, rsesek wrote: > Do not end this with a / for consistency with the above URL. Also update any > format strings that use this. Done. https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ne... bisect-builds.py:19: OFFICIAL_BASE_URL = 'http://chrome4linux.mtv.corp.google.com/archives/' This location has files from chrome-master2.mtv and chromesigning. On 2012/05/21 21:39:47, rsesek wrote: > This instead of chrome-master2.mtv/official_builds/? https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ne... bisect-builds.py:64: self.build_type = build_type On 2012/05/21 21:39:47, rsesek wrote: > self.is_official per comment in Main() Done. https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ne... bisect-builds.py:75: if build_type != 'Official': On 2012/05/21 21:39:47, rsesek wrote: > This is getting messy. Beak this down into two top-level if branches: > > if self.is_official: > if self.platform == 'linux' ... > else: > ... Done. https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ne... bisect-builds.py:187: if self.build_type != 'Official': On 2012/05/21 21:39:47, rsesek wrote: > This logic doesn't belong in this function, as it's not talking to the Google > Data Storage. Why is this here if you have GetBuildsList()? Correct. I forgot to clean this up. https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ne... bisect-builds.py:215: def GetBuildsList(self): On 2012/05/21 21:39:47, rsesek wrote: > naming: GetOfficialBuildsList Done. https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ne... bisect-builds.py:216: """Gets the list of revision numbers between self.good_revision and On 2012/05/21 21:39:47, rsesek wrote: > nit: this isn't returning revision numbers, this is returning Chrome version > numbers Done. https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ne... bisect-builds.py:216: """Gets the list of revision numbers between self.good_revision and On 2012/05/21 21:39:47, rsesek wrote: > nit: this isn't returning revision numbers, this is returning Chrome version > numbers Done. https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ne... bisect-builds.py:224: build_numbers = re.findall(r'<a href="([0-9][0-9].*)/">', dirindex) On 2012/05/21 21:39:47, rsesek wrote: > This logic is duplicated above. Removed from above. https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ne... bisect-builds.py:232: path = OFFICIAL_BASE_URL + str(build_number) + '/' + \ On 2012/05/21 21:39:47, rsesek wrote: > nit: should be indented 2 Done. https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ne... bisect-builds.py:236: connection = urllib.urlopen(path) On 2012/05/21 21:39:47, rsesek wrote: > nit: over-indented Done. https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ne... bisect-builds.py:236: connection = urllib.urlopen(path) On 2012/05/21 21:39:47, rsesek wrote: > nit: over-indented Done. https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ne... bisect-builds.py:292: if context.build_type != 'Official': On 2012/05/21 21:39:47, rsesek wrote: > Don't do this. Just cast rev to a string and format it as such. Here and > elsewhere. Done. https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ne... bisect-builds.py:312: pass On 2012/05/21 21:39:47, rsesek wrote: > nit: over-indented Done. https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ne... bisect-builds.py:331: testargs = [context.GetLaunchPath(), '--no-sandbox', Looks like we need root permission to setup the sandbox for Linux Official Chrome builds. On 2012/05/21 21:39:47, rsesek wrote: > Why this? I think this should just be done manually and this logic shouldn't be > in the script. https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ne... bisect-builds.py:371: def Bisect(platform, build_type, On 2012/05/21 21:39:47, rsesek wrote: > nit: goes on its own line, and the parameter also needs to be documented below Done. https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ne... bisect-builds.py:570: parser.add_option('-o', '--build_type', type = 'str', On 2012/05/21 21:39:47, rsesek wrote: > This should just be type bool and make the flag --official-chrome or > --official-builds Done. https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ne... bisect-builds.py:601: if opts.bad is None: On 2012/05/21 21:39:47, rsesek wrote: > Join this and the previous line with an |and| Done. https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ne... bisect-builds.py:602: print ' Need a bad build range' On 2012/05/21 21:39:47, rsesek wrote: > print >>sys.stderr, 'Needs...' Done. https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ne... bisect-builds.py:675: sys.exit(main()) On 2012/05/21 21:39:47, rsesek wrote: > What's this change? I somehow ended up adding two spaces. So deleted them.
Getting closer! Mostly nits. https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py File bisect-builds.py (right): https://chromiumcodereview.appspot.com/10408045/diff/2001/bisect-builds.py#ne... bisect-builds.py:602: print ' Need a bad build range' On 2012/05/22 22:55:39, anantha wrote: > On 2012/05/21 21:39:47, rsesek wrote: > > print >>sys.stderr, 'Needs...' > > Done. Not done. Also, maybe change the error to "Bisecting official builds requires a bad build number." https://chromiumcodereview.appspot.com/10408045/diff/4002/bisect-builds.py File bisect-builds.py (right): https://chromiumcodereview.appspot.com/10408045/diff/4002/bisect-builds.py#ne... bisect-builds.py:26: 'perf/dashboard/ui/changelog.html?url=/trunk/src&range=%d:%d' nit: blank line after https://chromiumcodereview.appspot.com/10408045/diff/4002/bisect-builds.py#ne... bisect-builds.py:225: i = i+1 nit: spaces around operators https://chromiumcodereview.appspot.com/10408045/diff/4002/bisect-builds.py#ne... bisect-builds.py:227: connection = urllib.urlopen(path) What's this for? To test that the file exists? https://chromiumcodereview.appspot.com/10408045/diff/4002/bisect-builds.py#ne... bisect-builds.py:235: print e.getcode() This won't be a helpful error message. https://chromiumcodereview.appspot.com/10408045/diff/4002/bisect-builds.py#ne... bisect-builds.py:315: if context.platform == 'linux' or context.platform == 'linux64': This can be simplified to just: testargs = [context.GetLaunchPath(), '--user-data-dir=%s' % profile] + args # The sandbox must be run as root on Official Chrome, so bypass it. if context.is_official and (context.platform == 'linux' or context.platform == 'linux64'): testargs.append('--no-sandbox') https://chromiumcodereview.appspot.com/10408045/diff/4002/bisect-builds.py#ne... bisect-builds.py:367: @param good_rev Number/tag of the last known good revision. Need a @param offiical_builds ... before this https://chromiumcodereview.appspot.com/10408045/diff/4002/bisect-builds.py#ne... bisect-builds.py:400: '%s-%s' % (str(rev), context.archive_name)) nit: continuations are indented 4 https://chromiumcodereview.appspot.com/10408045/diff/4002/bisect-builds.py#ne... bisect-builds.py:545: help = 'Specify if it is a chromium or official build.') help = 'Bisect across official Chrome builds (internal only) instead of Chromium archives.'
Please review the changes. https://chromiumcodereview.appspot.com/10408045/diff/4002/bisect-builds.py File bisect-builds.py (right): https://chromiumcodereview.appspot.com/10408045/diff/4002/bisect-builds.py#ne... bisect-builds.py:26: 'perf/dashboard/ui/changelog.html?url=/trunk/src&range=%d:%d' On 2012/05/23 21:24:01, rsesek wrote: > nit: blank line after Done. https://chromiumcodereview.appspot.com/10408045/diff/4002/bisect-builds.py#ne... bisect-builds.py:225: i = i+1 On 2012/05/23 21:24:01, rsesek wrote: > nit: spaces around operators Done. https://chromiumcodereview.appspot.com/10408045/diff/4002/bisect-builds.py#ne... bisect-builds.py:227: connection = urllib.urlopen(path) Correct. On 2012/05/23 21:24:01, rsesek wrote: > What's this for? To test that the file exists? https://chromiumcodereview.appspot.com/10408045/diff/4002/bisect-builds.py#ne... bisect-builds.py:235: print e.getcode() changed it to pass. On 2012/05/23 21:24:01, rsesek wrote: > This won't be a helpful error message. https://chromiumcodereview.appspot.com/10408045/diff/4002/bisect-builds.py#ne... bisect-builds.py:315: if context.platform == 'linux' or context.platform == 'linux64': On 2012/05/23 21:24:01, rsesek wrote: > This can be simplified to just: > > testargs = [context.GetLaunchPath(), '--user-data-dir=%s' % profile] + args > # The sandbox must be run as root on Official Chrome, so bypass it. > if context.is_official and (context.platform == 'linux' or context.platform == > 'linux64'): > testargs.append('--no-sandbox') Done. https://chromiumcodereview.appspot.com/10408045/diff/4002/bisect-builds.py#ne... bisect-builds.py:367: @param good_rev Number/tag of the last known good revision. On 2012/05/23 21:24:01, rsesek wrote: > Need a @param offiical_builds ... before this Done. https://chromiumcodereview.appspot.com/10408045/diff/4002/bisect-builds.py#ne... bisect-builds.py:400: '%s-%s' % (str(rev), context.archive_name)) On 2012/05/23 21:24:01, rsesek wrote: > nit: continuations are indented 4 Done. https://chromiumcodereview.appspot.com/10408045/diff/4002/bisect-builds.py#ne... bisect-builds.py:545: help = 'Specify if it is a chromium or official build.') On 2012/05/23 21:24:01, rsesek wrote: > help = 'Bisect across official Chrome builds (internal only) instead of Chromium > archives.' Done.
Just a few more nits https://chromiumcodereview.appspot.com/10408045/diff/12001/bisect-builds.py File bisect-builds.py (right): https://chromiumcodereview.appspot.com/10408045/diff/12001/bisect-builds.py#n... bisect-builds.py:88: self._listing_platform_dir = 'lucid32bit/' nit: these ifs (and below) are indented 3 spaces, should be 2 https://chromiumcodereview.appspot.com/10408045/diff/12001/bisect-builds.py#n... bisect-builds.py:320: context.platform == 'linux64'): nit: indent one more space (total 4) https://chromiumcodereview.appspot.com/10408045/diff/12001/bisect-builds.py#n... bisect-builds.py:322: nit: remove extra blank line https://chromiumcodereview.appspot.com/10408045/diff/12001/bisect-builds.py#n... bisect-builds.py:542: help = 'Bisect across official' + nit: space before ending ' https://chromiumcodereview.appspot.com/10408045/diff/12001/bisect-builds.py#n... bisect-builds.py:543: 'Chrome builds (internal only) instead of' + same here https://chromiumcodereview.appspot.com/10408045/diff/12001/bisect-builds.py#n... bisect-builds.py:575: print Remove this extra print line, or add >>sys.stderr.
Sorry for nits. Fixed all of them. Please review again. https://chromiumcodereview.appspot.com/10408045/diff/12001/bisect-builds.py File bisect-builds.py (right): https://chromiumcodereview.appspot.com/10408045/diff/12001/bisect-builds.py#n... bisect-builds.py:88: self._listing_platform_dir = 'lucid32bit/' On 2012/05/24 19:12:29, rsesek wrote: > nit: these ifs (and below) are indented 3 spaces, should be 2 Done. https://chromiumcodereview.appspot.com/10408045/diff/12001/bisect-builds.py#n... bisect-builds.py:320: context.platform == 'linux64'): On 2012/05/24 19:12:29, rsesek wrote: > nit: indent one more space (total 4) Done. https://chromiumcodereview.appspot.com/10408045/diff/12001/bisect-builds.py#n... bisect-builds.py:322: On 2012/05/24 19:12:29, rsesek wrote: > nit: remove extra blank line Done. https://chromiumcodereview.appspot.com/10408045/diff/12001/bisect-builds.py#n... bisect-builds.py:542: help = 'Bisect across official' + On 2012/05/24 19:12:29, rsesek wrote: > nit: space before ending ' Done. https://chromiumcodereview.appspot.com/10408045/diff/12001/bisect-builds.py#n... bisect-builds.py:543: 'Chrome builds (internal only) instead of' + On 2012/05/24 19:12:29, rsesek wrote: > same here Done. https://chromiumcodereview.appspot.com/10408045/diff/12001/bisect-builds.py#n... bisect-builds.py:575: print On 2012/05/24 19:12:29, rsesek wrote: > Remove this extra print line, or add >>sys.stderr. Done.
LGTM with two nits, and assuming you've tested bisecting Chromium still works. No need to send out another round once you fix these. This should be really helpful. Looking forward to using it! https://chromiumcodereview.appspot.com/10408045/diff/12003/bisect-builds.py File bisect-builds.py (left): https://chromiumcodereview.appspot.com/10408045/diff/12003/bisect-builds.py#o... bisect-builds.py:153: nit: reinstate this blank line https://chromiumcodereview.appspot.com/10408045/diff/12003/bisect-builds.py File bisect-builds.py (right): https://chromiumcodereview.appspot.com/10408045/diff/12003/bisect-builds.py#n... bisect-builds.py:362: @param official_builds Specify build type(Chromium or Official build). nit: space before (
still LGTM |