-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add 'server_version' endpoint to admin API #4772
Add 'server_version' endpoint to admin API #4772
Conversation
We will later need also to import 'register_servlets' from the 'login' module, so we un-pollute the namespace now to keep the logical changes separate.
This is required because the 'Server' HTTP header is not always passed through proxies.
62fcdbd
to
f24721c
Compare
Codecov Report
@@ Coverage Diff @@
## develop #4772 +/- ##
===========================================
- Coverage 75.13% 67.65% -7.49%
===========================================
Files 340 340
Lines 34918 34931 +13
Branches 5722 5723 +1
===========================================
- Hits 26237 23631 -2606
- Misses 7067 9652 +2585
- Partials 1614 1648 +34 |
Codecov Report
@@ Coverage Diff @@
## develop #4772 +/- ##
===========================================
- Coverage 75.13% 75.12% -0.02%
===========================================
Files 340 340
Lines 34918 34996 +78
Branches 5722 5750 +28
===========================================
+ Hits 26237 26289 +52
- Misses 7067 7089 +22
- Partials 1614 1618 +4 |
It seems to have un-stuck itself |
Signed-off-by: Joseph Weston <[email protected]>
f24721c
to
d3dcb64
Compare
@@ -66,6 +69,25 @@ def on_GET(self, request, user_id): | |||
defer.returnValue((200, ret)) | |||
|
|||
|
|||
class VersionServlet(ClientV1RestServlet): | |||
PATTERNS = client_path_patterns("/admin/server_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 guess a first point to make sure we agree on is what to call this endpoint.
server_version
seems better than simply version
IMO, because it is more explicit
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.
Also I just realised I forgot to add documentation for this endpoint.
ret = { | ||
'server_version': get_version_string(synapse), | ||
'python_version': platform.python_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.
Then there's what should be returned. @hawkowl suggested to also return the Python version (IIRC) because we can, and because this is often a pain point for users.
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.
this is often a pain point for users.
i.e. that troubleshooting is harder without this information, so we may as well return it
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.
this looks great, though please could you add a file in https://github.com/matrix-org/synapse/tree/develop/docs/admin_api to document it?
For sure! I got distracted, but I'll do it now :) |
Signed-off-by: Joseph Weston <[email protected]>
Thanks! |
Pull Request Checklist
Closes #3220