feat: add unified data migrations for dashboard and folders (#113853)

This commit is contained in:
Mustafa Sencer Özcan
2025-11-19 09:09:08 +01:00
committed by GitHub
parent 92bee5e510
commit 0d4ad01b65
8 changed files with 385 additions and 17 deletions
@@ -34,9 +34,8 @@ type MigrateOptions struct {
LargeObjects apistore.LargeObjectSupport
BlobStore resourcepb.BlobStoreClient
Resources []schema.GroupResource
WithHistory bool // only applies to dashboards
OnlyCount bool // just count the values
StackID string // stack identifier for logging
WithHistory bool // only applies to dashboards
OnlyCount bool // just count the values
Progress func(count int, msg string)
}
@@ -140,7 +139,6 @@ func (a *dashboardSqlAccess) Migrate(ctx context.Context, opts MigrateOptions) (
// Now run each migration
blobStore := BlobStoreInfo{}
opts.StackID = fmt.Sprintf("%d", info.StackID) // Pass stack ID through options
a.log.Info("start migrating legacy resources", "namespace", opts.Namespace, "orgId", info.OrgID, "stackId", info.StackID)
for _, m := range migratorFuncs {
blobs, err := m(ctx, info.OrgID, opts, stream)
@@ -318,7 +316,6 @@ func (a *dashboardSqlAccess) migrateDashboards(ctx context.Context, orgId int64,
"uid", row.Dash.UID,
"id", id,
"version", row.Dash.Generation,
"stackId", opts.StackID,
)
opts.Progress(-2, fmt.Sprintf("rejected: id:%s, uid:%s", id, row.Dash.Name))
}