Skip to content

Add a function to lock OSM chunk's dimension slice #27219

Add a function to lock OSM chunk's dimension slice

Add a function to lock OSM chunk's dimension slice #27219

Workflow file for this run

# Test our extension sql scripts are following security best practices
name: pgspot
"on":
pull_request:
push:
branches:
- main
- ?.*.x
jobs:
check_paths:
runs-on: ubuntu-latest
outputs:
run_ci: >-
${{ github.event_name == 'push'
|| (steps.filter.outputs.sql == 'true' && !contains(github.event.pull_request.labels.*.name, 'skip-ci'))
}}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
id: filter
with:
filters: .github/filters.yaml
pgspot:
needs: check_paths
if: needs.check_paths.outputs.run_ci == 'true'
runs-on: ubuntu-latest
env:
# policy_compression and policy_compression_execute do not have explicit search_path
# because postgres does not allow it for procedures doing transaction control
PGSPOT_OPTS: --ignore PS002
--proc-without-search-path '_timescaledb_internal.policy_compression(job_id integer,config jsonb)'
--proc-without-search-path '_timescaledb_functions.policy_compression(job_id integer,config jsonb)'
--proc-without-search-path '_timescaledb_functions.policy_compression_execute(job_id integer,htid integer,lag anyelement,maxchunks integer,verbose_log boolean,recompress_enabled boolean,reindex_enabled boolean,use_creation_time boolean)'
steps:
- name: Setup python 3.13
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.13'
- name: Checkout timescaledb
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install pgspot
run: |
python -m pip install pgspot==0.9.2
- name: Build timescaledb sqlfiles
run: |
previous_version=$(grep '^previous_version = ' version.config | sed -e 's!^[^=]\+ = !!')
git fetch --tags
./bootstrap -DGENERATE_DOWNGRADE_SCRIPT=ON
# version.config in 2.27.0 tag is incorrect and will produce wrong sql files
if [ "${previous_version}" == "2.27.0" ]; then
git checkout 2.27.0-p0
else
git checkout ${previous_version}
fi
make -C build sqlfile sqlupdatescripts
git checkout ${GITHUB_SHA}
make -C build sqlfile sqlupdatescripts
ls -la build/sql/timescaledb--*.sql
- name: Run pgspot
run: |
version=$(grep '^version = ' version.config | sed -e 's!^[^=]\+ = !!')
previous_version=$(grep '^previous_version = ' version.config | sed -e 's!^[^=]\+ = !!')
# Show files used
ls -la build/sql/timescaledb--${version}.sql build/sql/timescaledb--${previous_version}--${version}.sql \
build/sql/timescaledb--${version}--${previous_version}.sql
# The next pgspot execution tests the installation script by itself
pgspot ${{ env.PGSPOT_OPTS }} build/sql/timescaledb--${version}.sql
# The next pgspot execution tests the update script to the latest version
# we prepend the installation script here so pgspot can correctly keep track of created objects
pgspot ${{ env.PGSPOT_OPTS }} -a build/sql/timescaledb--${previous_version}.sql \
build/sql/timescaledb--${previous_version}--${version}.sql
# The next pgspot execution tests the downgrade script to the previous version
# we prepend the installation script here so pgspot can correctly keep track of created objects
pgspot ${{ env.PGSPOT_OPTS }} -a build/sql/timescaledb--${version}.sql \
build/sql/timescaledb--${version}--${previous_version}.sql