Skip to content

chore: switch replay commands to SDK endpoints - #482

Merged
nieomylnieja merged 14 commits into
mainfrom
switch-to-sdk-replay
Aug 25, 2026
Merged

chore: switch replay commands to SDK endpoints#482
nieomylnieja merged 14 commits into
mainfrom
switch-to-sdk-replay

Conversation

@nieomylnieja

@nieomylnieja nieomylnieja commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Motivation

The related Go SDK change includes a versioned Replay API. Sloctl no longer needs separate Replay HTTP requests and models.

Summary

  • Migrated Replay run, availability, status, list, cancel, and delete operations to sdk/endpoints/replay/v1.
  • Preserved SLO handling across API versions and fixed project-scoped lookups when the SDK parser returns generic objects.
  • Preserved source-SLO objective mappings and RFC3339 createdAt values in Replay list output.
  • Used only the SLO selector for availability checks, which prevents mutually exclusive SLO and data-source selector modes.
  • Pinned nobl9-go to v0.135.0-rc1.0.20260813210234-1ab7747b42f5 and updated the Go requirement to 1.26.6.

Related changes

Testing

  • Added CLI-level Bats coverage that creates SLOs across multiple Projects and verifies that target lookup reaches Replay availability. The fixture includes a cross-project source-SLO mapping.
  • Added list coverage for RFC3339 createdAt values and coarse Replay status values.
  • Added request-shape coverage for SLO-only availability, Replay creation, cancellation, targeted deletion, and deletion of all queued Replays.
  • Exercised the verified binary in a development environment through creation, JSON listing, terminal-state cancellation, targeted deletion, and cleanup.

Breaking Changes

Building sloctl from source now requires Go 1.26.6 instead of Go 1.26.5.

Replace custom replay HTTP requests with typed SDK replay and object APIs.
Updates the nobl9-go dependency and adds coverage for source SLO config parsing.
@github-actions github-actions Bot added the python label Aug 7, 2026
Replace manual manifest decoding with SDK types and add replay e2e coverage for project-scoped SLO resolution.
Switch Replay SLO retrieval to the generic manifest endpoint and decode returned objects locally. Expand e2e fixtures and assertions to verify existing SLOs are not misclassified as missing.
Stop the status-check ticker on completion, add unit tests for source SLO decoding, conflict errors, and composite SLOs, and tighten replay e2e response validation.
nieomylnieja added a commit to nobl9/nobl9-go that referenced this pull request Aug 25, 2026
## Motivation

Replay clients currently maintain separate HTTP requests and models. A
versioned SDK interface provides one public contract for managing
Replays and reduces drift between consumers.

## Summary

- Added Replay V1 methods to run Replays, list active requests, inspect
status, request cancellation, delete queued requests, and check
availability.
- Added validated requests and typed response values for Replay types,
statuses, cancellation states, sources, durations, and availability
reasons.
- Preserved RFC3339 `createdAt` values and unknown availability reasons
returned by the Nobl9 platform.
- Required availability requests to select either an SLO or a data
source and rejected non-positive or overflowing durations without
reintroducing the former 30-day SDK limit.
- Replaced the legacy `sdk/models` Replay API with
`sdk/endpoints/replay/v1`.

## Related changes

- [sloctl #482](nobl9/sloctl#482)

## Testing

- Added end-to-end coverage for availability by SLO and data source,
`timeRange.startDate`, source-SLO objective mapping, and `Run`, `List`,
`GetStatus`, `Cancel`, and `Delete` flows, including queued,
in-progress, canceled, and completed states plus RFC3339 `createdAt`.
- Added unit coverage for request validation and serialization, selector
modes, duration boundaries and overflow, status conversion, and unknown
availability reasons.

## Release Notes

Added a versioned Replay API to start Replays, inspect status and
availability, list active requests, request cancellation, and delete
queued requests. Replay types now live under `sdk/endpoints/replay/v1`.

## Breaking Changes

Removed the `sdk/models` package, including its legacy Replay types and
helpers. Consumers must migrate to `sdk/endpoints/replay/v1`.
`models.Replay` is replaced by `v1.RunRequest`, acronym fields use
`SLO`, and the unsupported `EndDate` field has no replacement.
@nieomylnieja
nieomylnieja merged commit 95b7922 into main Aug 25, 2026
5 checks passed
@nieomylnieja
nieomylnieja deleted the switch-to-sdk-replay branch August 25, 2026 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants