-
Notifications
You must be signed in to change notification settings - Fork 68
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
API endpoint for querying server version #47
Comments
What is your use case for this? The public API is kept on the latest version, and if you're hosting the API yourself you should know the version yeah? There is some precident for returning the version as part of the health check: https://tools.ietf.org/id/draft-inadarei-api-health-check-05.html, I'd also consider a response header. |
Well, mostly just informational purposes for now. Like: Checking if different (private or public) servers run on the same version etc. Later this could also be helpful in dealing with changes of API or behavior in the client, e.g.
etc Note that I don't actually have that problem yet, but a hook for querying the version should be introduced before that comes up for anyone ;)
Yeah, I do have other means of checking the version of my self-hosted server, but my users don't.
Absolutely.
Also possible, but for my taste a health-check field would be preferable. Btw, another useful addition for the /health endpoint might be to list the available datasets (which, apart from the version, can be another major difference in how different instances of OTD behave). |
Btw, in case you'd consider the second variant: How about putting the dev branch on top of the last release tag (from now on), instead of branching off the the release commit? Such a layout would make |
The api now adds a
I basically use git-flow for this project, which has a long-lived dev branch. I think yours is a good idea, but it's a bit beyond my git skills and I like sticking to a standard approach for open projects. Similarly, having the git commit in the version string would be helpful, but adds a dependency in the api to git. Also the public api runs in a different repo for various hacky ops reasons, so the commit ids wouldn't match up. |
Cool :D
Yeah, I know that one, and it's perfectly reasonable IMHO, except for the fact that it completely breaks
Sure, no problem. What you implemented now is perfectly reasonable. I was merely trying to point out some of the possible options for this kind of feature 😄 |
Minor feature request: It would be nice to have a way to query the server version via the API. AFAICS this is not possible right now, or is it?
One could either add a new endpoint (
/version
?), which simply returns something like:Alternatively, one could also include it into the
/health
endpoint, so that it returns:(I'd slightly prefer the second option here.)
For the version string, I can also see two different options:
VERSION
file (e.g.1.5.0
or1.5.1
).git describe --tags --always
. For current master this yieldsv1.5.1-2-gde6948d
, but for the current dev branch it just gives the git hashe72a26c
.The second variant really gives a unique version string for every commit, while the first one is more straightforward (but may not be unique, or at least less exact). Both would be an improvement over the status quo. One could also imagine outputting both of them in different json fields.
The text was updated successfully, but these errors were encountered: