-
Notifications
You must be signed in to change notification settings - Fork 40
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
Add user freeze feature #6298
Add user freeze feature #6298
Conversation
touilleMan
commented
Jan 31, 2024
•
edited
Loading
edited
- Implementation only in memory
- Documentation is missing
- No client support
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.
A couple of comments, LGTM otherwise 👍
c516a96
to
cc3bc1e
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.
LGTM overall. Some minor comments.
- Are you planning to add the docs from Implement RFC 1007 - Frozen users for parsec v2 #5842 to this PR?
- By "No client support" you mean the CLI?
outcome = await backend.user.list_users(organization_id) | ||
match outcome: | ||
case list() as users: | ||
pass | ||
case UserListUsersBadOutcome.ORGANIZATION_NOT_FOUND: | ||
raise HTTPException(status_code=404, detail="Organization not found") | ||
case unknown: | ||
assert_never(unknown) |
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.
Is there a rationale for the "outcome" wording? (I noticed it was introduced in #6214)
I don't have strong arguments against it, it's just that it doesn't feel "standard" (which is usually better for readability). Usually this things are named result
or response
. Also suffix BadOutcome
for enums which has the downside of using 2 words instead something like just Error
.
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.
"Outcome" comes from the outcome library, so an outcome wraps the result of a function.
Usually this things are named result or response
I think response
is to be used when doing http request.
result
would have been possible name, but it lacks the fact both ok and error are contained. Given in Python you expect a function to return the ok part and raise an exception for the errors, a dedicated name like outcome is good for readability.
Also suffix BadOutcome for enums which has the downside of using 2 words instead something like just Error.
This is a feature ! ^^
You have FooError
which is an exception and FooBadOutcome
which is an enum of possible errors.
a251876
to
eab7bfd
Compare
eab7bfd
to
ac30338
Compare