CloudMigrations: Bulk update local resources (#96002)

* wip

* make tests pass

* get all tests passing

* fixes

* some small cleanup

* fix test

* convert delimiter keys to struct keys

* dont execute empty sql statement

* remove printlns

* fix unit test

* a bit more cleanup

* whoops
This commit is contained in:
Michael Mandrus
2025-01-10 14:42:18 -05:00
committed by GitHub
parent 99a0eb825d
commit c9d22f06c3
9 changed files with 139 additions and 63 deletions
+10 -5
View File
@@ -67,7 +67,7 @@ const (
type CloudMigrationResource struct {
ID int64 `xorm:"pk autoincr 'id'"`
UID string `xorm:"uid"`
UID string `xorm:"uid" json:"uid"`
Name string `xorm:"name" json:"name"`
Type MigrateDataType `xorm:"resource_type" json:"type"`
@@ -98,9 +98,10 @@ const (
type ItemStatus string
const (
ItemStatusOK ItemStatus = "OK"
ItemStatusWarning ItemStatus = "WARNING"
ItemStatusError ItemStatus = "ERROR"
// Returned by GMS
ItemStatusOK ItemStatus = "OK"
ItemStatusError ItemStatus = "ERROR"
// Used by default while awaiting GMS results
ItemStatusPending ItemStatus = "PENDING"
)
@@ -180,7 +181,11 @@ type UpdateSnapshotCmd struct {
UID string
SessionID string
Status SnapshotStatus
Resources []CloudMigrationResource
// LocalResourcesToCreate represents the local state of a resource before it has been uploaded to GMS
LocalResourcesToCreate []CloudMigrationResource
// CloudResourcesToUpdate represents resource state from GMS, to be merged with the local state
CloudResourcesToUpdate []CloudMigrationResource
}
// access token