-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rework tasks to give more context about the check that was made. #74
Conversation
pollbot/tasks/archives.py
Outdated
status = resp.status != 404 | ||
return { | ||
"status": status and "exists" or "missing", | ||
"message": "Checking archive.mozilla.org release publication", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exists
A repository with that release version exists in https://archive.mozilla.org/pub/firefox/releases/55.0/
Missing
No repository found for that version number: https://archive.mozilla.org/pub/firefox/releases/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the Exists
message include a version number? (If so, probably "exists at" instead of "exists in".) Also, I don't know if "repository" is the right word -- maybe packages
or archives
.
pollbot/tasks/archives.py
Outdated
|
||
return { | ||
"status": status and "exists" or "missing", | ||
"message": "Checking archive.mozilla.org nightly publication", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exists
The archive exists in nightly latest-date
Missing
The archive doesn't exists for this version in nightly latest-date
Exists
The archive exists in nightly latest-date-l10n
Missing
The archive doesn't exists for this version in nightly latest-date-l10n
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The archive doesn't exist
, or even No archive exists
. I'd also like to add a noun to "nightly latest-date" because I still feel like my understanding of what it is is a little incomplete; maybe "nightly latest-date symlink" or "nightly latest-date mirror"?
pollbot/tasks/archives.py
Outdated
else: | ||
return { | ||
"status": "missing", | ||
"message": "No archive-date checks for {} releases".format(channel.value.lower()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Differentiate archive-date
and archive-date-l10n
here.
pollbot/tasks/bedrock.py
Outdated
status = resp.status != 404 | ||
return { | ||
"status": status and "exists" or "missing", | ||
"message": "Checking bedrock for release note publication", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exists
Release notes were found for that version.
Missing
No release notes were published for that version.
Error
We were unable to contact bedrock. (HTTP 503 - Service unavailable)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about changing that version
to version {version}
?
pollbot/tasks/bedrock.py
Outdated
return True | ||
return { | ||
"status": "missing", | ||
"message": "No security advisories for {} releases".format(channel.value.lower()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing
No security advisories publication for (beta|nightly) releases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, this one tricked me for a second because I thought it meant they hadn't been published "yet", but actually they are not published as part of the process for these channels. It's correct as-is but maybe to make it stronger, how about Publication of security advisories does not happen for ...
or Security advisories are never published for ...
?
pollbot/tasks/bedrock.py
Outdated
status = build_version_id(last_release) >= build_version_id(version) | ||
return { | ||
"status": status and "exists" or "missing", | ||
"message": "Checking bedrock for security advisories publication", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exists
Securities advisories for release were published until version 55.0
Missing
Securities advisories for release were published until version 55.0
Error
We were unable to contact bedrock. (HTTP 503 - Service unavailable)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Security advisories
. Also I'd probably change until
into up to
or through
.
pollbot/tasks/bedrock.py
Outdated
status = build_version_id(last_release) >= build_version_id(version) | ||
return { | ||
"status": status and "exists" or "missing", | ||
"message": "Checking bedrock for download links publication", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exists
The download links for release have been published with version 55.0
Missing
The download links for release have been published with version 55.0
Error
We were unable to contact bedrock (HTTP 408 - Timeout)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Published with
? I feel like this should be published for
, but maybe I don't understand what the actual step of the release process is.
pollbot/tasks/product_details.py
Outdated
status = '{}-{}'.format(product, version) in body['releases'] | ||
return { | ||
"status": status and "exists" or "missing", | ||
"message": "Checking product-details for the release version", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exists
We found product-details information about that version : {JSON STRING}
Missing
We did not found product-details information about that version
Error
We were unable to contact product-details (HTTP 503 - Service unavailable)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure "that version" is correct but you might want to change it to version {version}
. Also, no space before colon in English.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reviewed the messages in your comments, hope that's what I was supposed to do!
API_CHANGELOG.rst
Outdated
@@ -8,6 +8,9 @@ API Changelog | |||
- Add archive-date and archive-date-l10n checks for nightly | |||
- Add the ongoing-versions endpoint | |||
- Add the list of checks for a given version endpoint. | |||
- Add archive-date and archive-date-l10n nightly endpoints. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is covered (above).
pollbot/tasks/archives.py
Outdated
status = resp.status != 404 | ||
return { | ||
"status": status and "exists" or "missing", | ||
"message": "Checking archive.mozilla.org release publication", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the Exists
message include a version number? (If so, probably "exists at" instead of "exists in".) Also, I don't know if "repository" is the right word -- maybe packages
or archives
.
pollbot/tasks/archives.py
Outdated
|
||
return { | ||
"status": status and "exists" or "missing", | ||
"message": "Checking archive.mozilla.org nightly publication", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The archive doesn't exist
, or even No archive exists
. I'd also like to add a noun to "nightly latest-date" because I still feel like my understanding of what it is is a little incomplete; maybe "nightly latest-date symlink" or "nightly latest-date mirror"?
pollbot/tasks/bedrock.py
Outdated
status = resp.status != 404 | ||
return { | ||
"status": status and "exists" or "missing", | ||
"message": "Checking bedrock for release note publication", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about changing that version
to version {version}
?
pollbot/tasks/bedrock.py
Outdated
return True | ||
return { | ||
"status": "missing", | ||
"message": "No security advisories for {} releases".format(channel.value.lower()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, this one tricked me for a second because I thought it meant they hadn't been published "yet", but actually they are not published as part of the process for these channels. It's correct as-is but maybe to make it stronger, how about Publication of security advisories does not happen for ...
or Security advisories are never published for ...
?
pollbot/tasks/bedrock.py
Outdated
status = build_version_id(last_release) >= build_version_id(version) | ||
return { | ||
"status": status and "exists" or "missing", | ||
"message": "Checking bedrock for security advisories publication", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Security advisories
. Also I'd probably change until
into up to
or through
.
pollbot/tasks/bedrock.py
Outdated
status = build_version_id(last_release) >= build_version_id(version) | ||
return { | ||
"status": status and "exists" or "missing", | ||
"message": "Checking bedrock for download links publication", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Published with
? I feel like this should be published for
, but maybe I don't understand what the actual step of the release process is.
pollbot/tasks/product_details.py
Outdated
status = '{}-{}'.format(product, version) in body['releases'] | ||
return { | ||
"status": status and "exists" or "missing", | ||
"message": "Checking product-details for the release version", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure "that version" is correct but you might want to change it to version {version}
. Also, no space before colon in English.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we centralize the task response in a function, we should use it everywhere.
Also, I have the feeling that having status
as a boolean is very limiting. Will be hard to cover incomplete
for example. Plus, the status strings are duplicated everywhere.
Maybe it's time to use a sort of Enum for status, and use it as much as possible.
pollbot/tasks/__init__.py
Outdated
"link": link | ||
} | ||
else: | ||
return { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: superflous else
pollbot/tasks/__init__.py
Outdated
"status": "missing", | ||
"message": missing_message, | ||
"link": link | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about this way ?
return {
"status": "exists" if status else "missing",
"message": exists_message if status else missing_message,
"link": link
}
pollbot/tasks/__init__.py
Outdated
@@ -23,3 +23,19 @@ def heartbeat_factory(url): | |||
return True | |||
return False | |||
return heartbeat | |||
|
|||
|
|||
def build_task_response(status, exists_message, missing_message, link): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: exists vs. missing.. shouldn't it be existing ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the name of the statuses.
pollbot/tasks/archives.py
Outdated
status = build_version_id(last_release) >= build_version_id(version) | ||
|
||
exists_message = "The archive exists at {}".format(url) | ||
missing_message = "No archive exists at {}".format(url) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: no archive found ?
pollbot/tasks/archives.py
Outdated
"status": "missing", | ||
"message": "No archive-date checks for {} releases".format(channel.value.lower()), | ||
"link": url | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should use build_task_response()
here, otherwise it's weird
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? The build_task_response
is to return a different message depending on a boolean, in that case it is always missing.
pollbot/tasks/bedrock.py
Outdated
"message": "Security advisories are never published for {} releases".format( | ||
channel.value.lower()), | ||
"link": url | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should use build_task_reponse()
here too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's discuss that it seems that we don't have the same vision of what build_task_response is for
pollbot/tasks/product_details.py
Outdated
"status": status and "exists" or "missing", | ||
"message": "Checking product-details for the nightly version", | ||
"link": 'https://product-details.mozilla.org/1.0/{}_versions.json'.format(product) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
pollbot/tasks/product_details.py
Outdated
|
||
with get_session() as session: | ||
url = 'https://product-details.mozilla.org/1.0/{}.json'.format(product) | ||
async with session.get(url) as resp: | ||
if resp.status != 200: | ||
msg = 'Product Details info not available ({})'.format(resp.status) | ||
msg = 'We were unable to contact product-details (HTTP {})'.format(resp.status) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"To contact" is not properly true here (the server responded something). The original error message was better.
4460297
to
e7c9e6d
Compare
pollbot/tasks/__init__.py
Outdated
"status": Status.EXISTS.value if status else Status.MISSING.value, | ||
"message": exists_message if status else missing_message, | ||
"link": link | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use build_task_response(status, message, link)
above then ?
pollbot/tasks/archives.py
Outdated
"message": "No archive-date checks for {} releases".format(channel.value.lower()), | ||
"link": url | ||
} | ||
return build_task_response( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: superflous else
pollbot/tasks/__init__.py
Outdated
} | ||
|
||
|
||
def build_task_response_from_bool(status, exists_message, missing_message, link): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could keep only one helper if you change the signature to:
def build_task_response(status, link, message, fail_message=None):
if isinstance(status, bool):
message = message if status else fail_message
...
Fixes #53
Fixes #58
Fixes #66