improve workspace api documentation and comments - #861
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe PR adds Python workspace unstage methods, documents staged-change endpoints in OpenAPI, registers those endpoints, generates schemas for staged-status models, and updates workspace conflict response codes. ChangesWorkspace staging API and OpenAPI
Estimated code review effort: 2 (Simple) | ~10 minutes Mergeability Score: ⚪ Minimal · up to This documentation-focused change has no actionable merge-blocking risk remaining and is merge-ready after normal checks and review. Sequence Diagram(s)sequenceDiagram
participant Workspace
participant PyWorkspace
participant WorkspaceChangesAPI
Workspace->>PyWorkspace: unstage(path)
PyWorkspace->>WorkspaceChangesAPI: remove path from workspace changes
WorkspaceChangesAPI-->>PyWorkspace: return success or API error
PyWorkspace-->>Workspace: return None or PyOxenError
Possibly related PRs
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
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 `@crates/oxen-server/src/controllers/workspaces/changes.rs`:
- Around line 31-32: Validate the page_size query parameter in both workspace
changes operations so zero is rejected before pagination calculations, while
preserving the existing safe handling for page=0. Update both parameter
descriptions to document that page_size must be at least 1, and ensure invalid
values return the established request-validation error.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: f8d69410-e5c8-4d95-9be3-f8acf189e9a2
📒 Files selected for processing (9)
crates/liboxen/src/model/staged_dir_stats.rscrates/liboxen/src/model/summarized_staged_dir_stats.rscrates/liboxen/src/view/remote_staged_status.rscrates/oxen-py/src/py_workspace.rscrates/oxen-server/src/controllers/workspaces.rscrates/oxen-server/src/controllers/workspaces/changes.rscrates/oxen-server/src/errors.rscrates/oxen-server/src/main.rsoxen-python/python/oxen/workspace.py
| #[utoipa::path( | ||
| get, | ||
| path = "/api/repos/{namespace}/{repo_name}/workspaces/{workspace_id}/changes", | ||
| description = "List the staged changes (added, modified, and removed files) in a workspace, paginated.", |
There was a problem hiding this comment.
I believe this endpoint paginates each of the three file lists independently, I think the description could be made a little more helpful
| #[utoipa::path( | ||
| get, | ||
| path = "/api/repos/{namespace}/{repo_name}/workspaces/{workspace_id}/changes/{path}", | ||
| description = "List the staged changes (added, modified, and removed files) under a directory in a workspace, paginated.", |
There was a problem hiding this comment.
same here: I believe this endpoint paginates each one independently, I think the description could be made a little more helpful
…es docs The added, modified, and removed lists are each paginated independently, so say so in both endpoint descriptions. Also reject page_size=0 with a 400 instead of returning total_pages = usize::MAX. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Realized there were some gaps in our workspace api docs when working on the text editor project