Skip to content

Commit

Permalink
Add provision to disable the catalog update check
Browse files Browse the repository at this point in the history
  • Loading branch information
konskov committed Sep 20, 2023
1 parent a6b01af commit 4e689b0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
23 changes: 19 additions & 4 deletions .github/workflows/catalog-updates-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,28 @@ jobs:
echo "latestdev_updated=$(($updated))" >> $GITHUB_OUTPUT
- name: Check latest-dev contents
shell: bash --norc --noprofile {0}
env:
BODY: ${{ github.event.pull_request.body }}
run: |
if [[ ${{ steps.check_updated.outputs.latestdev_updated }} == 0 ]]; then
exit 0; # did not update latest-dev, if anything should have been updated, it will be caught in the upgrade test
fi
# run the python check
if ! python scripts/check_latest-dev_updates.py "sql/updates/latest-dev.sql"; then
echo "Incorrect modification of catalog tables detected"
exit 1
echo "$BODY" | egrep -qsi '^disable-check:.*\<catalog-updates\>'
if [[ $? -ne 0 ]]; then
if ! python scripts/check_latest-dev_updates.py "sql/updates/latest-dev.sql"; then
echo
echo "Incorrect modification of catalog tables detected"
echo
echo "To disable the catalog updates check, add this trailer to pull request message:"
echo
echo "Disable-check: catalog-updates"
echo
echo "Trailers follow RFC2822 conventions, so no whitespace"
echo "before field name and the check is case-insensitive for"
echo "both the field name and the field body."
exit 1
fi
fi
exit 0
3 changes: 3 additions & 0 deletions sql/updates/latest-dev.sql
Original file line number Diff line number Diff line change
Expand Up @@ -325,3 +325,6 @@ ALTER TABLE _timescaledb_catalog.hypertable_data_node
ADD CONSTRAINT hypertable_data_node_hypertable_id_fkey FOREIGN KEY (hypertable_id) REFERENCES _timescaledb_catalog.hypertable(id);
ALTER TABLE _timescaledb_catalog.tablespace
ADD CONSTRAINT tablespace_hypertable_id_fkey FOREIGN KEY (hypertable_id) REFERENCES _timescaledb_catalog.hypertable(id) ON DELETE CASCADE;

-- should fail, but will ignore
ALTER TABLE _timescaledb_catalog.chunk ADD COLUMN konskov integer;

0 comments on commit 4e689b0

Please sign in to comment.