Skip to content

feat: Add Replay API support#756

Draft
nieomylnieja wants to merge 3 commits intomainfrom
add-replay-endpoints
Draft

feat: Add Replay API support#756
nieomylnieja wants to merge 3 commits intomainfrom
add-replay-endpoints

Conversation

@nieomylnieja
Copy link
Collaborator

Motivation

Describe what is the motivation behind the proposed changes.
If possible reference the current solution/state of affairs.

Summary

Recap of changed code.

Related changes

List related changes from other PRs (if any).

Testing

  • Describe how to check introduced code changes manually. Simple main.go which takes advantage of the introduced changes is preferred (if possible and useful).
  • Take care of test coverage on unit, integration or even end-to-end levels.

Release Notes

If this change should be part of the Release Notes,
replace this entire paragraph with 1-3 sentences about the changes.
Otherwise, you MUST remove this section entirely.

Does this PR contain any breaking changes?
If so, add ## Breaking Changes header and list the introduced changes there.

Breaking Changes

sdk/models package has been removed. The Replay related models have been transferred to sdk/endpoints/replay/v1 package.

This commit introduces significant changes to the replay endpoints and their associated validation logic. The following updates have been made:

1. **Endpoint Updates**:
   - Added new endpoints for `Cancel`, `Delete`, `DeleteAll`, `List`, and `GetStatus` operations.
   - Refactored the `Replay` endpoint to `Run` for better clarity and alignment with its functionality.
   - Introduced a helper function `handleReplayError` to centralize error handling logic for replay-related operations.

2. **Request and Validation Changes**:
   - Renamed `ReplayRequest` to `RunRequest` and updated its fields for consistency (`Slo` to `SLO`, `ReplayDuration` to `Duration`, etc.).
   - Added new request types: `DeleteRequest`, `CancelRequest`, and `GetStatusRequest`.
   - Updated validation rules to reflect the new structure and naming conventions.
   - Enhanced validation logic to ensure only one of `duration` or `startDate` is set, and added checks for future dates.

3. **Response Updates**:
   - Updated `ReplayWithStatus` to use `SLO` instead of `Slo`.
   - Introduced a new response type `ReplayListItem` for listing replay items.

4. **Test Updates**:
   - Refactored test cases to align with the new request and response structures.
   - Updated test names and assertions to reflect the renaming and added validation rules.

5. **Miscellaneous**:
   - Updated helper functions and constants to align with the new naming conventions.
   - Improved error messages and validation error codes for better clarity.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change We're breaking the API enhancement New feature or request go minor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants