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

Alter readiness check to use the is_ready API endpoint #278

Merged
merged 3 commits into from
Oct 13, 2023

Conversation

waTeim
Copy link
Contributor

@waTeim waTeim commented Oct 10, 2023

Add support for checking the readiness of an App in a different way. Previously, the UI (splash screen) would try to
connect the main interface of the App. With this change, it instead checks against a new API endpoint. /v1/instances/{sid}/is_ready/. The result will be false until the pod underlying the App passes its readiness probe.

Copy link
Contributor

@pj-linebaugh pj-linebaugh left a comment

Choose a reason for hiding this comment

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

looks good to me.

Copy link
Collaborator

@frostyfan109 frostyfan109 left a comment

Choose a reason for hiding this comment

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

looks good in general. couple notes:

  • fetchOptions should get passed as the second arg of the axios.get, right now it's not being used.
  • Also see that there's already a getAppReady method in the API. You should just replace that one with the new one, and make sure it's still working wherever the existing method was being used. Also make sure to update the getAppReady declaration in the IWorkspacesAPI interface, or you'll get errors. Also, just return a boolean, not an object with an is_ready property. Part of the role of the API is to parse the raw API response into something more easily useable.

@waTeim
Copy link
Contributor Author

waTeim commented Oct 12, 2023

updated to conform to suggestions

@frostyfan109
Copy link
Collaborator

updated to conform to suggestions

Looks good, only gripe is the api call should be try caught by the user, not inside the call itself. Putting it inside the api call can mess up some of the error handling

@waTeim
Copy link
Contributor Author

waTeim commented Oct 12, 2023

Hmm yeah true, but I'll also say that in both of the calling contexts where it is invoked, the code treats an error the same as false and simply blindly retries the call after a pause.

@frostyfan109
Copy link
Collaborator

frostyfan109 commented Oct 12, 2023 via email

@waTeim
Copy link
Contributor Author

waTeim commented Oct 12, 2023

modded the try-catches too.

Copy link
Collaborator

@frostyfan109 frostyfan109 left a comment

Choose a reason for hiding this comment

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

very cool !

@frostyfan109 frostyfan109 merged commit 68c49f6 into develop Oct 13, 2023
2 checks passed
@frostyfan109 frostyfan109 deleted the ready_status branch October 13, 2023 00:48
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