-
Notifications
You must be signed in to change notification settings - Fork 326
[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
Conversation
a5e1731
to
e119925
Compare
142fca5
to
88a5c27
Compare
71c726a
to
29a7243
Compare
29a7243
to
18ad40b
Compare
18b5565
to
a83888f
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.
I didn't review it in detail, but LGTM. Minor comment below.
43ba624
to
f6cbad0
Compare
libs/wire-subsystems/test/unit/Wire/UserGroupSubsystem/InterpreterSpec.hs
Show resolved
Hide resolved
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 overall, minor comments inline.
testUserGroupSmoke :: (HasCallStack) => App () | ||
testUserGroupSmoke = do |
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 is this called smoke?
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.
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?
sanitized :: Wai.Error | ||
sanitized = | ||
if Wai.code e == status500 | ||
then e {Wai.message = "Internal Server Error"} | ||
else e |
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.
Does logging of this error happen before or after this point?
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.
before, that's the point. this is right before we send it on the wire.
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] |
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.
Given user groups is a search now and team management doesn't have to load them all up. Does this event make any sense?
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.
hm, not sure. happy to remove it if that's what we decide.
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?
This reverts commit 73c397a.
ff95607
to
446d703
Compare
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:
Checklist
changelog.d
Read and follow the PR guidelines (can't at the moment)