Skip to content

feat(crdless): migrate PAPI endpoints to CRD-less sync architecture#11

Open
theyashl wants to merge 2 commits into
mainfrom
crdless
Open

feat(crdless): migrate PAPI endpoints to CRD-less sync architecture#11
theyashl wants to merge 2 commits into
mainfrom
crdless

Conversation

@theyashl
Copy link
Copy Markdown
Contributor

Summary

  • Replaces branch-based Git commit endpoints with the new DB-direct sync endpoints from platform PR #3460
  • /api/v3/locations/api/v3/runners (runner list fallback in _get_authorized_locations)
  • commit_slx / deploy_registry_codebundle: replaces single POST /api/v3/workspaces/{ws}/branches/{branch}/slxs/{name} with a 3-step sync flow via /api/v1/workspaces/{ws}/*s/sync
  • delete_slx: replaces branch-based DELETE with DELETE /api/v1/workspaces/{ws}/slxs/{ws}--{name} (soft-delete)

What changed

New endpoints used

Old New
GET /api/v3/locations GET /api/v3/runners
POST /api/v3/workspaces/{ws}/branches/{branch}/slxs/{name} POST /api/v1/workspaces/{ws}/slxs/sync + runbooks/sync + slis/sync
DELETE /api/v3/workspaces/{ws}/branches/{branch}/slxs/{name} DELETE /api/v1/workspaces/{ws}/slxs/{ws}--{name}

New sync flow

The new _sync_slx_resources() helper does the multi-step upsert:

  1. POST SLX payload → gets back resource_id
  2. Injects slx_id = resource_id into runbook/SLI payloads
  3. POSTs runbook and/or SLI payloads

New payload builders: _build_slx_payload, _build_runbook_payload, _build_sli_payload.

Backward compat

The branch and commit_message parameters on commit_slx and delete_slx are retained but ignored — the sync API is branchless.

Test plan

  • commit_slx creates SLX + runbook in workspace
  • commit_slx with sli_script creates SLX + runbook + SLI
  • commit_slx with cron_schedule creates SLX + runbook + cron SLI
  • commit_slx with task_type="sli" creates SLX + SLI only
  • deploy_registry_codebundle deploys runbook and/or SLI from registry
  • delete_slx soft-deletes an existing SLX
  • get_workspace_locations falls back to /api/v3/runners correctly

🤖 Generated with Claude Code

Replaces branch-based Git commit endpoints with the new DB-direct sync
endpoints introduced in platform PR #3460.

Changes:
- /api/v3/locations → /api/v3/runners (runner list fallback)
- commit_slx / deploy_registry_codebundle: replace single POST to
  /api/v3/workspaces/{ws}/branches/{branch}/slxs/{name} with a
  multi-step sync flow:
    1. POST /api/v1/workspaces/{ws}/slxs/sync (returns resource_id)
    2. POST /api/v1/workspaces/{ws}/runbooks/sync (slx_id injected)
    3. POST /api/v1/workspaces/{ws}/slis/sync   (slx_id injected)
- delete_slx: replace branch DELETE with
  DELETE /api/v1/workspaces/{ws}/slxs/{ws}--{name} (soft-delete)

New helpers: _build_slx_payload, _build_runbook_payload,
_build_sli_payload, _sync_slx_resources

The branch/commit_message params on commit_slx/delete_slx are kept
for backward compat but are no longer used by the branchless sync API.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@theyashl theyashl self-assigned this May 15, 2026
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant