-
Notifications
You must be signed in to change notification settings - Fork 326
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
Fix setting team feature status in Stern/backoffice #1146
Conversation
797c8f8
to
a741174
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.
Looks good!
Have you run this locally? If you have, let's document how to do that.
It worked as expected when I curled it, but I'm still trying to run the backoffice Swagger app. I'll keep at it, might just fix https://github.com/zinfra/backend-issues/issues/1496 and https://github.com/wireapp/wire-server/tree/develop/tools/stern#how-to-run-stern-together-with-the-rest-of-wire-server as well. 🤷 |
Umhh, so I managed to get this working locally with some trickery, but there is a bit of a usability issue: Normally, we want JSON requests and responses to be objects, but for the backoffice this doesn't really make sense, as it's much more cumbersome now to send requests. So I guess we should accept a plain JSON string instead (only in Stern)? To do that, we will need to split out a separate type again... |
Yeah, it will be nicer to accept a plain string in the body, that way we get the dropdown. But this is also fine as few other endpoints in the same swagger-ui require much more complex JSONs and so the users clearly understand this. |
i'm in favor of making this more usable, if it's not more than 3 hours (i don't think it should be.) |
all we need to do is move the type which was there before from the body to the query, right? |
That's actually a good idea, requiring fewer changes. Unfortunately, I already started doing this by splitting the type into one with is just a JSON string and one with the object wrapper around it. Almost done with that... Might be slightly nicer to have that separation, because then also the types defined for the interface correspond more closely to their JSON structure (which will also be helpful if we want to start automatically deriving JSON stuff). I'll push the update soon, so you can have a look and shout if you think the query parameter is the better solution. |
e95f1d9
to
28c81bf
Compare
@fisx @akshaymankar This should work now. (and I verified it's a dropdown in the backoffice again) |
I'll do that as part of #1148. Where do you think would be the best place to document it? I was first thinking about the stern README, but now I'm not sure anymore. |
It would be nice if it started when I run |
Okay, I'll look into it as part of the other PR. This one should be ready to be merged, though. Do you think the approach with splitting into |
deriving stock (Eq, Show, Generic) | ||
deriving (Arbitrary) via (GenericUniform TeamFeatureStatus) | ||
newtype TeamFeatureStatus = TeamFeatureStatus | ||
{teamFeatureStatusValue :: TeamFeatureStatusValue} |
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.
sigh
This is rolling back the change we did in tag image/2.83.22
(#1122). The reason we changed it was that it made the code simpler all over the backend, as you can tell from all the awkwardness you had to add. :-P
So, good thing you asked for a second review!
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.
we discussed this, and came to the conclusion that this code is more beaurocratic, but less surprising. so we'll keep it.
3442980
to
887e47a
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.
as discussed: all good! pleas take a look at my commit and merge if you agree.
Using FromJSON here would have required quotes around the value, so I instead added a FromByteString instance.
887e47a
to
40b3fd2
Compare
I rebase this and tested the backoffice. Ran into an issue with the query param deserialization, which I fixed now. I will merge once CI passed. |
See https://github.com/zinfra/backend-issues/issues/1529