Skip to content

Parse locations/tags/keyspace in backup restapi as CSV - #4803

Merged
Michal-Leszczynski merged 1 commit into
masterfrom
ml/4714-delete-multiple-snapshot-tags
Mar 27, 2026
Merged

Parse locations/tags/keyspace in backup restapi as CSV#4803
Michal-Leszczynski merged 1 commit into
masterfrom
ml/4714-delete-multiple-snapshot-tags

Conversation

@Michal-Leszczynski

Copy link
Copy Markdown
Collaborator

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

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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, and snapshot_tags from 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.

Comment thread pkg/restapi/backup.go
Comment thread pkg/restapi/backup.go
Comment thread pkg/restapi/backup.go
Comment thread pkg/restapi/backup_test.go
@Michal-Leszczynski
Michal-Leszczynski merged commit 92ca2d9 into master Mar 27, 2026
99 checks passed
@Michal-Leszczynski
Michal-Leszczynski deleted the ml/4714-delete-multiple-snapshot-tags branch March 27, 2026 15:25
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.

sctool backup delete -T tag1,tag2 does not work

3 participants