From d48851738332de346fce7c4850c7f9c2b15a2591 Mon Sep 17 00:00:00 2001 From: Jean-Hadrien Chabran Date: Wed, 8 May 2024 00:04:59 +0200 Subject: [PATCH] chore(rel): bump minor for stitch graph + add support invalidating migrations repo rule (#62511) chore(rel): bump minor for stitch graph + add support invalidating migrations repo rule (#62490) * chore(bzl): allow to invalidate migrations repo rule * chore(bzl): gen stitch graph for 5.4 --- WORKSPACE | 1 + dev/schema_migrations.bzl | 11 +++++++++ .../shared/data/cmd/generator/consts.go | 2 +- .../shared/data/stitched-migration-graph.json | 23 +++++++++++++++++++ 4 files changed, 36 insertions(+), 1 deletion(-) diff --git a/WORKSPACE b/WORKSPACE index e82d5c95e21..bce8d2647c4 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -502,6 +502,7 @@ load("//dev:schema_migrations.bzl", "schema_migrations") schema_migrations( name = "schemas_migrations", + updated_at = "2024-05-07 14:39", ) # wolfi images setup ================================ diff --git a/dev/schema_migrations.bzl b/dev/schema_migrations.bzl index eda815af391..9e2fda940f2 100644 --- a/dev/schema_migrations.bzl +++ b/dev/schema_migrations.bzl @@ -1,3 +1,11 @@ +""" +Provide a custom repository_rule to fetch database migrations from previous versions from +a GCS bucket. + +The "updated_at" attribute allows to manually invalidate the cache, because the rule itself +cannot know when to do so, as it will simply skip listing the bucket otherwise. +""" + def _schema_migrations(rctx): """ This repository is used to download the schema migrations from GCS. @@ -54,4 +62,7 @@ filegroup( schema_migrations = repository_rule( implementation = _schema_migrations, + attrs = { + "updated_at": attr.string(mandatory = True), + }, ) diff --git a/internal/database/migration/shared/data/cmd/generator/consts.go b/internal/database/migration/shared/data/cmd/generator/consts.go index 4c5b845a97e..318938e265d 100644 --- a/internal/database/migration/shared/data/cmd/generator/consts.go +++ b/internal/database/migration/shared/data/cmd/generator/consts.go @@ -10,7 +10,7 @@ import ( // NOTE: This should be kept up-to-date with the upcoming version to be released, and bumped after. // fallback schemas everything we support migrating to. The release tool automates this upgrade, so don't touch this :) // This should be the last minor version since patch releases only happen in the release branch. -const maxVersionString = "5.3.0" +const maxVersionString = "5.4.0" // MaxVersion is the highest known released version at the time the migrator was built. var MaxVersion = func() oobmigration.Version { diff --git a/internal/database/migration/shared/data/stitched-migration-graph.json b/internal/database/migration/shared/data/stitched-migration-graph.json index 076e69dee64..b6e33e0eebf 100644 --- a/internal/database/migration/shared/data/stitched-migration-graph.json +++ b/internal/database/migration/shared/data/stitched-migration-graph.json @@ -926,6 +926,13 @@ 1679051112 ], "PreCreation": false + }, + "v5.4.0": { + "RootID": 1000000027, + "LeafIDs": [ + 1679051112 + ], + "PreCreation": false } } }, @@ -1895,6 +1902,13 @@ 1686315964 ], "PreCreation": false + }, + "v5.4.0": { + "RootID": 1000000033, + "LeafIDs": [ + 1686315964 + ], + "PreCreation": false } } }, @@ -11456,6 +11470,15 @@ "PreCreation": false }, "v5.3.0": { + "RootID": 1648051770, + "LeafIDs": [ + 1709738515, + 1711003437, + 1711538234 + ], + "PreCreation": false + }, + "v5.4.0": { "RootID": 1648051770, "LeafIDs": [ 1713958707