feat(sdk): delete_cluster / delete_job in client.rl (issue #558) - #559
Conversation
Completes the RL surface for the 0.34.0 release: the merged namespace (#557) predates basilica-backend's DELETE routes (their PR planned this follow-up) — SDK users could create clusters and jobs but not remove them, falling back to kubectl for cleanup. Three layers, mirroring the existing method patterns exactly: - basilica-sdk: DeleteRlClusterResponse/DeleteRlJobResponse DTOs (wire shape pinned by test) + delete_rl_cluster/delete_rl_job on the client (name-validated, typed DELETE). - basilica-sdk-python: rl_delete_cluster/rl_delete_job pymethods (JSON-over-the-boundary, same runtime.detach shape as the rest). - python client.rl: delete_cluster/delete_job with the semantics in the docstrings — delete_cluster is refused with an actionable error while a job is active (the server names the blocking job; deleting the job IS the cancel path); delete_job is valid in any phase. The .pyi stub is pyo3_stub_gen-generated and picks the new methods up at build time; no hand edits. Live verification against staging lands once one-covenant/basilica-backend#1525 merges and its CD deploys — the first use will be SDK-driven cleanup of the smoke-test clusters, the exact workflow this closes.
WalkthroughThis PR completes the RL SDK surface for the 0.34.0 release by introducing Changes
Estimated review effort: 1/5 (mirrors existing SDK patterns with straightforward wrapper additions and standard DTOs). Instant overview - a deep technical review follows as a separate comment. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. WalkthroughThe SDK adds RL cluster and job deletion APIs. Rust methods validate names and send authenticated DELETE requests. Python bindings expose the methods, and Python namespace wrappers return decoded response dictionaries. ChangesRL deletion support
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This PR adds localized SDK deletion methods across the Rust and Python client layers; no actionable merge-blocking risk remains beyond normal checks and review. Sequence Diagram(s)sequenceDiagram
participant PythonRlNamespace
participant PythonBasilicaClient
participant RustBasilicaClient
participant RLAPI
PythonRlNamespace->>PythonBasilicaClient: delete_cluster(name) or delete_job(name)
PythonBasilicaClient->>RustBasilicaClient: Invoke asynchronous deletion method
RustBasilicaClient->>RustBasilicaClient: Validate DNS-1035 name
RustBasilicaClient->>RLAPI: Send authenticated DELETE request
RLAPI-->>RustBasilicaClient: Return deletion response
RustBasilicaClient-->>PythonBasilicaClient: Serialize response as JSON
PythonBasilicaClient-->>PythonRlNamespace: Return decoded dictionary
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
PR #559: feat(sdk): delete_cluster / delete_job in client.rl (issue #558)SummaryThis PR completes the RL SDK surface by adding delete operations symmetric with the existing create/get paths: two wire DTOs ( ArchitecturesequenceDiagram
participant Py as client.rl (rl.py)
participant Core as PyO3 (lib.rs)
participant SDK as BasilicaClient (client.rs)
participant API as basilica-backend
Py->>Core: delete_cluster(name) / delete_job(name)
Core->>SDK: delete_rl_cluster(&name) / delete_rl_job(&name)
SDK->>SDK: validate_rl_name(name)
SDK->>API: DELETE /rl/clusters/{name} or /rl/jobs/{name}
API-->>SDK: {"name": "..."} or 400 (blocking job named)
SDK-->>Core: DeleteRl*Response
Core-->>Py: JSON string → dict
No structural impact: the new methods follow the identical three-layer pattern already used by Issues FoundCRITICAL Issues (Must Fix Before Merge)None found. HIGH Severity Issues (Advised to Fix Before Merge)None found. MEDIUM Severity Issues (Optional to Fix Before Merge)
LOW Severity Issues (Minor Improvements)
Security ReviewSweep of this diff's actual surface:
No security-relevant defect found in this diff. Suggestions for Improvements
Positive Observations
Recommendation and Next StepsAPPROVE — the change is additive, coherent with existing patterns, input-validated, and wire-pinned by test; the only open item is release sequencing, which the author has already planned for. Next steps: land the staged live verification after basilica-backend#1525 deploys, and backfill error-path test coverage in that follow-up. |
Summary
Adds
delete_cluster/delete_jobto the SDK'sclient.rlnamespace, completing the RL surface for the 0.34.0 release. The merged namespace (#557) predates basilica-backend's DELETE routes (one-covenant/basilica-backend#1525 — reviewed as a pair with this PR): SDK users could create clusters and jobs but not remove them, falling back to kubectl for cleanup.Related Issues
Closes #558
Type of Change
Changes Made
basilica-sdk:DeleteRlClusterResponse/DeleteRlJobResponseDTOs (camelCase wire shape pinned by a serde test) +delete_rl_cluster/delete_rl_jobclient methods (name-validated, typed DELETE) — mirroring the existingget_rl_*patterns exactly.basilica-sdk-python:rl_delete_cluster/rl_delete_jobpymethods (JSON-over-the-boundary, sameruntime/py.detachshape as the rest of the binding).client.rl:delete_cluster/delete_jobwith the semantics documented in the docstrings —delete_clusteris refused with an actionable error while a job is active (the server names the blocking job; deleting the job IS the cancel path);delete_jobis valid in any phase (deleting a running job IS cancel)..pyistub ispyo3_stub_gen-generated and picks the new methods up at build time; no hand edits.Testing
How Has This Been Tested?
cargo test) — basilica-sdk 93 passed + 7 passed, including the newdelete_response_wire_shapepin (deserializes the exact server DTO shapes from one-covenant/basilica-backend#1525).cargo clippyclean on both crates; python wrapper compiles.Test Configuration
Checklist
cargo fmtto format my codecargo clippyand addressed all warningsAdditional Context
Ships in 0.34.0 together with #557 so one release carries the complete beta
.rlsurface (create/get/wait/delete for clusters and jobs). Release plan per Evan's sign-off: version bump 0.33.0 → 0.34.0, CHANGELOG entry markingclient.rlas beta (staging-only).