-
Notifications
You must be signed in to change notification settings - Fork 15
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 implementation for Members, Sources and Invitations endpoints #131
Conversation
…sources endpoints
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #131 +/- ##
==========================================
- Coverage 94.55% 93.99% -0.56%
==========================================
Files 6 7 +1
Lines 918 1382 +464
==========================================
+ Hits 868 1299 +431
- Misses 50 83 +33
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
f8f01c3
to
03648d2
Compare
03648d2
to
b5f7f6b
Compare
…rialization to from_response
51ea4cc
to
3e17f92
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.
Good Job Yanne 👍
I just think that we sometime have incoherences in the way we pass parameters/queries/bodies but it's a detail
050bf67
to
463062c
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 usually do inline reviews, but that PR is too big to make this practical.
Regarding VCR cassettes
If it's not possible to write a script to automatically setup the account, then can you create a Markdown document in doc/dev/ (We have a similar directory in ggshield, but you would have to create it there) to list all the requirements for the account in one place? This would be more efficient than having to look for comments in different tests to gather them all.
client.py
update_*()
methods
- either make them all return
Optional[Detail]
orUnion[Detail, <ModelClass>]
(update_team_source() returnsUnion[Detail, int]
). - be consistent with argument names because people are going to use keyword arguments for them and changing them after a release is an API breakage. So either we call them all
payload
or w call theom all<name_of_the_model>
. I preferpayload
because what they take is not an instance of the model, it's an instance ofUpdate<Model>
.
Misc
Rename list_teams_sources()
to list_team_sources()
for consistency.
Remove the "obj.status_code" useless lines (grep -n "^ *obj\.status_code$" client.py
to find them)
models.py
@post_load
methods
-
Type-hint for
**kwargs
must beAny
. -
All existing
@post_load
methods are calledmake_<something>
. Can you use the same naming convention for yours?
conftest.py
get_member() is never used, can we remove it?
Instead of creating fixtures, you can create a test.utils module with plain functions and import them in the tests.
I added
In any case, I applied the same logic as for delete endpoints and optionally returning a Detail object if the status code is not the one we expect for a successful call 👍
I changed all updates to payload so they are all aligned 👍
This was already taken care of in a later commit 🙌
I changed kwargs typing to be Any 👍
I changed all @post_load method to be respect this convention
Indeed, I removed it 👍
I create the corresponding utils file and updated references for these functions |
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 now! Thanks for this significant addition to the API and for documenting the test setup requirements 👍🏻.
Add support for managing users
This PR implements all endpoints required for managing users on an account as well as adding support for invitations and sources handling