| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 7c2d606c-1ad2-43b4-a085-612e7c8b2545 📥 CommitsReviewing files that changed from the base of the PR and between e7c5ad0 and 0bd8f68. 📒 Files selected for processing (1)
📝 Walkthrough WalkthroughThis PR adds a new WorkspaceWorkItemPropertyContexts sub-resource API client that enables CRUD operations on workspace-level work item property contexts, including corresponding Pydantic data models, public SDK exports, comprehensive test coverage, and documentation updates. The implementation also fixes query parameter handling in WorkItems.list_workspace and cleans up unused imports across the codebase. ChangesWorkspace Work Item Property Contexts Feature
Sequence DiagramsequenceDiagram
participant SDK_User
participant PlaneClient
participant WorkspaceWorkItemPropertyContexts
participant BaseResource
participant API_Server
SDK_User->>PlaneClient: client.workspace_work_item_properties.contexts
PlaneClient-->>SDK_User: WorkspaceWorkItemPropertyContexts instance
SDK_User->>WorkspaceWorkItemPropertyContexts: list(workspace_slug, property_id)
WorkspaceWorkItemPropertyContexts->>BaseResource: _get("/workspaces/.../properties/.../contexts/")
BaseResource->>API_Server: GET request
API_Server-->>BaseResource: context objects
BaseResource-->>WorkspaceWorkItemPropertyContexts: JSON response
WorkspaceWorkItemPropertyContexts-->>SDK_User: list[WorkItemPropertyContext]
SDK_User->>WorkspaceWorkItemPropertyContexts: create(workspace_slug, property_id, data)
WorkspaceWorkItemPropertyContexts->>BaseResource: _post("/workspaces/.../properties/.../contexts/", payload)
BaseResource->>API_Server: POST request
API_Server-->>BaseResource: created context
BaseResource-->>WorkspaceWorkItemPropertyContexts: JSON response
WorkspaceWorkItemPropertyContexts-->>SDK_User: WorkItemPropertyContext
SDK_User->>WorkspaceWorkItemPropertyContexts: update(workspace_slug, property_id, context_id, data)
WorkspaceWorkItemPropertyContexts->>BaseResource: _patch("/workspaces/.../properties/.../contexts/{id}/", payload)
BaseResource->>API_Server: PATCH request
API_Server-->>BaseResource: updated context
BaseResource-->>WorkspaceWorkItemPropertyContexts: JSON response
WorkspaceWorkItemPropertyContexts-->>SDK_User: WorkItemPropertyContext
SDK_User->>WorkspaceWorkItemPropertyContexts: delete(workspace_slug, property_id, context_id)
WorkspaceWorkItemPropertyContexts->>BaseResource: _delete("/workspaces/.../properties/.../contexts/{id}/")
BaseResource->>API_Server: DELETE request
API_Server-->>BaseResource: success
BaseResource-->>WorkspaceWorkItemPropertyContexts: None
WorkspaceWorkItemPropertyContexts-->>SDK_User: None
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes The PR introduces a new API sub-resource client with consistent patterns (CRUD methods mirroring existing BaseResource conventions), adds well-structured Pydantic models, integrates cleanly into the existing SDK architecture, and includes comprehensive test coverage. Moderate complexity stems from reviewing the new context models, the API client implementation against BaseResource patterns, and validating the integration wiring; however, changes follow established patterns and are localized to the new feature area. Possibly related PRs
Suggested reviewers
Poem🚥 Pre-merge checks | ✅ 5 ✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches 📝 Generate docstrings
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 and usage tips. |
Sorry, something went wrong.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)tests/unit/test_workspace_work_item_property_contexts.py (1)🤖 Prompt for all review comments with AI agents63-114: 🏗️ Heavy lift
Method name/docstring don't match behavior; contexts.create/contexts.delete remain untested.
This test creates a property, updates the default context, and in teardown deletes the property. It never calls client.workspace_work_item_properties.contexts.create(...) or contexts.delete(...), so the two new CRUD endpoints introduced in this PR have no coverage. Either rename to reflect what it does (create-property / update-default-context) or extend it to actually create and delete a non-default context as the docstring claims.
Want me to draft a test that creates a non-default context (with project + work-item-type IDs) and deletes it via contexts.delete?
🤖 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_workspace_work_item_property_contexts.py` around lines 63 - 114, The test currently only creates a property and updates the default context but never exercises the new contexts.create and contexts.delete endpoints; either rename the test to reflect it only updates the default context or extend it to create and delete a non-default context: call client.workspace_work_item_properties.contexts.create(workspace_slug, prop.id, CreateWorkItemPropertyContext(...)) supplying explicit project and work item type IDs (so applies_to_all_* are false), assert the returned context fields, then retrieve it via contexts.retrieve, update if needed, and finally call client.workspace_work_item_properties.contexts.delete(workspace_slug, prop.id, created_ctx.id) and assert deletion (or that list no longer contains it); update the test docstring to match the new behavior if you choose to extend rather than rename.
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 `@tests/scripts/test_estimates_methods.py`:
- Line 24: The test currently performs a no-op os.getenv("PLANE_ACCESS_TOKEN")
and always initializes the client with only api_key, breaking the "API key or
access token" path; change the setup in tests/scripts/test_estimates_methods.py
to read and use the access token: assign access_token =
os.getenv("PLANE_ACCESS_TOKEN") (or similar), then initialize the client with
the access token when present (e.g., pass access_token or choose between api_key
and access_token) so the test covers the access-token auth path instead of
ignoring the env value.
---
Nitpick comments:
In `@tests/unit/test_workspace_work_item_property_contexts.py`:
- Around line 63-114: The test currently only creates a property and updates the
default context but never exercises the new contexts.create and contexts.delete
endpoints; either rename the test to reflect it only updates the default context
or extend it to create and delete a non-default context: call
client.workspace_work_item_properties.contexts.create(workspace_slug, prop.id,
CreateWorkItemPropertyContext(...)) supplying explicit project and work item
type IDs (so applies_to_all_* are false), assert the returned context fields,
then retrieve it via contexts.retrieve, update if needed, and finally call
client.workspace_work_item_properties.contexts.delete(workspace_slug, prop.id,
created_ctx.id) and assert deletion (or that list no longer contains it); update
the test docstring to match the new behavior if you choose to extend rather than
rename.
Fix all unresolved CodeRabbit comments on this PR:
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: a9a02852-47c0-4777-86bc-2aa1be2337de
📥 CommitsReviewing files that changed from the base of the PR and between 8e8240d and e7c5ad0.
📒 Files selected for processing (19)
Sorry, something went wrong.
| base_url = os.getenv("PLANE_BASE_URL") | ||
| api_key = os.getenv("PLANE_API_KEY") | ||
| access_token = os.getenv("PLANE_ACCESS_TOKEN") | ||
| os.getenv("PLANE_ACCESS_TOKEN") |
There was a problem hiding this comment.
⚠️ Potential issue | 🟠 Major | ⚡ Quick win
Restore access-token auth path in test setup.
Line 24 is now a no-op env read, and the client still initializes with only api_key. This breaks the documented “API key or access token” flow for this script.
Proposed fix- os.getenv("PLANE_ACCESS_TOKEN")
+ access_token = os.getenv("PLANE_ACCESS_TOKEN")
@@
- client = PlaneClient(base_url=base_url, api_key=api_key)
+ client = PlaneClient(base_url=base_url, api_key=api_key, access_token=access_token)Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@tests/scripts/test_estimates_methods.py` at line 24, The test currently
performs a no-op os.getenv("PLANE_ACCESS_TOKEN") and always initializes the
client with only api_key, breaking the "API key or access token" path; change
the setup in tests/scripts/test_estimates_methods.py to read and use the access
token: assign access_token = os.getenv("PLANE_ACCESS_TOKEN") (or similar), then
initialize the client with the access token when present (e.g., pass
access_token or choose between api_key and access_token) so the test covers the
access-token auth path instead of ignoring the env value.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Overview
This PR implements workspace-level work item property contexts in the Plane Python SDK. This allows managing property visibility, requirement status, and default values across specific projects and work item types at the workspace level.
Key Changes
🚀 Workspace Work Item Property Contexts
Additionally, this PR fixes several pre-commit lint issues (Ruff, line lengths, duplicate methods, and variable shadowing).
Test Plan
1. Automated Integration & Unit Tests
Run the newly created unit/integration test suite:
Summary by CodeRabbit
Release Notes
New Features
Documentation