| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
📝 Walkthrough
WalkthroughAdds lite-list query parameters, lite response models, client list_lite methods for projects, cycles, and modules, plus a workspace project-role distribution endpoint with models, tests, docs, and a version bump. ChangesLite list endpoints
Workspace role distribution
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
Poem🚥 Pre-merge checks | ✅ 5 ✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. ❤️ ShareComment @coderabbitai help to get the list of available commands. |
Sorry, something went wrong.
|
@gurusainath Can we bump the SDK version |
Sorry, something went wrong.
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)tests/unit/test_cycles.py (1)🤖 Prompt for all review comments with AI agents39-48: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
Make the cycle_view test assert the filter behavior, not just the response shape.
This still passes if cycle_view is never serialized, because it only checks envelope/types. Please assert the outgoing params through a stubbed request path, or add a result-level check that the returned cycles actually fit the "current" window.
🤖 Prompt for AI AgentsVerify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/unit/test_cycles.py` around lines 39 - 48, The list_lite cycle_view test only verifies the response envelope and types, so it can pass even if the filter is ignored. Update test_list_lite_cycle_view to assert the actual behavior of CycleLiteListQueryParams(cycle_view="current") by stubbing or inspecting the request sent from client.cycles.list_lite, or by adding a stronger result assertion that every returned CycleLite falls within the current window. Use the existing test_list_lite_cycle_view and CycleLiteListQueryParams symbols to locate the test and make it fail when cycle_view is not serialized or honored.
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@plane/api/cycles.py`:
- Around line 112-114: The Cycles API call in the get-lite path is missing the
required trailing slash, which can break routing in stricter setups. Update the
endpoint string used in the _get call within the cycles API method so it follows
the same trailing-slash convention as the other plane/api resources, keeping the
change localized to the cycles-lite request path.
In `@plane/api/modules.py`:
- Around line 106-108: The new lite endpoint in the `modules` API method is
missing the required trailing slash, which breaks the repo’s URL convention.
Update the request path in the `Modules` client method that calls `modules-lite`
so it ends with `/`, keeping it consistent with the other API endpoints and
avoiding redirect-dependent behavior.
In `@plane/api/workspaces.py`:
- Around line 58-69: Rename the new public method on WorkspacesAPI from
get_project_role_distribution to retrieve_project_role_distribution so it
matches the SDK’s CRUD-style naming convention. Update the _get call in that
method to use the trailing-slash endpoint literal
f"{workspace_slug}/project-role-distribution/" to align with the repository’s
API URL conventions. Keep the existing behavior and return type unchanged.
---
Nitpick comments:
In `@tests/unit/test_cycles.py`:
- Around line 39-48: The list_lite cycle_view test only verifies the response
envelope and types, so it can pass even if the filter is ignored. Update
test_list_lite_cycle_view to assert the actual behavior of
CycleLiteListQueryParams(cycle_view="current") by stubbing or inspecting the
request sent from client.cycles.list_lite, or by adding a stronger result
assertion that every returned CycleLite falls within the current window. Use the
existing test_list_lite_cycle_view and CycleLiteListQueryParams symbols to
locate the test and make it fail when cycle_view is not serialized or honored.
Fix all unresolved CodeRabbit comments on this PR:
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d2587688-19bd-46de-afea-944a50d42409
📥 CommitsReviewing files that changed from the base of the PR and between c8a7449 and 82927fe.
📒 Files selected for processing (13)
Sorry, something went wrong.
| response = self._get( | ||
| f"{workspace_slug}/projects/{project_id}/modules-lite", | ||
| params=params.to_query_params() if params else None, |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Add the trailing slash to the new lite endpoint path.
modules-lite is called without the terminal /, so this new resource method is off the repository's API URL convention and may rely on redirect behavior.
Suggested fix- f"{workspace_slug}/projects/{project_id}/modules-lite",
+ f"{workspace_slug}/projects/{project_id}/modules-lite/",As per coding guidelines, plane/api/**/*.py: "All API endpoints should end with a trailing / and follow URL convention: {base_path}/api/v1{resource_base_path}/{endpoint}/".
📝 Committable suggestion‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| response = self._get( | |
| f"{workspace_slug}/projects/{project_id}/modules-lite", | |
| params=params.to_query_params() if params else None, | |
| response = self._get( | |
| f"{workspace_slug}/projects/{project_id}/modules-lite/", | |
| params=params.to_query_params() if params else None, |
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@plane/api/modules.py` around lines 106 - 108, The new lite endpoint in the `modules` API method is missing the required trailing slash, which breaks the repo’s URL convention. Update the request path in the `Modules` client method that calls `modules-lite` so it ends with `/`, keeping it consistent with the other API endpoints and avoiding redirect-dependent behavior.
Source: Coding guidelines
Sorry, something went wrong.
| def get_project_role_distribution(self, workspace_slug: str) -> ProjectRoleDistribution: | ||
| """Get the distribution of project members by role across the workspace. | ||
|
|
||
| Aggregates member counts per role over all active (non-archived) | ||
| projects in the workspace. Both built-in roles (admin, contributor, | ||
| commenter, guest) and custom roles are included. | ||
|
|
||
| Args: | ||
| workspace_slug: The workspace slug identifier | ||
| """ | ||
| response = self._get(f"{workspace_slug}/project-role-distribution") | ||
| return ProjectRoleDistribution.model_validate(response) |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
Align this new method with the SDK's API conventions.
This adds a new public get_* method and a slashless endpoint literal. Please rename it to retrieve_project_role_distribution and call f"{workspace_slug}/project-role-distribution/" so the new surface matches the repository conventions before it ships.
Suggested patch- def get_project_role_distribution(self, workspace_slug: str) -> ProjectRoleDistribution:
+ def retrieve_project_role_distribution(self, workspace_slug: str) -> ProjectRoleDistribution:
"""Get the distribution of project members by role across the workspace.
@@
- response = self._get(f"{workspace_slug}/project-role-distribution")
+ response = self._get(f"{workspace_slug}/project-role-distribution/")
return ProjectRoleDistribution.model_validate(response)As per coding guidelines, plane/api/**/*.py resource methods follow CRUD verbs (create, retrieve, update, delete, list) and all API endpoints should end with a trailing /.
📝 Committable suggestion‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| def get_project_role_distribution(self, workspace_slug: str) -> ProjectRoleDistribution: | |
| """Get the distribution of project members by role across the workspace. | |
| Aggregates member counts per role over all active (non-archived) | |
| projects in the workspace. Both built-in roles (admin, contributor, | |
| commenter, guest) and custom roles are included. | |
| Args: | |
| workspace_slug: The workspace slug identifier | |
| """ | |
| response = self._get(f"{workspace_slug}/project-role-distribution") | |
| return ProjectRoleDistribution.model_validate(response) | |
| def retrieve_project_role_distribution(self, workspace_slug: str) -> ProjectRoleDistribution: | |
| """Get the distribution of project members by role across the workspace. | |
| Aggregates member counts per role over all active (non-archived) | |
| projects in the workspace. Both built-in roles (admin, contributor, | |
| commenter, guest) and custom roles are included. | |
| Args: | |
| workspace_slug: The workspace slug identifier | |
| """ | |
| response = self._get(f"{workspace_slug}/project-role-distribution/") | |
| return ProjectRoleDistribution.model_validate(response) |
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@plane/api/workspaces.py` around lines 58 - 69, Rename the new public method
on WorkspacesAPI from get_project_role_distribution to
retrieve_project_role_distribution so it matches the SDK’s CRUD-style naming
convention. Update the _get call in that method to use the trailing-slash
endpoint literal f"{workspace_slug}/project-role-distribution/" to align with
the repository’s API URL conventions. Keep the existing behavior and return type
unchanged.
Source: Coding guidelines
Sorry, something went wrong.
…tion to send the status in list endpoint
There was a problem hiding this comment.
tests/unit/test_cycles.py (1)🤖 Prompt for all review comments with AI agents50-67: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
Add one test for the deprecated cycle_view alias.
These cases lock in the new status contract, but the PR also promises backward compatibility. A small assertion using CycleListQueryParams(cycle_view="current") would keep that deprecated path covered too.
🤖 Prompt for AI AgentsVerify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/unit/test_cycles.py` around lines 50 - 67, Add a test covering the deprecated cycle_view alias so backward compatibility is locked in alongside the new status behavior. In test_cycles.py, extend the existing cycle list tests to call client.cycles.list with CycleListQueryParams(cycle_view="current") and assert it still returns the bare list/Cycle items, using the same client.cycles.list and CycleListQueryParams symbols to keep the legacy path covered.
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. Nitpick comments: In `@tests/unit/test_cycles.py`: - Around line 50-67: Add a test covering the deprecated cycle_view alias so backward compatibility is locked in alongside the new status behavior. In test_cycles.py, extend the existing cycle list tests to call client.cycles.list with CycleListQueryParams(cycle_view="current") and assert it still returns the bare list/Cycle items, using the same client.cycles.list and CycleListQueryParams symbols to keep the legacy path covered.
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 3d3c4a8e-a209-470e-bca5-a25e06f4355e
📥 CommitsReviewing files that changed from the base of the PR and between ac6634b and b911c54.
📒 Files selected for processing (6)
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Description
Added support for new SDK APIs to improve project, cycle, module, and workspace querying.
Changes
Lite List Endpoints
Added support for:
These endpoints return lightweight, cursor-paginated responses for picker and lookup use cases.
Project Role Distribution
Added:
This endpoint returns project member distribution across workspace roles.
Cycle Status Filtering
Added support for cycle status filtering using:
Also added support for the deprecated cycle_view alias on the full cycle list endpoint.
SDK Updates
Test Scenarios