Conversation
36d0755 to
6b2faf8
Compare
6b2faf8 to
e1fee79
Compare
e1fee79 to
ac1eaf3
Compare
bdd2e8d to
1f9110f
Compare
659c5c7 to
2a68cdd
Compare
f2c20da to
1058fbf
Compare
fisx
left a comment
There was a problem hiding this comment.
I like the outcome of this process! I think it's both pragmatic and reasonably elegant. I have a few nit-picks, and haven't read enough of this PR to approve it, but I'm generally happy.
| Start version 2 of the public API. Main changes: | ||
|
|
||
| - Asset endpoints have lost their `v3` and `v4` suffixes. So for example | ||
| `/assets/v3` has been replaced by `/access`. |
There was a problem hiding this comment.
I hope this is a typo? :)
| `/assets/v3` has been replaced by `/access`. | |
| `/assets/v3` has been replaced by `/assets`. |
Also, isn't that something that could have gone into a separate PR?
There was a problem hiding this comment.
It could've, but I thought it would be useful to start using the new system immediately. It's kind of like adding tests for X in the same PR where you implement X itself. In fact, it is a bit worrying that we are not making significant use of it for the federation API. I've played around with it in a branch, though, by making some random changes to the API, and it seemed to be working reasonably well there, too.
| # Versions and servant routing tables | ||
| Of course, development versions are useful while building a new API, but are | ||
| not suitable for production. Backends deployed to production environments | ||
| should disable development versions (and not advertise them in `/api-version`). |
There was a problem hiding this comment.
| should disable development versions (and not advertise them in `/api-version`). | |
| should disable development versions (and not advertise them in `/api-version`). | |
| On the other hand, production clients must disregard all development versions | |
| as unsupported. |
This would be easier if development versions would not also be listed as versions. I'm actually in favor of this. I think it's a lot less error-prone.
There was a problem hiding this comment.
I went back and forth with this, and in the end I think I prefer the current system, because it places no burden on clients. Clients can just start using V2 now, without any special logic, and as long as we disable it in production, it won't affect anything.
Also, it makes it easier to test, because we only need to make sure that the backend has a development version enabled, and not that the client has turned out development API access as well.
But I can be convinced otherwise. This is not too problematic to change later on, anyway.
There was a problem hiding this comment.
I have added the following paragraph:
Similarly, clients that are meant for production use can decide to ignore
development versions on their backend. This is not strictly necessary, but it
can be used as a safeguard against mistakes in deployment.
There was a problem hiding this comment.
I went back and forth with this, and in the end I think I prefer the current system, because it places no burden on clients. Clients can just start using V2 now, without any special logic, and as long as we disable it in production, it won't affect anything.
Also, it makes it easier to test, because we only need to make sure that the backend has a development version enabled, and not that the client has turned out development API access as well.
But I can be convinced otherwise. This is not too problematic to change later on, anyway.
I'm ok with everything except the last sentence. :) So, yes, do it your way.
Since we are using file-embed-lzma to embed swagger definitions in the executable (and servant-swagger itself is using it to embed the swagger frontend), there is no point in maintaining a second way to embed static files into the executable. Therefore, this commit removes the mechanism for loading the swagger description at compile time via a custom `Setup.hs`, introduced in #1956, and simply embeds it using `embedText` from `file-embed-lzma`.
Co-authored-by: fisx <mf@zerobuzz.net>
Co-authored-by: fisx <mf@zerobuzz.net>
Also add an option to enable development versions.
7f50245 to
d2ee0f6
Compare
Implement API versioning system. See
docs/legacy/developer/api-versioning.mdfor details.Tracked by:
Checklist
changelog.d.