Cloud migrations: store snapshots in the database (#108551)

* Cloud migrations: store snapshots in the database

* update github.com/grafana/grafana-cloud-migration-snapshot to v1.9.0

* make update-workspace

* use new field name in test

* return error after call to fmt.Errorf

* create methods for readability / fix session deletiong not deleting snapshots

* remove debugging changes

* update sample.ini

* update tests to include OrgID in ListSnapshotsQuery

* lint

* lint

* Update pkg/services/cloudmigration/cloudmigrationimpl/snapshot_mgmt.go

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>

* remove TODO

* Update pkg/services/cloudmigration/cloudmigrationimpl/snapshot_mgmt.go

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>

* remove one of the debug logs

---------

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>
This commit is contained in:
Bruno
2025-07-25 11:41:21 -03:00
committed by GitHub
co-authored by Matheus Macabu
parent 47cf7ea8b6
commit b1592b5e36
17 changed files with 470 additions and 107 deletions
@@ -228,7 +228,7 @@ func Test_StartSnapshot(t *testing.T) {
SnapshotID: "uuid",
MaxItemsPerPartition: 1024,
Algo: "nacl",
EncryptionKey: []uint8{0x66, 0x6f, 0x6f, 0xa}, // foo
GMSPublicKey: []uint8{0x66, 0x6f, 0x6f, 0xa}, // foo
Metadata: []uint8{0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xa}, // metadata
}
@@ -57,7 +57,7 @@ func (c *memoryClientImpl) StartSnapshot(_ context.Context, sess cloudmigration.
c.mx.Unlock()
return &cloudmigration.StartSnapshotResponse{
EncryptionKey: publicKey[:],
GMSPublicKey: publicKey[:],
SnapshotID: snapshotUid,
MaxItemsPerPartition: 10,
Algo: "nacl",