Skip to content
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

refactor(robot-server): add time link to /health, refactor system/time links #6517

Merged
merged 3 commits into from
Sep 11, 2020

Conversation

sanni-t
Copy link
Member

@sanni-t sanni-t commented Sep 10, 2020

Overview

PR #6501 uses the time endpoints to check & update robot's system time. In the absence of a time endpoint, which is true for all versions < 3.21, the app would get a 404 for this endpoint. This PR adds a time link to the health endpoint so that the app can check for the presence of time endpoints and only then attempt to use them.

Changelog

  • added time link to /health
  • updated link for /system/time to be more accurate with the expected format
  • raise error to prohibit setting time on dev server
  • updated tests

Risk assessment

Low. Doesn't touch any critical components

@sanni-t sanni-t requested a review from a team September 10, 2020 14:59
@sanni-t sanni-t requested review from a team as code owners September 10, 2020 14:59
@sanni-t sanni-t requested review from mcous and amitlissack and removed request for a team September 10, 2020 14:59
@@ -24,20 +22,10 @@ def _create_response(dt: datetime) \
),
resource_id="time"
),
links=_get_valid_time_links(router)
links={'self': '/system/time'}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to our chat this morning and #6526, should this be a ResourceLink instead?

        links={'self': ResourceLink(href='/system/time'}}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha! Didn't see PR 6526

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From offline conversation, @amitlissack will be updating the time links to the new format as part of #6526

@sanni-t sanni-t merged commit 02a4ad6 into edge Sep 11, 2020
@sanni-t sanni-t deleted the api_update-time-links branch September 25, 2020 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants