Delete recordings endpoint #43
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Allow folks to delete recordings. A concern for long running containers is the space used by recordings grows unbounded. We have ~some safeguards in place (e.g. total amount of space for a single recording, total amount of time for a single recording) but no way of actually marking recordings for clean up. I chose what felt like a simple path of "whoever is telling me to record can also tell me when to clean up". To be clear: this isn't meant to prevent all failure modes wrt storage but in typical workflows this should keep run times well within bounds
Testing
Units + end to end with our API
TL;DR
Added a new API endpoint and underlying functionality to allow users to delete recordings, addressing concerns about unbounded storage growth.
Why we made these changes
To provide a mechanism for cleaning up old recordings, preventing them from consuming excessive disk space, especially in long-running container environments.
What changed?
/recordings/:id/deleteendpoint to trigger recording deletion.Recorderinterface now includesDeleteandIsDeletedmethods.FFmpegRecorderimplements deletion, removing associated files and marking recordings as deleted.api.goprevents downloads of deleted recordings and handles deletion requests.ListActiveRecordersnow excludes deleted recordings.openapi.yamland regeneratedoapi.goto reflect the new deletion endpoint.api_test.gomock recorder updated to simulate deletion scenarios.Validation