-
Notifications
You must be signed in to change notification settings - Fork 334
WPB-19716: Batch create Channels and Map them to User Groups #4790
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
WPB-19716: Batch create Channels and Map them to User Groups #4790
Conversation
db1b267 to
2dea4d2
Compare
235d349 to
50eec40
Compare
f1d21c7 to
24e10b4
Compare
| - `--galley-url GALLEY_URL`: Galley service URL (e.g., `https://prod-nginz-https.wire.com`) | ||
| - `--brig-url BRIG_URL`: Brig service URL (e.g., `https://prod-nginz-https.wire.com`) |
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 think one url for the public api of the backend services is enough. especially given we'd love to merge brig, galley, spar into one huge "micro"-service :)
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.
Sure, but I did not find a way to have it locally, so I replicated from another tool.
Which one is 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.
they almost always the same, so just --wire-server-url? but i'm having second thoughts since you're saying this is copied from prior art. what would you do if you had to decide?
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 don't mind changing, I just have not find the correct one for local/docker environment.
If you can tell me which one is it, or where I can find it, I'll be happy to change, it was my first implementation anyway.
libs/wire-subsystems/test/unit/Wire/MockInterpreters/UserGroupStore.hs
Outdated
Show resolved
Hide resolved
| createChannel manager services (Token token) userId teamId channelName = do | ||
| let url = services.galleyUrl.fromApiUrl <> "/v12/conversations" | ||
| body = | ||
| object |
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.
aren't there types for this in wire-api?
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 forgot this one, sorry
| Nothing -> | ||
| case parseMaybe (.: "id") obj of | ||
| Just convId -> pure $ Right convId | ||
| Nothing -> pure $ Left $ ErrorDetail 201 (object ["error" .= ("Failed to extract conversation ID" :: Text)]) |
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.
why "ErrorDetail 201"? is 201 the http status code? why not 4xx?
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 get the correct status (201), but not the correct body.
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 don't understand (and i've even had coffee today!). in this line, you construct something that looks like an http response object (with status, body, ...), probably for being logged or somoehow reported to the user. (right?)
the http response you're constructing is about an error condition, but the status code says otherwise. why would the status code and the body in the same response tell different stories?
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.
Initially it was to report unexpected status code, should I create a dedicated constructor for unexpected bodies?
|
nice! i'm done reading, i'll (probably :) approve once you have responded to my comments. |
7a2fedc to
d1da213
Compare
4a437fb to
ef79da1
Compare
ef79da1 to
99455bb
Compare
https://wearezeta.atlassian.net/browse/WPB-17126
Checklist
changelog.d