Add backup command#219
Open
peterjan wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds backup management capabilities to s3d by exposing snapshot list/delete operations through the admin API and wiring corresponding s3d backup CLI subcommands, building on the existing SQLite snapshot/backup implementation.
Changes:
- Extend the backend interface and Sia implementation to support listing and deleting recorded snapshot backups.
- Add new admin API endpoints to list backups and delete a backup snapshot; update OpenAPI accordingly.
- Add
s3d backup create|list|deleteCLI commands and a changeset entry documenting the feature.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
sia/sia.go |
Adds backend methods for listing/deleting snapshots and maps store snapshot records to admin API DTOs. |
s3/s3.go |
Extends admin backend interface and registers new admin API routes for backup listing/deletion. |
s3/s3_test.go |
Updates admin API tests to validate list/delete snapshot endpoints via HTTP. |
s3/admin.go |
Introduces Snapshot response type and handlers for listing/deleting snapshots. |
openapi.yml |
Documents the new /system/sqlite3/backups list and delete endpoints plus Snapshot schema. |
cmd/s3d/main.go |
Wires the new backup command and its subcommands into the CLI command tree. |
cmd/s3d/backup.go |
Implements the `s3d backup create |
.changeset/backup_commands.md |
Records the user-facing change for release tooling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3c98e1e to
cfd57b9
Compare
cfd57b9 to
9569274
Compare
Open
Comment on lines
+397
to
+399
| "POST /system/sqlite3/backup": s3.handleBackupSQLite3, | ||
| "GET /system/sqlite3/backups": s3.handleListSnapshots, | ||
| "DELETE /system/sqlite3/backups/:id": s3.handleDeleteSnapshot, |
Comment on lines
+341
to
+344
| // DeleteSnapshot removes the snapshot with the given id. | ||
| func (s *Sia) DeleteSnapshot(_ context.Context, snapshotID int64) error { | ||
| return s.store.DeleteSnapshot(snapshotID) | ||
| } |
Comment on lines
102
to
+106
| description: The backup could not be created. | ||
| /system/sqlite3/backups: | ||
| get: | ||
| tags: | ||
| - system |
chris124567
approved these changes
Jun 26, 2026
chris124567
left a comment
Member
There was a problem hiding this comment.
LGTM except for what Copilot said about NewAdmin docstring
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.
This PR adds a backup command to create/list/delete snapshots.
Small example of the usage:
References #202