Skip to content

Conversation

@blackheaven
Copy link
Contributor

@blackheaven blackheaven commented Sep 25, 2025

https://wearezeta.atlassian.net/browse/WPB-17126

Checklist

  • Add a new entry in an appropriate subdirectory of changelog.d
  • Read and follow the PR guidelines

@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Sep 25, 2025
@blackheaven blackheaven force-pushed the gdifolco/WPB-19712_user-groups-update-endpoint branch 2 times, most recently from db1b267 to 2dea4d2 Compare October 8, 2025 08:51
Base automatically changed from gdifolco/WPB-19712_user-groups-update-endpoint to develop October 8, 2025 14:37
@blackheaven blackheaven force-pushed the gdifolco/WPB-19716_channel-batch-create-user-groups branch from 235d349 to 50eec40 Compare October 9, 2025 09:26
@blackheaven blackheaven changed the base branch from develop to WPB-20728-background-job-for-user-group-to-channel-association October 9, 2025 09:26
@blackheaven blackheaven marked this pull request as ready for review October 15, 2025 19:34
@blackheaven blackheaven requested a review from a team as a code owner October 15, 2025 19:34
@blackheaven blackheaven force-pushed the gdifolco/WPB-19716_channel-batch-create-user-groups branch from f1d21c7 to 24e10b4 Compare October 15, 2025 19:42
@blackheaven blackheaven requested review from a team as code owners October 16, 2025 07:12
Comment on lines 36 to 37
- `--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`)
Copy link
Contributor

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 :)

Copy link
Contributor Author

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?

Copy link
Contributor

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?

Copy link
Contributor Author

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.

createChannel manager services (Token token) userId teamId channelName = do
let url = services.galleyUrl.fromApiUrl <> "/v12/conversations"
body =
object
Copy link
Contributor

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?

Copy link
Contributor Author

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)])
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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?

Copy link
Contributor Author

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?

@fisx
Copy link
Contributor

fisx commented Oct 16, 2025

nice! i'm done reading, i'll (probably :) approve once you have responded to my comments.

@blackheaven blackheaven force-pushed the gdifolco/WPB-19716_channel-batch-create-user-groups branch from 7a2fedc to d1da213 Compare October 16, 2025 12:41
@blackheaven blackheaven changed the base branch from WPB-20728-background-job-for-user-group-to-channel-association to develop October 16, 2025 13:04
@blackheaven blackheaven force-pushed the gdifolco/WPB-19716_channel-batch-create-user-groups branch 4 times, most recently from 4a437fb to ef79da1 Compare October 16, 2025 21:18
@blackheaven blackheaven force-pushed the gdifolco/WPB-19716_channel-batch-create-user-groups branch from ef79da1 to 99455bb Compare October 16, 2025 22:41
@blackheaven blackheaven merged commit 778a1a9 into develop Oct 17, 2025
9 checks passed
@blackheaven blackheaven deleted the gdifolco/WPB-19716_channel-batch-create-user-groups branch October 17, 2025 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants