From 61cb3084e05bbd3928996157e66b78f975ae3f6a Mon Sep 17 00:00:00 2001 From: Andrew Farries Date: Wed, 10 Jan 2024 13:27:38 +0000 Subject: [PATCH 1/3] Lowecase job name for consistency --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bda86b15..e1ba06c4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -58,7 +58,7 @@ jobs: done license-check: - name: License check + name: license check runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 From 77b27e4f2f677009e6f65df7c3533ce239a23075 Mon Sep 17 00:00:00 2001 From: Andrew Farries Date: Wed, 10 Jan 2024 13:34:29 +0000 Subject: [PATCH 2/3] Add a CI job to ensure generated types are updated Ensure that type generation from `schema.json` is up-to-date. * Check out the repo * Run `make generate` * Ensure that there is no diff --- .github/workflows/build.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e1ba06c4..57b15626 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -57,6 +57,24 @@ jobs: fi done + type-generation: + name: type generation + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Generate types + run: | + make generate + + - name: Ensure generated types are up-to-date + run: | + if ! git diff --quiet; then + echo "generated types are out of date!" + echo "run 'make generate' to regenerate type definitions" + exit 1 + fi + license-check: name: license check runs-on: ubuntu-latest @@ -106,7 +124,7 @@ jobs: release: runs-on: ubuntu-latest - needs: [test, lint, examples, license-check] + needs: [test, lint, examples, license-check, type-generation] if: startsWith(github.ref, 'refs/tags/') env: DOCKER_CLI_EXPERIMENTAL: "enabled" From cceacb077836128aee3acddb39ac749d0356dd11 Mon Sep 17 00:00:00 2001 From: Andrew Farries Date: Wed, 10 Jan 2024 13:38:36 +0000 Subject: [PATCH 3/3] Run `make generate` --- pkg/migrations/types.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/migrations/types.go b/pkg/migrations/types.go index 106d45a1..4d4214ea 100644 --- a/pkg/migrations/types.go +++ b/pkg/migrations/types.go @@ -192,9 +192,13 @@ type PgRollMigration struct { Name string `json:"name"` // Operations corresponds to the JSON schema field "operations". - Operations []interface{} `json:"operations"` + Operations PgRollOperations `json:"operations"` } +type PgRollOperation interface{} + +type PgRollOperations []interface{} + // Replica identity definition type ReplicaIdentity struct { // Name of the index to use as replica identity