-
Notifications
You must be signed in to change notification settings - Fork 11
feat: Add project collaborators functionality #456
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #456 +/- ##
==========================================
- Coverage 82.18% 81.94% -0.25%
==========================================
Files 92 93 +1
Lines 8506 8658 +152
==========================================
+ Hits 6991 7095 +104
- Misses 1515 1563 +48 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
f5c93c8 to
c6c6a40
Compare
bb4308f to
58db353
Compare
fernandocorreia-galileo
left a comment
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 looks like it needs more test coverage (see below). There are also a couple nits.
- Test coverage at 68% - Codecov shows 48 uncovered lines:
- Collaborator.update() and Collaborator.remove() error paths
- delattr, hash, to_dict() in Collaborator
- Direct tests for Collaborator class methods are missing
- Missing test for collaborator methods on local-only project (test_project.py:355-363) - Tests list_collaborators and add_collaborator but doesn't test update_collaborator or remove_collaborator for local-only projects.
| # Collaborator Management | ||
| # ------------------------------------------------------------------------- | ||
|
|
||
| def list_collaborators(self) -> builtins.list[Collaborator]: |
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 doesn't look like it's necessary to use builtins here, list is not shadowed.
| Returns users who have access to this project. Each Collaborator object | ||
| has update() and remove() methods for modifying access. You can also | ||
| use add_collaborator() on the project to add new collaborators. |
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.
collaborators property triggers API call on every access - Users may not realize project.collaborators is not cached. Consider documenting this more prominently or caching.
User description
Shortcut:
Description:
This PR adds collaborator management functionality to the
__future__package, enabling SDK users to manage project access through an object-centric API. Users can now list, add, update, and remove collaborators on projects usingproject.collaborators,project.add_collaborator(),project.update_collaborator(), andproject.remove_collaborator().The new
Collaboratorclass provides an immutable representation of a user's access to a project, withupdate()andremove()methods for direct manipulation.The implementation follows the SDK's established patterns:
Collaboratoris immutable (likeModel), re-exportsCollaboratorRolefrom the auto-generated models to avoid duplication, and integrates with the existing Projects service for API calls.Tests:
Generated description
Below is a concise technical summary of the changes proposed in this PR:
Introduces collaborator management functionality to the SDK, allowing users to manage project access through an object-centric API. Implements the
Collaboratorclass and extends theProjectcomponent with methods to list, add, update, and remove project collaborators.Collaboratorclass to provide an immutable representation of user access, includingupdateandremovemethods for direct resource manipulation.Modified files (2)
Latest Contributors(0)
Projectclass withlist_collaborators,add_collaborator,update_collaborator, andremove_collaboratormethods to facilitate project sharing and access control.Modified files (6)
Latest Contributors(0)