Skip to content

[WPB-16870] introduce user groups subsystem #4545

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

Merged
merged 94 commits into from
May 21, 2025

Conversation

fisx
Copy link
Contributor

@fisx fisx commented Apr 16, 2025

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

this adds a wire subsystem for user groups with tests and in-memory interpreter.

coming up in future PRs:

  • brig public api.
  • postgres interpreter.

Checklist

  • coordinate with platform before you merge this PR, so that all the envs can be configured correctly in advance
  • Add a new entry in an appropriate subdirectory of changelog.d
  • Read and follow the PR guidelines (can't at the moment)

@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Apr 16, 2025
@fisx fisx force-pushed the WPB-16870-user-groups-create-and-get branch 2 times, most recently from a5e1731 to e119925 Compare April 16, 2025 15:08
@fisx fisx marked this pull request as ready for review April 16, 2025 15:10
@fisx fisx requested review from a team as code owners April 16, 2025 15:10
@fisx fisx mentioned this pull request Apr 16, 2025
2 tasks
@akshaymankar akshaymankar force-pushed the WPB-16870-user-groups-create-and-get branch 3 times, most recently from 142fca5 to 88a5c27 Compare April 24, 2025 12:22
@fisx fisx force-pushed the WPB-16870-user-groups-create-and-get branch from 71c726a to 29a7243 Compare May 2, 2025 08:40
@battermann battermann force-pushed the WPB-16870-user-groups-create-and-get branch from 29a7243 to 18ad40b Compare May 2, 2025 09:50
@fisx fisx force-pushed the WPB-16870-user-groups-create-and-get branch 4 times, most recently from 18b5565 to a83888f Compare May 6, 2025 11:20
@battermann battermann self-requested a review May 9, 2025 14:39
Copy link
Contributor

@pcapriotti pcapriotti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't review it in detail, but LGTM. Minor comment below.

@fisx fisx force-pushed the WPB-16870-user-groups-create-and-get branch from 43ba624 to f6cbad0 Compare May 13, 2025 08:19
Copy link
Member

@akshaymankar akshaymankar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, minor comments inline.

Comment on lines +11 to +12
testUserGroupSmoke :: (HasCallStack) => App ()
testUserGroupSmoke = do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this called smoke?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it just kicks the api a little to see if it's superficially acting alive. i thought smoke test describes that well, but i don't mind a better name. do you have one?

Comment on lines +69 to +73
sanitized :: Wai.Error
sanitized =
if Wai.code e == status500
then e {Wai.message = "Internal Server Error"}
else e
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does logging of this error happen before or after this point?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

before, that's the point. this is right before we send it on the wire.

Comment on lines +81 to +89
admins <- getTeamAdmins team
let push =
def
{ origin = Just creator,
json = toJSONObject $ UserGroupEvent $ UserGroupCreated ug.id_,
recipients = (\tm -> Recipient (tm ^. TM.userId) RecipientClientsAll) <$> admins ^. teamMembers,
transient = True
}
pushNotifications [push]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given user groups is a search now and team management doesn't have to load them all up. Does this event make any sense?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, not sure. happy to remove it if that's what we decide.

fisx added 6 commits May 21, 2025 07:33
featuring:
- effect
- data types
- test skeleton
- mock interpreter skeleton
the qualified import in Main is needed for some test setups involving
ghcid and cabal-repl; moving all deps to the common section in the
cabal file just seemed more ergonomic?
@battermann battermann force-pushed the WPB-16870-user-groups-create-and-get branch from ff95607 to 446d703 Compare May 21, 2025 07:55
@battermann battermann merged commit 477d591 into develop May 21, 2025
8 checks passed
@battermann battermann deleted the WPB-16870-user-groups-create-and-get branch May 21, 2025 10:34
supersven added a commit that referenced this pull request May 21, 2025
supersven added a commit that referenced this pull request May 21, 2025
@supersven supersven restored the WPB-16870-user-groups-create-and-get branch May 21, 2025 15:37
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.

6 participants