Skip to content

Backport to 2.29.x: #10386: Add missing permission checks to internal chunk functions #38356

Backport to 2.29.x: #10386: Add missing permission checks to internal chunk functions

Backport to 2.29.x: #10386: Add missing permission checks to internal chunk functions #38356

Workflow file for this run

name: Update and Downgrade
"on":
push:
branches:
- main
- ?.*.x
- prerelease_test
pull_request:
workflow_dispatch:
jobs:
check_paths:
runs-on: ubuntu-latest
outputs:
run_ci: >-
${{ github.event_name == 'push'
|| (steps.filter.outputs.src == 'true' && !contains(github.event.pull_request.labels.*.name, 'skip-ci'))
}}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
id: filter
with:
filters: .github/filters.yaml
update_test:
needs: check_paths
if: needs.check_paths.outputs.run_ci == 'true'
name: Update test PG${{ matrix.pg }} ${{ matrix.mode }}
runs-on: 'ubuntu-latest'
strategy:
matrix:
pg: [16, 17, 18]
mode: [direct, singlestep]
fail-fast: false
env:
PG_VERSION: ${{ matrix.pg }}
POSTGRES_HOST_AUTH_METHOD: trust
steps:
- name: Checkout TimescaleDB
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Install Linux Dependencies
timeout-minutes: 15
run: |
sudo apt-get update
sudo apt-get install gnupg systemd-coredump gdb postgresql-common libkrb5-dev
yes | sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh
echo "deb https://packagecloud.io/timescale/timescaledb/ubuntu/ $(lsb_release -c -s) main" | sudo tee /etc/apt/sources.list.d/timescaledb.list
wget --quiet --tries=6 --waitretry=15 -O - https://packagecloud.io/timescale/timescaledb/gpgkey | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-${{ matrix.pg }} postgresql-server-dev-${{ matrix.pg }}
# The unversioned timescaledb-2-postgresql package only ships update
# scripts that jump straight to the latest version. Install every
# versioned package instead so the extension directory also has the
# consecutive update scripts the singlestep update test needs.
ts_packages=$(apt-cache search --names-only '^timescaledb-2-[0-9].*-postgresql-${{ matrix.pg }}$' | awk '{ print $1 }')
sudo apt-get install -y --no-install-recommends -o Dpkg::Options::="--force-overwrite" ${ts_packages}
git fetch --tags
- name: Update tests PG${{ matrix.pg }} ${{ matrix.mode }}
run: |
PATH="/usr/lib/postgresql/${{ matrix.pg }}/bin:$PATH"
UPDATE_MODE=${{ matrix.mode }} ./scripts/test_updates.sh
- name: Downgrade tests PG${{ matrix.pg }}
if: always() && matrix.mode == 'direct'
run: |
PATH="/usr/lib/postgresql/${{ matrix.pg }}/bin:$PATH"
./scripts/test_downgrade.sh
- name: Update diff
if: failure()
run: |
find update_test -name "*.diff" -print0 | xargs -0 -IFILE sh -c "echo '\nFILE\n';cat FILE"
- name: Postgres Errors
if: failure()
run: |
find update_test -name postgres.log -exec grep ERROR {} \;
- name: Check for coredumps
if: failure()
id: collectlogs
run: |
# wait for in progress coredumps
sleep 10
if coredumpctl list; then
echo "coredumps=true" >>$GITHUB_OUTPUT
false
fi
- name: Stack trace
if: always() && steps.collectlogs.outputs.coredumps == 'true'
run: |
sudo coredumpctl gdb <<<"
set verbose on
set trace-commands on
show debug-file-directory
printf "'"'"query = '%s'\n\n"'"'", (char *) debug_query_string
frame function ExceptionalCondition
printf "'"'"condition = '%s'\n"'"'", (char *) conditionName
up 1
l
info args
info locals
bt full
" 2>&1 | tee stacktrace.log
./scripts/bundle_coredumps.sh
false
- name: Upload Coredumps
if: always() && steps.collectlogs.outputs.coredumps == 'true'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: Coredumps update-test PG${{ matrix.pg }} ${{ matrix.mode }}
path: coredumps
- name: Upload Artifacts
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: Update test PG${{ matrix.pg }} ${{ matrix.mode }}
path: update_test
report_status:
name: Update and Downgrade summary
needs: [check_paths, update_test]
if: always()
runs-on: timescaledb-runner-arm64
steps:
- run: |
# If the detector failed, or the matrix failed, exit with error
if [[ "${{ needs.update_test.result }}" == "failure" ]]; then
exit 1
fi
echo "All checks passed or were safely skipped."