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

Side by Side Diff: tools/bisect-builds.py

Issue 521993002: bisect-builds.py: Fix broken chromium changelog URL to new URL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | no next file » | 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 (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium 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 """Snapshot Build Bisect Tool 6 """Snapshot Build Bisect Tool
7 7
8 This script bisects a snapshot archive using binary search. It starts at 8 This script bisects a snapshot archive using binary search. It starts at
9 a bad revision (it will try to guess HEAD) and asks for a last known-good 9 a bad revision (it will try to guess HEAD) and asks for a last known-good
10 revision. It will then binary search across this revision range by downloading, 10 revision. It will then binary search across this revision range by downloading,
(...skipping 12 matching lines...) Expand all
23 # GS bucket name. 23 # GS bucket name.
24 GS_BUCKET_NAME = 'chrome-unsigned/desktop-W15K3Y' 24 GS_BUCKET_NAME = 'chrome-unsigned/desktop-W15K3Y'
25 25
26 # Base URL for downloading official builds. 26 # Base URL for downloading official builds.
27 GOOGLE_APIS_URL = 'commondatastorage.googleapis.com' 27 GOOGLE_APIS_URL = 'commondatastorage.googleapis.com'
28 28
29 # The base URL for official builds. 29 # The base URL for official builds.
30 OFFICIAL_BASE_URL = 'http://%s/%s' % (GOOGLE_APIS_URL, GS_BUCKET_NAME) 30 OFFICIAL_BASE_URL = 'http://%s/%s' % (GOOGLE_APIS_URL, GS_BUCKET_NAME)
31 31
32 # URL template for viewing changelogs between revisions. 32 # URL template for viewing changelogs between revisions.
33 CHANGELOG_URL = ('http://build.chromium.org' 33 CHANGELOG_URL = ('https://chromium.googlesource.com/chromium/src/+log/%s..%s')
34 '/f/chromium/perf/dashboard/ui/changelog.html' 34
35 '?url=/trunk/src&range=%d%%3A%d') 35 # URL to convert SVN revision to git hash.
36 CRREV_URL = ('http://crrev.com/')
37
38 # Search pattern to match git hash.
39 GITHASH_SEARCH_PATTERN = (r'<title>(\w+)\s')
36 40
37 # URL template for viewing changelogs between official versions. 41 # URL template for viewing changelogs between official versions.
38 OFFICIAL_CHANGELOG_URL = ('https://chromium.googlesource.com/chromium/' 42 OFFICIAL_CHANGELOG_URL = ('https://chromium.googlesource.com/chromium/'
39 'src/+log/%s..%s?pretty=full') 43 'src/+log/%s..%s?pretty=full')
40 44
41 # DEPS file URL. 45 # DEPS file URL.
42 DEPS_FILE = 'http://src.chromium.org/viewvc/chrome/trunk/src/DEPS?revision=%d' 46 DEPS_FILE = 'http://src.chromium.org/viewvc/chrome/trunk/src/DEPS?revision=%d'
43 47
44 # Blink changelogs URL. 48 # Blink changelogs URL.
45 BLINK_CHANGELOG_URL = ('http://build.chromium.org' 49 BLINK_CHANGELOG_URL = ('http://build.chromium.org'
(...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after
937 try: 941 try:
938 # Location of the latest build revision number 942 # Location of the latest build revision number
939 latest_revision = urllib.urlopen(url).read() 943 latest_revision = urllib.urlopen(url).read()
940 if latest_revision.isdigit(): 944 if latest_revision.isdigit():
941 return int(latest_revision) 945 return int(latest_revision)
942 return context.GetSVNRevisionFromGitHash(latest_revision) 946 return context.GetSVNRevisionFromGitHash(latest_revision)
943 except Exception: 947 except Exception:
944 print 'Could not determine latest revision. This could be bad...' 948 print 'Could not determine latest revision. This could be bad...'
945 return 999999999 949 return 999999999
946 950
951 def PrintChangeLog(min_chromium_rev, max_chromium_rev):
952 """Prints the changelog URL."""
953
954 def _GetGitHashFromSVNRevision(svn_revision):
955 crrev_url = CRREV_URL + str(svn_revision)
956 url = urllib.urlopen(crrev_url)
957 if url.getcode() == 200:
958 result = re.search(GITHASH_SEARCH_PATTERN, url.read())
959 return result.group(1)
960
961 print (' ' + CHANGELOG_URL % (_GetGitHashFromSVNRevision(min_chromium_rev),
962 _GetGitHashFromSVNRevision(max_chromium_rev)))
963
947 964
948 def main(): 965 def main():
949 usage = ('%prog [options] [-- chromium-options]\n' 966 usage = ('%prog [options] [-- chromium-options]\n'
950 'Perform binary search on the snapshot builds to find a minimal\n' 967 'Perform binary search on the snapshot builds to find a minimal\n'
951 'range of revisions where a behavior change happened. The\n' 968 'range of revisions where a behavior change happened. The\n'
952 'behaviors are described as "good" and "bad".\n' 969 'behaviors are described as "good" and "bad".\n'
953 'It is NOT assumed that the behavior of the later revision is\n' 970 'It is NOT assumed that the behavior of the later revision is\n'
954 'the bad one.\n' 971 'the bad one.\n'
955 '\n' 972 '\n'
956 'Revision numbers should use\n' 973 'Revision numbers should use\n'
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
1140 print DONE_MESSAGE_GOOD_MIN % (str(min_chromium_rev), 1157 print DONE_MESSAGE_GOOD_MIN % (str(min_chromium_rev),
1141 str(max_chromium_rev)) 1158 str(max_chromium_rev))
1142 if min_blink_rev != max_blink_rev: 1159 if min_blink_rev != max_blink_rev:
1143 print ('NOTE: There is a Blink roll in the range, ' 1160 print ('NOTE: There is a Blink roll in the range, '
1144 'you might also want to do a Blink bisect.') 1161 'you might also want to do a Blink bisect.')
1145 1162
1146 print 'CHANGELOG URL:' 1163 print 'CHANGELOG URL:'
1147 if opts.official_builds: 1164 if opts.official_builds:
1148 print OFFICIAL_CHANGELOG_URL % (min_chromium_rev, max_chromium_rev) 1165 print OFFICIAL_CHANGELOG_URL % (min_chromium_rev, max_chromium_rev)
1149 else: 1166 else:
1150 print ' ' + CHANGELOG_URL % (min_chromium_rev, max_chromium_rev) 1167 PrintChangeLog(min_chromium_rev, max_chromium_rev)
1151 1168
1152 1169
1153 if __name__ == '__main__': 1170 if __name__ == '__main__':
1154 sys.exit(main()) 1171 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698