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

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/common/net/rietveld.py

Issue 2110833004: Remove "master." when getting master name in rietveld.py. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | third_party/WebKit/Tools/Scripts/webkitpy/common/net/rietveld_unittest.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 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Utility functions to communicate with Rietveld.""" 5 """Utility functions to communicate with Rietveld."""
6 6
7 import collections 7 import collections
8 import json 8 import json
9 import logging 9 import logging
10 import urllib2 10 import urllib2
(...skipping 24 matching lines...) Expand all
35 url = _patchset_url(issue_number, patchset_number) 35 url = _patchset_url(issue_number, patchset_number)
36 else: 36 else:
37 url = _latest_patchset_url(issue_number, web) 37 url = _latest_patchset_url(issue_number, web)
38 patchset_data = _get_json(url, web) 38 patchset_data = _get_json(url, web)
39 except (urllib2.URLError, ValueError): 39 except (urllib2.URLError, ValueError):
40 return [] 40 return []
41 jobs = [] 41 jobs = []
42 for job in patchset_data['try_job_results']: 42 for job in patchset_data['try_job_results']:
43 if job['builder'] not in builder_names: 43 if job['builder'] not in builder_names:
44 continue 44 continue
45 # The master name may be prefixed with "master.", or possibly not;
46 # We want to normalize master name by stripping this prefix.
wkorman 2016/06/29 18:31:52 It seems wacky that it's configured this way. Perh
qyearsley 2016/06/29 20:51:07 Great idea. I hypothesize that when jobs are start
47 master_name = job['master']
48 if master_name.startswith('master.'):
49 master_name = master_name[len('master.'):]
45 jobs.append(TryJob( 50 jobs.append(TryJob(
46 builder_name=job['builder'], 51 builder_name=job['builder'],
47 master_name=job['master'], 52 master_name=master_name,
48 build_number=job['buildnumber'])) 53 build_number=job['buildnumber']))
49 return jobs 54 return jobs
50 55
51 56
52 def _latest_patchset_url(issue_number, web): 57 def _latest_patchset_url(issue_number, web):
53 issue_data = _get_json(_issue_url(issue_number), web) 58 issue_data = _get_json(_issue_url(issue_number), web)
54 latest_patchset_number = issue_data["patchsets"][-1] 59 latest_patchset_number = issue_data["patchsets"][-1]
55 return _patchset_url(issue_number, latest_patchset_number) 60 return _patchset_url(issue_number, latest_patchset_number)
56 61
57 62
(...skipping 15 matching lines...) Expand all
73 _log.error('Invalid JSON: %s' % contents) 78 _log.error('Invalid JSON: %s' % contents)
74 raise 79 raise
75 80
76 81
77 def _issue_url(issue_number): 82 def _issue_url(issue_number):
78 return '%s/%s' % (BASE_CODEREVIEW_URL, issue_number) 83 return '%s/%s' % (BASE_CODEREVIEW_URL, issue_number)
79 84
80 85
81 def _patchset_url(issue_number, patchset_number): 86 def _patchset_url(issue_number, patchset_number):
82 return '%s/%s' % (_issue_url(issue_number), patchset_number) 87 return '%s/%s' % (_issue_url(issue_number), patchset_number)
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Tools/Scripts/webkitpy/common/net/rietveld_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698