-
Notifications
You must be signed in to change notification settings - Fork 5
[SILO-934] feat: add advanced search api #19
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
Merged
+245
−2
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| # CLAUDE.md | ||
|
|
||
| This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. | ||
|
|
||
| ## Project Overview | ||
|
|
||
| Plane Python SDK (`plane-sdk` on PyPI, v0.2.4) — a synchronous, type-annotated Python client for the Plane API. Built on `requests` + `pydantic` v2, targeting Python 3.10+. | ||
|
|
||
| ## Common Commands | ||
|
|
||
| ```bash | ||
| # Install for development | ||
| pip install -e . | ||
| pip install -r requirements.txt | ||
|
|
||
| # Run all unit tests (requires env vars, see below) | ||
| pytest tests/unit/ | ||
|
|
||
| # Run a specific test file or test | ||
| pytest tests/unit/test_projects.py | ||
| pytest tests/unit/test_projects.py::TestProjectsAPICRUD::test_create_project | ||
|
|
||
| # Integration/script tests (excluded by default via addopts) | ||
| pytest tests/scripts/ --override-ini="addopts=" | ||
|
|
||
| # Formatting & linting | ||
| black plane tests | ||
| ruff check plane tests | ||
| ruff check --fix plane tests | ||
|
|
||
| # Type checking | ||
| mypy plane | ||
| ``` | ||
|
|
||
| ### Required Environment Variables for Tests | ||
|
|
||
| Tests make real HTTP requests (no mocking). Set these before running: | ||
|
|
||
| - `PLANE_BASE_URL` — API base URL | ||
| - `PLANE_API_KEY` or `PLANE_ACCESS_TOKEN` — authentication (exactly one) | ||
| - `WORKSPACE_SLUG` — test workspace | ||
| - `AGENT_SLUG` — (optional) needed only for agent run tests | ||
|
|
||
| ## Architecture | ||
|
|
||
| ### Client → Resource → Model pattern | ||
|
|
||
| `PlaneClient` is the single entry point. It holds a `Configuration` and exposes resource objects as attributes: | ||
|
|
||
| ``` | ||
| PlaneClient | ||
| ├── .projects → Projects(BaseResource) | ||
| ├── .work_items → WorkItems(BaseResource) | ||
| │ ├── .comments | ||
| │ ├── .attachments | ||
| │ ├── .links | ||
| │ └── ...sub-resources | ||
| ├── .cycles → Cycles(BaseResource) | ||
| └── ...15+ resources | ||
| ``` | ||
Prashant-Surya marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ### Key directories | ||
|
|
||
| - `plane/api/` — Resource classes. Every resource extends `BaseResource` which handles HTTP methods, auth headers, URL building (`/api/v1/...`), retry via `urllib3.Retry`, and response parsing. | ||
| - `plane/models/` — Pydantic v2 models. Three kinds per resource: | ||
| - **Response models** (e.g. `Project`): `extra="allow"` for forward compatibility with new API fields. | ||
| - **Request DTOs** (e.g. `CreateProject`, `UpdateProject`): `extra="ignore"` to be strict about inputs. | ||
| - **Query param models** (e.g. `PaginatedQueryParams`): `extra="ignore"`. | ||
| - `plane/client/` — `PlaneClient` (API key / access token auth) and `OAuthClient` (OAuth 2.0 flows). | ||
| - `plane/errors/` — `PlaneError` → `HttpError`, `ConfigurationError`. | ||
| - `plane/config.py` — `Configuration` and `RetryConfig` dataclasses. | ||
|
|
||
| ### Sub-resource pattern | ||
|
|
||
| Resources with children (work_items, customers, initiatives, teamspaces) instantiate sub-resource objects in `__init__`: | ||
|
|
||
| ```python | ||
| class WorkItems(BaseResource): | ||
| def __init__(self, config): | ||
| super().__init__(config, "/workspaces/") | ||
| self.comments = WorkItemComments(config) | ||
| self.attachments = WorkItemAttachments(config) | ||
| ``` | ||
|
|
||
| ### URL convention | ||
|
|
||
| All API endpoints end with a trailing `/`. URLs are built as `{base_path}/api/v1{resource_base_path}/{endpoint}/`. | ||
|
|
||
| ## Coding Conventions | ||
|
|
||
| - Line length: 100 (Black + Ruff) | ||
| - Use `X | None` not `Optional[X]`; use `list[str]` not `List[str]` (Python 3.10+ builtins) | ||
| - Import abstract types from `collections.abc` (e.g. `Mapping`, `Iterable`) | ||
| - Ruff rules: E, F, I (isort), UP (pyupgrade), B (bugbear) | ||
| - Never use "Issue" in endpoint or parameter names — always use "Work Item" | ||
| - Auth is mutually exclusive: `api_key` XOR `access_token` (raises `ConfigurationError` if both/neither) | ||
| - Resource methods accept Pydantic DTOs, serialize with `model_dump(exclude_none=True)`, and validate responses with `Model.model_validate()` | ||
| - All resources follow CRUD verbs: `create`, `retrieve`, `update`, `delete`, `list` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.