Commit 7044f8d1 authored by kalman@chromium.org's avatar kalman@chromium.org

Docserver: Use the testing URL for the new omahaproxy history API.

R=rsesek@chromium.org, rockot@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/314133004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275451 0039d316-1c4b-4281-b951-d872f2087c98
parent 776e71cd
application: chrome-apps-doc application: chrome-apps-doc
version: 3-25-1 version: 3-26-0
runtime: python27 runtime: python27
api_version: 1 api_version: 1
threadsafe: false threadsafe: false
......
...@@ -166,7 +166,7 @@ class BranchUtility(object): ...@@ -166,7 +166,7 @@ class BranchUtility(object):
numbers = {} numbers = {}
for entry in version_json: for entry in version_json:
if entry['os'] not in ['win', 'linux', 'mac', 'cros']: if entry['os'] not in ('win', 'linux', 'mac', 'cros'):
continue continue
for version in entry['versions']: for version in entry['versions']:
if version['channel'] != channel_name: if version['channel'] != channel_name:
...@@ -198,9 +198,8 @@ class BranchUtility(object): ...@@ -198,9 +198,8 @@ class BranchUtility(object):
return branch return branch
version_json = json.loads(self._history_result.Get().content) version_json = json.loads(self._history_result.Get().content)
for entry in version_json['events']: for entry in version_json:
# Here, entry['title'] looks like: '<title> - <version>.##.<branch>.##' version_title = entry['version'].split('.')
version_title = entry['title'].split(' - ')[1].split('.')
if version_title[0] == str(version): if version_title[0] == str(version):
self._branch_object_store.Set(str(version), version_title[2]) self._branch_object_store.Set(str(version), version_title[2])
return version_title[2] return version_title[2]
...@@ -227,8 +226,8 @@ class BranchUtility(object): ...@@ -227,8 +226,8 @@ class BranchUtility(object):
version_json = json.loads(self._history_result.Get().content) version_json = json.loads(self._history_result.Get().content)
latest_version = 0 latest_version = 0
for entry in version_json['events']: for entry in version_json:
version_title = entry['title'].split(' - ')[1].split('.') version_title = entry['version'].split('.')
version = int(version_title[0]) version = int(version_title[0])
if version > latest_version: if version > latest_version:
latest_version = version latest_version = version
......
...@@ -121,7 +121,7 @@ class BranchUtilityTest(unittest.TestCase): ...@@ -121,7 +121,7 @@ class BranchUtilityTest(unittest.TestCase):
self.assertEquals(stable_info, self._branch_util.GetChannelInfo('stable')) self.assertEquals(stable_info, self._branch_util.GetChannelInfo('stable'))
def testGetLatestVersionNumber(self): def testGetLatestVersionNumber(self):
self.assertEquals(28, self._branch_util.GetLatestVersionNumber()) self.assertEquals(37, self._branch_util.GetLatestVersionNumber())
def testGetBranchForVersion(self): def testGetBranchForVersion(self):
self.assertEquals('1500', self.assertEquals('1500',
......
...@@ -2,4 +2,4 @@ cron: ...@@ -2,4 +2,4 @@ cron:
- description: Repopulates all cached data. - description: Repopulates all cached data.
url: /_cron url: /_cron
schedule: every 5 minutes schedule: every 5 minutes
target: 3-25-1 target: 3-26-0
...@@ -9,8 +9,8 @@ branch_utility/first.json ...@@ -9,8 +9,8 @@ branch_utility/first.json
branch_utility/second.json branch_utility/second.json
Downloaded from: Downloaded on 5th June 2014 from:
http://omahaproxy.appspot.com/history?channel=dev&os=win&json=1 http://10.omahaproxy-hrd.appspot.com/history.json?channel=dev&os=win&json=1
- Contains a history of revision names for the dev channel on Windows. - Contains a history of revision names for the dev channel on Windows.
- File has been formatted for readability. To view a readable version of the - File has been formatted for readability. To view a readable version of the
data at the above URL, remove '&json=1'. data at the above URL, remove '&json=1'.
......
...@@ -7,7 +7,8 @@ GITHUB_BASE = 'https://github.com/GoogleChrome/chrome-app-samples/tree/master' ...@@ -7,7 +7,8 @@ GITHUB_BASE = 'https://github.com/GoogleChrome/chrome-app-samples/tree/master'
RAW_GITHUB_BASE = ('https://github.com/GoogleChrome/chrome-app-samples/raw/' RAW_GITHUB_BASE = ('https://github.com/GoogleChrome/chrome-app-samples/raw/'
'master') 'master')
OMAHA_PROXY_URL = 'http://omahaproxy.appspot.com/json' OMAHA_PROXY_URL = 'http://omahaproxy.appspot.com/json'
OMAHA_HISTORY = 'http://omahaproxy.appspot.com/history' # TODO(kalman): Change this to http://omahaproxy.appspot.com/history.json
OMAHA_HISTORY = 'http://10.omahaproxy-hrd.appspot.com/history.json'
OMAHA_DEV_HISTORY = '%s?channel=dev&os=win&json=1' % OMAHA_HISTORY OMAHA_DEV_HISTORY = '%s?channel=dev&os=win&json=1' % OMAHA_HISTORY
SVN_URL = 'http://src.chromium.org/chrome' SVN_URL = 'http://src.chromium.org/chrome'
VIEWVC_URL = 'http://src.chromium.org/viewvc/chrome' VIEWVC_URL = 'http://src.chromium.org/viewvc/chrome'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment