Skip to content

Commit

Permalink
bug 1302164: add contribute.json (#237). r=bhearsum
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzzmz authored and bhearsum committed Feb 6, 2017
1 parent f01b128 commit df8c0af
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
7 changes: 7 additions & 0 deletions auslib/test/web/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from tempfile import mkstemp
import unittest
from xml.dom import minidom
import json

from auslib.blobs.base import createBlob
from auslib.global_state import dbo
Expand Down Expand Up @@ -738,6 +739,12 @@ def testRobotsExists(self):
self.assertEqual(ret.mimetype, 'text/plain')
self.assertTrue('User-agent' in ret.data)

def testContributeJsonExists(self):
ret = self.client.get('/contribute.json')
self.assertEqual(ret.status_code, 200)
self.assertTrue(json.loads(ret.data))
self.assertEqual(ret.mimetype, 'application/json')

def testBadAvastURLsFromBug1125231(self):
# Some versions of Avast have a bug in them that prepends "x86 "
# to the locale. We need to make sure we handle this case correctly
Expand Down
5 changes: 5 additions & 0 deletions auslib/web/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ def robots():
return send_from_directory(app.static_folder, "robots.txt")


@app.route('/contribute.json')
def contributejson():
return send_from_directory(app.static_folder, "contribute.json")


@app.route('/update/1/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/update.xml')
@app.route('/update/2/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/update.xml')
@app.route('/update/3/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml')
Expand Down
22 changes: 22 additions & 0 deletions auslib/web/static/contribute.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "Balrog",
"description": "Next generation update service for Mozilla products.",
"repository": {
"url": "https://github.com/mozilla/balrog",
"license": "MPL-2.0"
},
"participate": {
"home": "https://mozilla-balrog.readthedocs.io/en/latest/contribute.html",
"docs": "https://mozilla-balrog.readthedocs.io/en/latest/",
"irc": "irc://irc.mozilla.org/#balrog"
},
"bugs": {
"list": "https://bugzilla.mozilla.org/buglist.cgi?list_id=13406852&emailtype1=exact&status_whiteboard_type=allwordssubstr&emailassigned_to1=1&status_whiteboard=%5Bready%5D&email1=nobody%40mozilla.org&resolution=---&query_format=advanced&component=Balrog%3A%20Backend&component=Balrog%3A%20Frontend"
},
"urls": {
"prod": "https://aus5.mozilla.org/"
},
"keywords": [
"python"
]
}

0 comments on commit df8c0af

Please sign in to comment.