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

Unified Diff: dashboard/dashboard/graph_json.py

Issue 2620713002: Factored stdio parsing out of graph_json. (Closed)
Patch Set: fix more typos in unit tests Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: dashboard/dashboard/graph_json.py
diff --git a/dashboard/dashboard/graph_json.py b/dashboard/dashboard/graph_json.py
index 68d01426048e166bc7d500a2b25f98b01046d0b6..5295322fa846ec900fad804d43a6b47776ed5247 100644
--- a/dashboard/dashboard/graph_json.py
+++ b/dashboard/dashboard/graph_json.py
@@ -13,7 +13,6 @@ import datetime
import json
import logging
import re
-import urllib
from google.appengine.ext import ndb
@@ -276,25 +275,16 @@ def _IsMarkdownLink(value):
def _GetUpdatedBuildbotLinks(old_stdio_link):
- m = re.match(r'\[(.+?)\]\((.+?)\)', old_stdio_link)
- if not m:
- # This wasn't the markdown-style link we were expecting.
- return None, None
- title, link = m.groups()
- m = re.match(
- r'(https{0,1}://.*/([^\/]*)/builders/)'
- r'([^\/]+)/builds/(\d+)/steps/([^\/]+)', link)
- if not m:
- # This wasn't a buildbot formatted link.
- return None, None
- base_url, master, bot, buildnumber, step = m.groups()
- logdog_bot = re.sub(r'[ \(\)]', '_', urllib.unquote(bot))
- s_param = urllib.quote('chrome/bb/%s/%s/%s/+/recipes/steps/%s/0/stdout' % (
- master, logdog_bot, buildnumber, step), safe='')
- logdog_link = 'https://luci-logdog.appspot.com/v/?s=%s' % s_param
- logdog_markdown = '[%s](%s)' % (title, logdog_link)
- buildbot_status_page = '%s%s/builds/%s' % (base_url, bot, buildnumber)
- buildbot_status_markdown = '[Buildbot status page](%s)' % buildbot_status_page
+ # Links take a markdown format, [title](url)
+ logdog_markdown = None
+ logdog_link = utils.GetLogdogLogUriFromStdioLink(old_stdio_link)
+ if logdog_link:
+ logdog_markdown = '[Buildbot stdio](%s)' % logdog_link
+ buildbot_status_markdown = None
+ buildbot_link = utils.GetBuildbotStatusPageUriFromStdioLink(
+ old_stdio_link)
+ if buildbot_link:
+ buildbot_status_markdown = '[Buildbot status page](%s)' % buildbot_link
return logdog_markdown, buildbot_status_markdown
« dashboard/dashboard/common/utils.py ('K') | « dashboard/dashboard/common/utils_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698