-
Notifications
You must be signed in to change notification settings - Fork 2
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
✨ [#1617] added feature to see if connection is alive in ser… #91
Conversation
7b27e39
to
4365497
Compare
I'll review this tomorrow |
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.
First of all - this implementation is not according to the specification in the ticket:
I'd like to have a 'Check configuration' button in the Service detailview that performs a GET request to the API root URL with the authentication-options configured and shows the response.
The way this PR implements it, causes this check request to be made every time you open the detail view/edit form of a service (and I'm also not sure how this behaves when you are adding new objects rather than editing an existing one).
This is the opposite of performing an explicit check after clicking a button. So please change the UX/UI by displaying a button or link to test the connection, which takes you to a custom admin view. In this admin view, I expect a form with the following fields:
- Method (GET / POST), default to GET
- Endpoint to test (
forms.CharField
). It's okay to add a model fieldhealth_check_path
like you did. This path needs to be appended to theapi_root
, so it cannot be absolute.
A button to submit the form, and on submissions, the health check is performed and the result reported back.
The reason for this is:
- performance - you don't want to spam the remote service every time you are editing the configuration
- a service may not be reachable with GET methods only, e.g. a SOAP endpoint typically only allows POST requests
- Diagnosing a service may require the user to try different endpoints, so having a health check path as default is fine, but it should be possible to override this at check-time
An finally, model tests alone are not sufficient. You are modifying admin behaviour, so this needs client/view tests too to ensure nothing has broken and the feature is working as intended.
Refinement: Bart and I discussed and the way its implemented matches what we discussed (but I didnt wrote it down as such afterwards). All technical issue can be addressed and or answered @bart-maykin. We can rename it to "connection check" or whatever. This is an admin perspective on whether we can connect to an endpoint and not so much a healthcheck (but named so because Bart thought Sergei wanted this). |
Return status code please instead of boolean. |
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.
One question regarding performing the actual request but overall looks good to me 👍
d29bb07
to
381ae54
Compare
41c87d9
to
821df82
Compare
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.
nitpicking 😬
821df82
to
3e30c39
Compare
3e30c39
to
ce07e64
Compare
ce07e64
to
dcf8682
Compare
dcf8682
to
923b5f6
Compare
…vice admin list page
Fixes #1617
Fixes some aspects of #12
Added health_check read_only_field in the service admin panel