Skip to content

CLI: Update SDK to v0.37.0 and add profiles list params#118

Merged
rgarcia merged 5 commits intomainfrom
cli-coverage-update
Feb 23, 2026
Merged

CLI: Update SDK to v0.37.0 and add profiles list params#118
rgarcia merged 5 commits intomainfrom
cli-coverage-update

Conversation

@kernel-internal
Copy link
Contributor

@kernel-internal kernel-internal bot commented Feb 21, 2026

Summary

This PR updates the Go SDK dependency to the latest version and updates CLI commands to match SDK interface changes.

SDK Update

  • Updated kernel-go-sdk to v0.37.0 (cb6bef95524033ec889ef9dc2eb8a2c43507ba36)

Coverage Analysis

A full enumeration of SDK methods and CLI commands was performed. The SDK update included a breaking change to the ProfileService.List method signature.

Changes

  • ProfileService.List: Updated to accept ProfileListParams parameter (breaking change from SDK)
  • Added --limit, --offset, --query flags to kernel profiles list command
  • Updated ProfilesService interface and tests

New Flags

  • --limit for ProfileListParams.Limit on kernel profiles list
  • --offset for ProfileListParams.Offset on kernel profiles list
  • --query for ProfileListParams.Query on kernel profiles list

Triggered by: kernel/kernel-go-sdk@cb6bef9
Reviewer: @dcruzeneil2


Note

Medium Risk
Introduces new deletion flows (including concurrent deletes) that can remove deployments/apps, so correctness of filtering/confirmation and error handling is important despite relatively localized CLI changes.

Overview
Updates kernel-go-sdk to v0.37.0 (and adds golang.org/x/sync) and adapts the CLI to the SDK’s breaking Profiles.List signature by introducing paginated, queryable kernel profiles list (--page, --per-page, --query) with updated tests.

Adds destructive-management commands: kernel app delete <app_name> (optionally --version, with confirmation and concurrent deletion of all matching deployments) and kernel deploy delete <deployment_id> (with confirmation/--yes and not-found handling).

Written by Cursor Bugbot for commit 74ca985. This will update automatically on new commits. Configure here.

Update Go SDK dependency to latest version. Full SDK method enumeration
performed - all SDK methods have corresponding CLI commands (no coverage
gaps found).

Triggered by: kernel/kernel-go-sdk@b6a60bb

Co-authored-by: Cursor <cursoragent@cursor.com>
Updates the Go SDK dependency to the latest version.

Coverage Analysis: Full enumeration of SDK methods and CLI commands
was performed. No coverage gaps were found - all SDK methods have
corresponding CLI commands.

Co-authored-by: Cursor <cursoragent@cursor.com>
@kernel-internal kernel-internal bot changed the title CLI: Update Go SDK to b6a60bbf00a2ee46bd2c13f4f068de462b46de47 CLI: Update Go SDK to 0bf19a19dfd789f8a73e02513360d019fcb9d37d Feb 21, 2026
- `kernel deploy delete <id>`: deletes a single deployment by ID with
  confirmation prompt (skippable via --yes)
- `kernel app delete <name>`: deletes all deployments for an app,
  optionally scoped to a specific --version, with parallel deletion
  and a progress spinner

Both commands use the new Deployments.Delete SDK method added in the
go-sdk bump.

Co-authored-by: Cursor <cursoragent@cursor.com>
@rgarcia rgarcia changed the title CLI: Update Go SDK to 0bf19a19dfd789f8a73e02513360d019fcb9d37d Update Go SDK and add deploy/app delete commands Feb 23, 2026
@rgarcia rgarcia requested a review from masnwilliams February 23, 2026 16:10
Copy link
Contributor

@masnwilliams masnwilliams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good — a few nits on the app delete command, nothing blocking.

params.AppVersion = kernel.Opt(version)
}

initial, err := client.Deployments.List(cmd.Context(), params)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this initial list fetch is only used as an existence check and then thrown away — the deletion loop re-lists from offset 0 anyway. could skip this entirely and just check deleted == 0 after the loop to print "no deployments found"

break
}

g, gctx := errgroup.WithContext(cmd.Context())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: no concurrency limit on the errgroup — this fires up to 100 parallel deletes per page. g.SetLimit(10) or similar would be friendlier to the API

return client.Deployments.Delete(gctx, dep.ID)
})
}
if err := g.Wait(); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if one delete in the batch fails, g.Wait() returns early but some deletes may have already succeeded. might be worth printing the deleted count in the error path too, so the user knows partial progress happened

- Updated kernel-go-sdk from v0.36.2-0.20260221214548-0bf19a19dfd7 to v0.37.0
- Updated ProfilesService.List to accept ProfileListParams (breaking change)
- Added --limit, --offset, --query flags to profiles list command
- Updated tests for new ProfilesService interface

Co-authored-by: Cursor <cursoragent@cursor.com>
@kernel-internal kernel-internal bot changed the title Update Go SDK and add deploy/app delete commands CLI: Update SDK to v0.37.0 and add profiles list params Feb 23, 2026
}
deleted += len(items)
spinner.UpdateText(fmt.Sprintf("Deleted %d deployment(s) so far...", deleted))
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deletion loop may infinite-loop on async deletes

High Severity

The deletion loop always re-lists deployments at Offset 0. The PR description states that Delete "stops a running deployment and marks it for deletion" rather than deleting immediately. If marked-for-deletion deployments still appear in list results, the loop will keep fetching the same items and re-attempting deletion indefinitely. The offset is never advanced, so there's no forward progress when items linger in the list after a delete call.

Additional Locations (1)

Fix in Cursor Fix in Web

g.Go(func() error {
return client.Deployments.Delete(gctx, dep.ID)
})
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unbounded parallel deletes may overwhelm the API

Medium Severity

The errgroup created for each page of deployments has no concurrency limit, so up to 100 Delete calls fire simultaneously per batch. This can overwhelm the API with concurrent requests, triggering rate limiting or transient failures that cause the entire batch to abort. Adding a concurrency limit via g.SetLimit() would make this much safer.

Fix in Cursor Fix in Web

@rgarcia rgarcia merged commit 4c05c17 into main Feb 23, 2026
2 checks passed
@rgarcia rgarcia deleted the cli-coverage-update branch February 23, 2026 20:16
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

if err := g.Wait(); err != nil {
spinner.Fail("Failed to delete deployments")
return util.CleanedUpSdkError{Err: err}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Batch delete error discards partial progress count

Medium Severity

When g.Wait() returns an error during the batch deletion loop, the function reports "Failed to delete deployments" and returns — but the deleted count from prior successful iterations is silently discarded. For a destructive, irreversible operation, the user has no way to know whether 0 or hundreds of deployments were already removed, making recovery difficult.

Fix in Cursor Fix in Web

for _, dep := range items {
g.Go(func() error {
return client.Deployments.Delete(gctx, dep.ID)
})
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Batch delete missing not-found handling causes unnecessary failures

Medium Severity

The batch delete goroutines in runAppDelete propagate not-found errors as failures, while every other delete path in the codebase — including runDeployDelete in the same diff — treats not-found as success (idempotent delete). If a deployment is removed between the List call and the Delete call (e.g., by a concurrent user or auto-cleanup), the not-found error from one goroutine causes g.Wait() to fail, cancels the gctx context (aborting other in-flight deletes), and aborts the entire operation unnecessarily.

Fix in Cursor Fix in Web

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.

2 participants