Skip to content

Commit

Permalink
Use the releasenotes bot in the service response.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rémy HUBSCHER committed Aug 4, 2017
1 parent c60f597 commit 6dbf09b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ CHANGELOG
0.1.0 (unreleased)
------------------

- Add the /v1/ info page
- Add the /v1/ info page (#10)
- Add the release status checks
- Add the releasenotes bot
- Add the releasenotes bot (#16)
13 changes: 10 additions & 3 deletions pollbot/views/release.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import asyncio
from aiohttp import web
from pollbot.tasks.releasenotes import release_notes_published


async def info(request):
release_version = request.match_info['version']
product = 'firefox'
version = request.match_info['version']

infos = await asyncio.gather(release_notes_published(product, version))

return web.json_response({
"product": "firefox",
"version": release_version
"product": product,
"version": version,
"releasenotes": infos[0]
})
3 changes: 0 additions & 3 deletions tests/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@


class ReleasePublishedTest(asynctest.TestCase):
url = 'http://test.example.com'
data = {'foo': 'bar'}

async def setUp(self):
self.session = aiohttp.ClientSession(loop=self.loop)
self.addCleanup(self.session.close)
Expand Down
2 changes: 2 additions & 0 deletions tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ async def test_home_body(cli):
}


# This is currently a functional test.
async def test_release_body(cli):
resp = await cli.get("/v1/firefox/54.0")
assert resp.status == 200
assert await resp.json() == {
"product": "firefox",
"version": "54.0",
"releasenotes": True
}

0 comments on commit 6dbf09b

Please sign in to comment.