From 817f592586549a623ae19ead594f95c7e7f6ea4c Mon Sep 17 00:00:00 2001 From: Alex Strick van Linschoten Date: Thu, 31 Aug 2023 09:51:13 +0200 Subject: [PATCH 1/2] add script to check branch divergence --- scripts/check-alembic-branches.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 scripts/check-alembic-branches.sh diff --git a/scripts/check-alembic-branches.sh b/scripts/check-alembic-branches.sh new file mode 100755 index 00000000000..a409831e21a --- /dev/null +++ b/scripts/check-alembic-branches.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# Run the alembic branches command and capture the output +output=$(alembic branches) + +# Check if there's any output +if [[ -n "$output" ]]; then + echo "Warning: Diverging Alembic branches detected." + exit 1 # Exit with failure status +else + echo "No diverging Alembic branches detected." + exit 0 # Exit with success status +fi From ab4f6cf4c6cbafae39f950acd2903cd0ca9f3115 Mon Sep 17 00:00:00 2001 From: Alex Strick van Linschoten Date: Thu, 31 Aug 2023 09:56:44 +0200 Subject: [PATCH 2/2] add alembic divergence check to CI --- .github/workflows/lint-unit-test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/lint-unit-test.yml b/.github/workflows/lint-unit-test.yml index bdcd50e9b07..ceb55ea0df1 100644 --- a/.github/workflows/lint-unit-test.yml +++ b/.github/workflows/lint-unit-test.yml @@ -111,6 +111,10 @@ jobs: # Only run the markdown link check on ubuntu-latest and python 3.8 if: ${{ inputs.os == 'ubuntu-latest' && inputs.python-version == '3.8' }} + - name: Check for alembic branch divergence + run: | + bash scripts/check-alembic-branches.sh + - name: Run unit tests run: | bash scripts/test-coverage-xml.sh unit