Skip to content
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

Use improved enterprise "get users" endpoint, and simplify collaborations model #332

Merged
merged 4 commits into from Jan 26, 2024

Conversation

mesozoic
Copy link
Collaborator

Two changes here:

  1. Calling enterprise.user() or enterprise.users() now uses the get users by id or email endpoint, which used to only accept emails (at least, according to its documentation). This removes the need to iterate over IDs and call get user by id one by one.
  2. When retrieving a user or group, we will now request collaborations by default. This can be disabled by passing collaborations=False as a keyword argument to user(), users(), or group(). This removes the need for type-checked code to do if user.collaborations: ... to check against None.

Copy link

codecov bot commented Jan 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (256812c) 99.61% compared to head (7159c67) 99.61%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #332   +/-   ##
=======================================
  Coverage   99.61%   99.61%           
=======================================
  Files          24       24           
  Lines        1801     1803    +2     
=======================================
+ Hits         1794     1796    +2     
  Misses          7        7           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mesozoic mesozoic merged commit 453d360 into gtalarico:main Jan 26, 2024
8 checks passed
@mesozoic mesozoic deleted the metadata_fixes branch March 19, 2024 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant