Parse locations/tags/keyspace in backup restapi as CSV - #4803
Merged
Conversation
SM swagger API definitions and query param parsing diverged. Swagger definitions of locations/tags/keyspace in backup related endpoints were defined as arrays of strings. Without any additional specification (e.g., "collectionFormat": "multi"), it resulted in sending parameters as CSV instead of multiple params. On the other hand, parsing on SM side expected multiple params and didn't work when more than one param was specified. This commit fixes that by adjusting parsing on SM side to expect CSV values. Fixes #4714
Michal-Leszczynski
marked this pull request as ready for review
March 27, 2026 14:51
Michal-Leszczynski
requested review from
VAveryanov8 and
karol-kokoszka
as code owners
March 27, 2026 14:51
There was a problem hiding this comment.
Pull request overview
This PR aligns Scylla Manager’s backup REST API query-param parsing with the Swagger-generated client behavior, which sends array query parameters as CSV (rather than repeated parameters), fixing multi-tag snapshot deletion (Issue #4714).
Changes:
- Update backup REST handlers to parse
locations,keyspace, andsnapshot_tagsfrom CSV query values. - Adjust backup REST API tests to send CSV-formatted params.
- Add a regression test for deleting snapshots with multiple snapshot tags.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| pkg/restapi/backup.go | Switches backup endpoint query parsing from repeated params to CSV splitting for locations/keyspace/snapshot tags. |
| pkg/restapi/backup_test.go | Updates existing tests to send CSV params and adds a delete-snapshot test for multi-tag deletion. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
karol-kokoszka
approved these changes
Mar 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
SM swagger API definitions and query param parsing diverged. Swagger definitions of locations/tags/keyspace in backup related endpoints were defined as arrays of strings. Without any additional specification (e.g., "collectionFormat": "multi"), it resulted in sending parameters as CSV instead of multiple params. On the other hand, parsing on SM side expected multiple params and didn't work when more than one param was specified. This commit fixes that by adjusting parsing on SM side to expect CSV values.
Fixes #4714