Skip to content

Commit

Permalink
Add the devedition endpoint.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rémy HUBSCHER committed Aug 30, 2017
1 parent 4e4ee91 commit 20ad977
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 2 deletions.
20 changes: 20 additions & 0 deletions pollbot/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,26 @@ paths:
tags:
- Status

/{product}/{version}/product-details/devedition-beta-versions-matches:
get:
summary: "checks that the devedition version matches the beta version"
description: >
checks https://product-details.mozilla.org/1.0/firefox_version.json to see
if the devedition version matches the beta version
operationId: "checkProductDetailsDeveditionAndBetaVersionsMatches"
produces:
- "application/json"
parameters:
- $ref: "#/parameters/product"
- $ref: "#/parameters/version"
responses:
"200":
description: "successful operation"
schema:
$ref: "#/definitions/existanceStatus"
tags:
- Status

/{product}/{version}/bedrock/security-advisories:
get:
summary: "check security advisories have been published on mozilla.org"
Expand Down
3 changes: 3 additions & 0 deletions pollbot/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ def get_app(loop=None):
release.bedrock_download_links, name="download-links"))
cors.add(app.router.add_get('/v1/{product}/{version}/product-details',
release.product_details, name="product-details"))
cors.add(app.router.add_get('/v1/{product}/{version}/product-details'
'/devedition-beta-versions-matches',
release.devedition_beta_check, name="devedition-beta-matches"))

# Swagger UI and documentation
setup_swagger(app,
Expand Down
7 changes: 5 additions & 2 deletions pollbot/views/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from ..exceptions import TaskError
from ..tasks.archives import archives, archives_date, archives_date_l10n
from ..tasks.bedrock import release_notes, security_advisories, download_links, get_releases
from ..tasks.product_details import product_details
from ..tasks.product_details import product_details, devedition_and_beta_in_sync
from ..utils import Channel, get_version_channel


Expand Down Expand Up @@ -38,6 +38,7 @@ async def wrapped(request):
bedrock_security_advisories = status_response(security_advisories)
bedrock_download_links = status_response(download_links)
product_details = status_response(product_details)
devedition_beta_check = status_response(devedition_and_beta_in_sync)


async def view_get_releases(request):
Expand All @@ -62,6 +63,7 @@ async def view_get_releases(request):
"security-advisories": "Security advisories",
"download-links": "Download links",
"product-details": "Product details",
"devedition-beta-matches": "Devedition and Beta versions matches",
}


Expand All @@ -73,7 +75,8 @@ async def view_get_releases(request):
"release-notes": [Channel.ESR, Channel.RELEASE, Channel.BETA, Channel.NIGHTLY],
"security-advisories": [Channel.ESR, Channel.RELEASE],
"download-links": [Channel.ESR, Channel.RELEASE, Channel.BETA, Channel.NIGHTLY],
"product-details": [Channel.ESR, Channel.RELEASE, Channel.BETA, Channel.NIGHTLY]
"product-details": [Channel.ESR, Channel.RELEASE, Channel.BETA, Channel.NIGHTLY],
"devedition-beta-matches": [Channel.BETA],
}.items(), key=lambda t: t[0]))


Expand Down
18 changes: 18 additions & 0 deletions tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ async def test_get_checks_for_beta(cli):
"channel": "beta",
"checks": [
{"url": "http://localhost/v1/firefox/56.0b6/archive", "title": "Archive Release"},
{"url": "http://localhost/v1/firefox/56.0b6/product-details"
"/devedition-beta-versions-matches",
"title": "Devedition and Beta versions matches"},
{"url": "http://localhost/v1/firefox/56.0b6/bedrock/download-links",
"title": "Download links"},
{"url": "http://localhost/v1/firefox/56.0b6/product-details",
Expand Down Expand Up @@ -303,6 +306,21 @@ async def test_release_product_details(cli):
})


async def test_beta_product_details_devedition_and_beta_versions_matches(cli):
await check_response(cli,
"/v1/firefox/56.0b7/product-details/devedition-beta-versions-matches",
status=200)


async def test_release_product_details_devedition_and_beta_versions_matches(cli):
url = "/v1/firefox/54.0/product-details/devedition-beta-versions-matches"
await check_response(cli, url, body={
"status": Status.MISSING.value,
"message": "No devedition and beta check for release releases",
"link": "https://product-details.mozilla.org/1.0/firefox_versions.json"
})


async def test_releases_list(cli):
resp = await check_response(cli, "/v1/firefox")
body = await resp.json()
Expand Down

0 comments on commit 20ad977

Please sign in to comment.