feat: add workspace management endpoints to OpenAPI spec#10
feat: add workspace management endpoints to OpenAPI spec#10feloy merged 2 commits intoopenkaiden:mainfrom
Conversation
Add /init, /init/verbose, and /remove endpoints to support programmatic workspace management from UIs. Include comprehensive scenario documentation in README demonstrating the complete workflow with JSON output examples and error handling. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Signed-off-by: Philippe Martin <phmartin@redhat.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds documentation examples and OpenAPI definitions for three workspace management endpoints (/init, /init/verbose, /remove) and introduces two response schemas: Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
cli/openapi.yaml (1)
6-25: Missing parameters for the/initendpoint.The
/initendpoint doesn't specify any parameters, but the error example references a source directory path (/tmp/not-found), and the README showskortex-cli init -o json /tmp/not-found. Consider adding a query parameter to document the optional source path argument.📝 Proposed addition for the source path parameter
/init: get: summary: Initialize a new workspace + parameters: + - name: source + in: query + description: Path to the source directory (optional) + required: false + schema: + type: string responses:🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@cli/openapi.yaml` around lines 6 - 25, The /init GET operation is missing a parameter for the optional source path shown in examples; add an optional query parameter (e.g., name: source or path, in: query, schema: type: string) to the /init get operation so the OpenAPI docs document the CLI argument (refer to the /init get operation and the Error response example that mentions the source directory); ensure the parameter is marked required: false and include a brief description like "optional source directory path".
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@cli/openapi.yaml`:
- Around line 72-91: The /remove GET operation is missing a workspace identifier
parameter; update the OpenAPI path (e.g., change /remove to /remove/{id}) and
add a required path parameter named id (type: string, description: "Workspace
id") for the get operation that references the existing WorkspaceId schema in
responses and adjust the example values accordingly; ensure the parameter is
marked required and included in the operation's parameters block so the CLI's
`workspace remove <id>` behavior is documented.
In `@cli/README.md`:
- Around line 98-105: Update the example under the "Workspace not found" section
so the error message matches the command argument by replacing the hard-coded
"Error: workspace not found: aze" string with "Error: workspace not found:
unknown-id" (look for the example containing the command "kortex-cli workspace
remove unknown-id -o json" and the error JSON). Also make the same change in the
OpenAPI doc entry that currently contains the "Error: workspace not found: aze"
example (search for that exact error string in the openapi.yaml and replace it
with the matching "unknown-id").
---
Nitpick comments:
In `@cli/openapi.yaml`:
- Around line 6-25: The /init GET operation is missing a parameter for the
optional source path shown in examples; add an optional query parameter (e.g.,
name: source or path, in: query, schema: type: string) to the /init get
operation so the OpenAPI docs document the CLI argument (refer to the /init get
operation and the Error response example that mentions the source directory);
ensure the parameter is marked required: false and include a brief description
like "optional source directory path".
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b14073b3-ad72-4e78-9145-5f5bf365513c
📒 Files selected for processing (2)
cli/README.mdcli/openapi.yaml
Add note that input parameters are not defined in the OpenAPI spec. Replace placeholder error ID "aze" with more descriptive "unknown-id" for clarity. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Signed-off-by: Philippe Martin <phmartin@redhat.com>
Add /init, /init/verbose, and /remove endpoints to support programmatic workspace management from UIs. Include comprehensive scenario documentation in README demonstrating the complete workflow with JSON output examples and error handling.
Related to openkaiden/kortex-cli#54