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

Implemented list team memberships #331

Merged
merged 5 commits into from
Oct 19, 2024
Merged

Conversation

pingu2k4
Copy link
Contributor

@pingu2k4 pingu2k4 commented Oct 19, 2024

Changes

  • Implemented list team memberships

Issue

#308

Checklist before requesting a review

The PR will only be considered when all items within the checklist are marked as complete. Feel free to submit an incomplete draft PR, and add additional commits until you are able to satisfy each item within the checklist.

  • I have performed a self-review of my code
  • I have submitted at most one additional endpoint implementation
  • I have either submitted no additional endpoint implementation, or my implementation covers both client and server SDK's, unless either are marked in the README with a ❌
  • I have added applicable tests for my code
  • I have updated the README with updated status as a result of this PR

Description by Korbit AI

What change is being made?

Implement the functionality to list team memberships by adding the ListTeamMemberships method to both client and server interfaces and their respective implementations, and update the README to reflect the new feature.

Why are these changes being made?

These changes are made to provide the ability to retrieve a list of team members using the team's ID, which is a necessary feature for managing team memberships effectively. The implementation aligns with the Appwrite API documentation and enhances the application's functionality by allowing users to access team membership data. Additionally, the README progress indicators are updated to reflect the completion of this feature.

Is this description stale? Ask me to generate a new description by commenting /korbit-generate-pr-description

@pingu2k4 pingu2k4 self-assigned this Oct 19, 2024
@pingu2k4 pingu2k4 linked an issue Oct 19, 2024 that may be closed by this pull request
Copy link

Risk Level 2 - /home/runner/work/AppwriteSdk/AppwriteSdk/src/PinguApps.Appwrite.Client/Clients/TeamsClient.cs

  1. Ensure that the request.Validate(true); call is necessary and correctly implemented to avoid potential runtime errors. 2. Consider logging the exception details in the catch block for better debugging and monitoring.

Risk Level 2 - /home/runner/work/AppwriteSdk/AppwriteSdk/src/PinguApps.Appwrite.Server/Clients/TeamsClient.cs

  1. Ensure that the request.Validate(true); call is necessary and correctly implemented to avoid potential runtime errors. 2. Consider logging the exception details in the catch block for better debugging and monitoring.

Risk Level 3 - /home/runner/work/AppwriteSdk/AppwriteSdk/src/PinguApps.Appwrite.Playground/App.cs

The hardcoded TeamId value in the ListTeamMembershipsRequest could lead to issues if the ID changes or is incorrect. Consider externalizing this value to a configuration file or environment variable.


🔍🛠️⚠️


Powered by Code Review GPT

Copy link

github-actions bot commented Oct 19, 2024

Test Results

1 919 tests  +11   1 919 ✅ +11   12s ⏱️ ±0s
    3 suites ± 0       0 💤 ± 0 
    3 files   ± 0       0 ❌ ± 0 

Results for commit a0c564c. ± Comparison against base commit 98f3556.

This pull request removes 218 and adds 229 tests. Note that renamed tests count towards both.
PinguApps.Appwrite.Server.Tests.Clients.Users.UsersClientTests ‑ CreateUserJwt_ShouldReturnSuccess_WhenApiCallSucceeds(request: CreateUserJwtRequest { Duration = 1800, SessionId = "67142ed80011e999f9c7", UserId = "67142ed80011efec633b" })
PinguApps.Appwrite.Server.Tests.Clients.Users.UsersClientTests ‑ CreateUserJwt_ShouldReturnSuccess_WhenApiCallSucceeds(request: CreateUserJwtRequest { Duration = null, SessionId = null, UserId = "67142ed80011ca367a7f" })
PinguApps.Appwrite.Server.Tests.Clients.Users.UsersClientTests ‑ ListUserLogs_ShouldReturnSuccess_WhenApiCallSucceeds(request: ListUserLogsRequest { Queries = null, UserId = "67142ed80011e1e05871" })
PinguApps.Appwrite.Server.Tests.Clients.Users.UsersClientTests ‑ ListUserLogs_ShouldReturnSuccess_WhenApiCallSucceeds(request: ListUserLogsRequest { Queries = null, UserId = "67142ed80011e33ce170" })
PinguApps.Appwrite.Server.Tests.Clients.Users.UsersClientTests ‑ ListUserTargets_ShouldReturnSuccess_WhenApiCallSucceeds(request: ListUserTargetsRequest { Queries = null, UserId = "67142ed80011e3a7bd95" })
PinguApps.Appwrite.Server.Tests.Clients.Users.UsersClientTests ‑ ListUserTargets_ShouldReturnSuccess_WhenApiCallSucceeds(request: ListUserTargetsRequest { Queries = null, UserId = "67142ed80011e78efcc9" })
PinguApps.Appwrite.Server.Tests.Clients.Users.UsersClientTests ‑ UpdateUserLabels_ShouldReturnSuccess_WhenApiCallSucceeds(request: UpdateUserLabelsRequest { Labels = ["label1", "label2"], UserId = "67142ed80011eef04f8f" })
PinguApps.Appwrite.Server.Tests.Clients.Users.UsersClientTests ‑ UpdateUserLabels_ShouldReturnSuccess_WhenApiCallSucceeds(request: UpdateUserLabelsRequest { Labels = ["label3", "label4"], UserId = "67142ed80011e4c30944" })
PinguApps.Appwrite.Shared.Tests.Requests.Account.CreatePushTargetRequestTests ‑ IsValid_WithInvalidData_ReturnsFalse(request: CreatePushTargetRequest { Identifier = "", ProviderId = "provider123", TargetId = "67142ed400154dc5a4ec" })
PinguApps.Appwrite.Shared.Tests.Requests.Account.CreatePushTargetRequestTests ‑ IsValid_WithInvalidData_ReturnsFalse(request: CreatePushTargetRequest { Identifier = null, ProviderId = "provider123", TargetId = "67142ed400154fcd80a1" })
…
PinguApps.Appwrite.Client.Tests.Clients.Teams.TeamsClientTests ‑ ListTeamMemberships_ShouldHandleException_WhenApiCallFails
PinguApps.Appwrite.Client.Tests.Clients.Teams.TeamsClientTests ‑ ListTeamMemberships_ShouldProvideQueryParams_WhenQueriesAndSearchProvided
PinguApps.Appwrite.Client.Tests.Clients.Teams.TeamsClientTests ‑ ListTeamMemberships_ShouldReturnErrorResponse_WhenExceptionOccurs
PinguApps.Appwrite.Client.Tests.Clients.Teams.TeamsClientTests ‑ ListTeamMemberships_ShouldReturnError_WhenSessionIsNull
PinguApps.Appwrite.Client.Tests.Clients.Teams.TeamsClientTests ‑ ListTeamMemberships_ShouldReturnSuccess_WhenApiCallSucceeds
PinguApps.Appwrite.Client.Tests.Clients.Teams.TeamsClientTests ‑ ListTeams_ShouldProvideQueryParamss_WhenQueriesAndSearchProvided
PinguApps.Appwrite.Server.Tests.Clients.Teams.TeamsClientTests ‑ ListTeamMemberships_ShouldHandleException_WhenApiCallFails
PinguApps.Appwrite.Server.Tests.Clients.Teams.TeamsClientTests ‑ ListTeamMemberships_ShouldProvideQueryParams_WhenQueriesAndSearchProvided
PinguApps.Appwrite.Server.Tests.Clients.Teams.TeamsClientTests ‑ ListTeamMemberships_ShouldReturnErrorResponse_WhenExceptionOccurs
PinguApps.Appwrite.Server.Tests.Clients.Teams.TeamsClientTests ‑ ListTeamMemberships_ShouldReturnSuccess_WhenApiCallSucceeds
…

♻️ This comment has been updated with latest results.

Copy link

Code Coverage

Package Line Rate Branch Rate Complexity Health
PinguApps.Appwrite.Client 100% 100% 122
PinguApps.Appwrite.Server 100% 100% 100
PinguApps.Appwrite.Shared 100% 100% 619
Summary 100% (2021 / 2021) 100% (234 / 234) 841

Copy link

korbit-ai bot commented Oct 19, 2024

My review is in progress 📖 - I will have feedback for you in a few minutes!

Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary by Korbit AI

Code Execution Comments

  • Improve error handling by logging exceptions and checking TeamId validity before API calls to prevent unexpected behavior.
Files scanned
File Path Reviewed
src/PinguApps.Appwrite.Client/Clients/ITeamsClient.cs
src/PinguApps.Appwrite.Client/Clients/TeamsClient.cs
src/PinguApps.Appwrite.Playground/App.cs
src/PinguApps.Appwrite.Server/Clients/ITeamsClient.cs
src/PinguApps.Appwrite.Server/Clients/TeamsClient.cs
src/PinguApps.Appwrite.Shared/Responses/MembershipsList.cs

Explore our documentation to understand the languages and file types we support and the files we ignore.

Need a new review? Comment /korbit-review on this PR and I'll review your latest changes.

Korbit Guide: Usage and Customization

Interacting with Korbit

  • You can manually ask Korbit to review your PR using the /korbit-review command in a comment at the root of your PR.
  • You can ask Korbit to generate a new PR description using the /korbit-generate-pr-description command in any comment on your PR.
  • Too many Korbit comments? I can resolve all my comment threads if you use the /korbit-resolve command in any comment on your PR.
  • Chat with Korbit on issues we post by tagging @korbit-ai in your reply.
  • Help train Korbit to improve your reviews by giving a 👍 or 👎 on the comments Korbit posts.

Customizing Korbit

  • Check out our docs on how you can make Korbit work best for you and your team.
  • Customize Korbit for your organization through the Korbit Console.

Current Korbit Configuration

General Settings
Setting Value
Review Schedule Automatic excluding drafts
Max Issue Count 10
Automatic PR Descriptions
Issue Categories
Category Enabled
Naming
Database Operations
Documentation
Logging
Error Handling
Systems and Environment
Objects and Data Structures
Tests
Readability and Maintainability
Asynchronous Processing
Design Patterns
Third-Party Libraries
Performance
Security
Functionality

Feedback and Support

@pingu2k4
Copy link
Contributor Author

/korbit-generate-pr-description

Copy link

korbit-ai bot commented Oct 19, 2024

@pingu2k4 I am looking at your pull request. The description will be updated shortly. In the meantime, please do not edit the description until I have finished writing mine.

@pingu2k4 pingu2k4 merged commit f81ed71 into dev Oct 19, 2024
3 checks passed
@pingu2k4 pingu2k4 deleted the 308-task-teams-list-team-memberships branch October 19, 2024 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Task] Teams - List Team Memberships
1 participant