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

Side by Side Diff: appengine/test_results/handlers/redirector.py

Issue 498083002: Make flakiness dashboard links to googlesource work post git migration. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@deployable
Patch Set: fix upload 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 | appengine/test_results/main.py » ('j') | appengine/test_results/main.py » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 # TODO(ojan): Get rid of this one crrev.com supports this directly.
6
7 import json
8 import urllib2
9 import webapp2
10
11 # This is just to make testing easier.
12 def load_url(url):
13 return urllib2.urlopen(url).read()
14
ghost stip (do not use) 2014/09/04 22:53:25 nit: 2 spaces
ojan 2014/09/05 21:40:33 2 line breaks? If so, done. Why doesn't the linter
15 def commit_position_to_hash(commit_position):
16 url = 'https://cr-rev.appspot.com/_ah/api/crrev/v1/redirect/%s' % (
17 commit_position)
18 return str(json.loads(load_url(url))['git_sha'])
19
20 def url_from_commit_positions(start_commit_position, end_commit_position):
21 start = commit_position_to_hash(start_commit_position)
22 end = commit_position_to_hash(end_commit_position)
23 return ('https://chromium.googlesource.com/chromium/src/+log'
24 '/%s..%s?pretty=full' % (start, end))
ghost stip (do not use) 2014/09/04 22:53:25 note: you may want pretty=fuller here, depending o
ojan 2014/09/05 21:40:33 Done.
25
26 def get_googlesource_url(handler, *args, **kwargs):
27 return url_from_commit_positions(handler.request.get('start'),
28 handler.request.get('end'))
OLDNEW
« no previous file with comments | « no previous file | appengine/test_results/main.py » ('j') | appengine/test_results/main.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698