Message-ID: From: "vlsi (@vlsi)" To: "pgjdbc/pgjdbc" Date: Tue, 02 Jun 2026 06:21:42 +0000 Subject: [pgjdbc/pgjdbc] PR #4128: Update GitHub Actions and restore CI on release/42.5.x List-Id: X-GitHub-Additions: 49 X-GitHub-Author-Id: 213894 X-GitHub-Author-Login: vlsi X-GitHub-Base: release/42.5.x X-GitHub-Changed-Files: 13 X-GitHub-Commits: 8 X-GitHub-Deletions: 44 X-GitHub-Head-Branch: codex/update-actions-42.5 X-GitHub-Head-SHA: 9b19a6a34f7ec9f0af0895ddacfe85605023b3b7 X-GitHub-Issue: 4128 X-GitHub-Labels: chore X-GitHub-Merge-SHA: 30ea40dd7013874815eeb9cd103a0c334674e488 X-GitHub-Merged-By: vlsi X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-State: merged X-GitHub-Type: pull_request X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/pull/4128 Content-Type: text/plain; charset=utf-8 ## Why CI on `release/42.5.x` was fully red, and the actions maintenance alone did not fix it. jcenter's shutdown broke the Gradle plugin classpath; the source-distribution job pulled PostgreSQL 18 (via the Docker `latest` tag) and hit the removed `RULE` privilege; and ubuntu-24.04 runners dropped `postgresql-12`, which the GSS jobs install. ## What GitHub Actions maintenance, adapted from `release/42.6.x`: - update `actions/checkout` to v4 - update Gradle wrapper validation to `gradle/actions/wrapper-validation@v4` - switch workflow Docker Compose invocations to v2 (`docker compose`) - remove PostgreSQL 8.4 and 9.0 from the workflow matrices - remove the self-hosted runner from the CI matrix Fixes that bring CI back to green on `release/42.5.x`: - **build**: bump `vlsi-release-plugins` 1.82 → 1.83. 1.82 pulls `org.ajoberstar.grgit:grgit-core:4.0.1`, which vanished with jcenter, so Gradle could not resolve the plugin classpath and every job failed before any task ran. 1.83 uses grgit 4.1.1 from Maven Central. - **fix(jdbc)**: request the `RULE` privilege only below PostgreSQL 18. PG 18 removed it, so `has_table_privilege` rejected the `getTables` query when `hideUnprivilegedObjects` is enabled. Backported from master (74d8c239d, d98b56bec). - **ci**: install the default `postgresql` package and point the GSS harness at `/usr/lib/postgresql/16/bin`. ubuntu-24.04 runners no longer ship `postgresql-12`. ## How to verify - CI is green (13/13). - Locally on JDK 11, as in CI: `autostyleCheck checkstyleAll jandex`, `--no-parallel --no-daemon -PenableCheckerframework classes`, and `sourceDistribution -Prelease` all pass. - `DatabaseMetaDataHideUnprivilegedObjectsTest` passes against PostgreSQL 18.4 started via Docker, confirming the `RULE` fix. ## Notes History follows Conventional Commits: the original actions change is split into five focused `ci:` commits, plus `build:`, `fix(jdbc):`, and a final `ci:` commit. diff --git a/.github/workflows/buildcache.yml b/.github/workflows/buildcache.yml index 7d4fee8db9..683d9806e6 100644 --- a/.github/workflows/buildcache.yml +++ b/.github/workflows/buildcache.yml @@ -48,7 +48,7 @@ jobs: name: '${{ matrix.os }}, ${{ matrix.jdk }} seed build cache' runs-on: ${{ matrix.os }}-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 50 - name: 'Set up JDK ${{ matrix.jdk }}' diff --git a/.github/workflows/debezium.yml b/.github/workflows/debezium.yml index 6e8cced75b..86b9dbfaa5 100644 --- a/.github/workflows/debezium.yml +++ b/.github/workflows/debezium.yml @@ -16,7 +16,7 @@ jobs: ACTIONS_STEP_DEBUG: true ACTIONS_RUNNER_DEBUG: true steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 50 - name: 'Set up JDK 11' diff --git a/.github/workflows/fedora-copr-build.yml b/.github/workflows/fedora-copr-build.yml index 916c884d6b..5b4fb55366 100644 --- a/.github/workflows/fedora-copr-build.yml +++ b/.github/workflows/fedora-copr-build.yml @@ -16,7 +16,7 @@ jobs: steps: - name: Check out proper version of sources - uses: actions/checkout@v1 + uses: actions/checkout@v4 - name: Submit the build env: diff --git a/.github/workflows/gradle-wrapper-validation.yml b/.github/workflows/gradle-wrapper-validation.yml index c80a7e5278..757c8d8781 100644 --- a/.github/workflows/gradle-wrapper-validation.yml +++ b/.github/workflows/gradle-wrapper-validation.yml @@ -9,5 +9,5 @@ jobs: name: "Validation" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: gradle/wrapper-validation-action@v1 + - uses: actions/checkout@v4 + - uses: gradle/actions/wrapper-validation@v4 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8d1579aa53..a93f71cc6b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -41,7 +41,7 @@ jobs: ACTIONS_STEP_DEBUG: true ACTIONS_RUNNER_DEBUG: true steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 50 - name: 'Set up JDK 8' @@ -62,7 +62,7 @@ jobs: name: 'CheckerFramework' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 50 - name: 'Set up JDK 11' @@ -84,12 +84,12 @@ jobs: name: 'Source distribution (JDK 11)' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 50 - name: Start PostgreSQL working-directory: docker/postgres-server - run: docker-compose up -d && docker-compose logs + run: docker compose up -d && docker compose logs - name: 'Set up JDK 11' uses: actions/setup-java@v3 with: @@ -118,7 +118,7 @@ jobs: env: MATRIX_JOBS: 7 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 50 - id: set-matrix @@ -137,7 +137,7 @@ jobs: ACTIONS_RUNNER_DEBUG: true TZ: ${{ matrix.tz }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 50 - name: Start PostgreSQL PGV=${{ matrix.pg_version }} TZ=${{ matrix.server_tz }} XA=${{ matrix.xa }} SSL=${{ matrix.ssl }} SCRAM=${{ matrix.scram }} CREATE_REPLICAS=${{ matrix.replication }} @@ -151,12 +151,12 @@ jobs: CREATE_REPLICAS: ${{ matrix.replication }} # The below run command is long, however, it is intentional, and it makes the output nicer in GitHub UI run: | - echo 'Starting PostgreSQL via docker-compose down; PGV=${{ matrix.pg_version }} TZ=${{ matrix.server_tz }} XA=${{ matrix.xa }} SSL=${{ matrix.ssl }} SCRAM=${{ matrix.scram }} CREATE_REPLICAS=${{ matrix.replication }} docker-compose up' + echo 'Starting PostgreSQL via docker compose down; PGV=${{ matrix.pg_version }} TZ=${{ matrix.server_tz }} XA=${{ matrix.xa }} SSL=${{ matrix.ssl }} SCRAM=${{ matrix.scram }} CREATE_REPLICAS=${{ matrix.replication }} docker compose up' - docker-compose down -v --rmi local || true + docker compose down -v --rmi local || true sed -i -r '/- (543[3-4]):\1/d' docker-compose.yml - docker-compose up -d - docker-compose logs + docker compose up -d + docker compose logs - name: 'Get test node ARCH' run: echo "arch_name=$(uname -i)" >> $GITHUB_OUTPUT id: get_arch_name @@ -201,7 +201,7 @@ jobs: if: ${{ matrix.gss == 'yes' }} run: | sudo apt -y update - sudo apt -y install krb5-kdc krb5-admin-server libkrb5-dev postgresql-12 + sudo apt -y install krb5-kdc krb5-admin-server libkrb5-dev postgresql - name: 'Update hosts for GSS tests' if: ${{ matrix.gss == 'yes' }} run: | @@ -238,5 +238,5 @@ jobs: if: ${{ always() }} working-directory: docker/postgres-server run: | - docker-compose ps - docker-compose down -v --rmi local + docker compose ps + docker compose down -v --rmi local diff --git a/.github/workflows/matrix.js b/.github/workflows/matrix.js index 5974e5b52c..bfb9b91598 100644 --- a/.github/workflows/matrix.js +++ b/.github/workflows/matrix.js @@ -46,8 +46,6 @@ matrix.addAxis({ title: x => 'PG ' + x, // Strings allow versions like 18-ea values: [ - '8.4', - '9.0', '9.1', '9.2', '9.3', @@ -90,7 +88,6 @@ matrix.addAxis({ // We use docker-compose for launching PostgreSQL // 'windows-latest', // 'macos-latest', - ...(process.env.GITHUB_REPOSITORY === 'pgjdbc/pgjdbc' ? ['self-hosted'] : []) ] }); @@ -203,14 +200,9 @@ matrix.exclude(row => row.scram.value === 'yes' && isLessThan(row.pg_version, '1 matrix.exclude(row => row.replication.value === 'yes' && isLessThan(row.pg_version, '9.6')); //org.postgresql.test.jdbc2.ArrayTest fails using simple mode for versions less than 9.0 with malformed Array literal matrix.exclude( row => row.query_mode.value == 'simple' && isLessThan(row.pg_version, '9.1')); -//matrix.exclude({query_mode: {value: 'simple'}, pg_version: '8.4'}); // Microsoft Java has no distribution for 8 matrix.exclude({java_distribution: 'microsoft', java_version: '8'}); -matrix.exclude({gss: {value: 'yes'}, os: ['windows-latest', 'macos-latest', 'self-hosted']}) -if (process.env.GITHUB_REPOSITORY === 'pgjdbc/pgjdbc') { - // PG images below 9.3 are x86_64 only - matrix.exclude(row => row.os === 'self-hosted' && isLessThan(row.pg_version, '9.3')); -} +matrix.exclude({gss: {value: 'yes'}, os: ['windows-latest', 'macos-latest']}) // The most rare features should be generated the first // For instance, we have a lot of PostgreSQL versions, so we generate the minimal the first @@ -231,9 +223,6 @@ matrix.generateRow({ssl: {value: 'yes'}}); // Ensure at least one Windows and at least one Linux job is present (macOS is almost the same as Linux) // matrix.generateRow({os: 'windows-latest'}); matrix.generateRow({os: 'ubuntu-latest'}); -if (process.env.GITHUB_REPOSITORY === 'pgjdbc/pgjdbc') { - matrix.generateRow({os: 'self-hosted'}); -} const include = matrix.generateRows(process.env.MATRIX_JOBS || 5); if (include.length === 0) { throw new Error('Matrix list is empty'); diff --git a/.github/workflows/nightlysnapshot.yml b/.github/workflows/nightlysnapshot.yml index 89bf8f2a46..7b58912939 100644 --- a/.github/workflows/nightlysnapshot.yml +++ b/.github/workflows/nightlysnapshot.yml @@ -37,7 +37,7 @@ jobs: ACTIONS_STEP_DEBUG: true ACTIONS_RUNNER_DEBUG: true steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 50 - name: 'Set up JDK 8' diff --git a/.github/workflows/omni.yml b/.github/workflows/omni.yml index 31e78be203..a817ae56d9 100644 --- a/.github/workflows/omni.yml +++ b/.github/workflows/omni.yml @@ -13,7 +13,7 @@ on: required: false default: "*" matrix_pg_version: - description: PostgreSQL Server Version (8.4, 9.0, 9.1, ...) + description: PostgreSQL Server Version (9.1, 9.2, ...) required: false default: "*" matrix_query_mode: @@ -80,8 +80,6 @@ jobs: ]; const PG_VERSIONS = [ - '8.4', - '9.0', '9.1', '9.2', '9.3', @@ -293,13 +291,13 @@ jobs: env: MATRIX_JSON: ${{ toJSON(matrix) }} run: echo "${MATRIX_JSON}" - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 50 - name: Start PostgreSQL working-directory: docker/postgres-server - run: docker-compose up -d && docker-compose logs + run: docker compose up -d && docker compose logs env: PGV: ${{ matrix.pg_version }} @@ -340,7 +338,7 @@ jobs: # Server is not online so dump some logs for debugging docker ps cd docker/postgres-server - docker-compose logs + docker compose logs fi psql -c 'SELECT version()' @@ -373,12 +371,12 @@ jobs: runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 50 - name: Compile and start PostgreSQL working-directory: docker/postgres-head - run: docker-compose up -d && docker-compose logs + run: docker compose up -d && docker compose logs - name: Set up JDK uses: actions/setup-java@v3 with: @@ -398,7 +396,7 @@ jobs: # Server is not online so dump some logs for debugging docker ps cd docker/postgres-head - docker-compose logs + docker compose logs fi psql -c 'SELECT version()' - name: Prepare local properties diff --git a/gradle.properties b/gradle.properties index e29a893ee0..b6a8df0274 100644 --- a/gradle.properties +++ b/gradle.properties @@ -34,7 +34,7 @@ com.github.burrunan.s3-build-cache.version=1.1 com.github.johnrengelman.shadow.version=5.1.0 com.github.lburgazzoli.karaf.version=0.5.4 com.github.spotbugs.version=2.0.0 -com.github.vlsi.vlsi-release-plugins.version=1.82 +com.github.vlsi.vlsi-release-plugins.version=1.83 de.thetaphi.forbiddenapis.version=3.3 kotlin.version=1.3.70 me.champeau.jmh.version=0.6.6 diff --git a/pgjdbc/src/main/java/org/postgresql/core/ServerVersion.java b/pgjdbc/src/main/java/org/postgresql/core/ServerVersion.java index b06e8c7dd2..10e710ccd8 100644 --- a/pgjdbc/src/main/java/org/postgresql/core/ServerVersion.java +++ b/pgjdbc/src/main/java/org/postgresql/core/ServerVersion.java @@ -32,7 +32,9 @@ public enum ServerVersion implements Version { v13("13"), v14("14"), v15("15"), - v16("16") + v16("16"), + v17("17"), + v18("18") ; private final int version; @@ -51,6 +53,11 @@ public int getVersionNum() { return version; } + @Override + public int getMajorVersionNumber() { + return version / 10000; + } + /** *

Attempt to parse the server version string into an XXYYZZ form version number into a * {@link Version}.

@@ -68,6 +75,11 @@ public int getVersionNum() { return versionNum; } + @Override + public int getMajorVersionNumber() { + return versionNum / 10000; + } + @Override public boolean equals(@Nullable Object obj) { if (obj instanceof Version) { diff --git a/pgjdbc/src/main/java/org/postgresql/core/Version.java b/pgjdbc/src/main/java/org/postgresql/core/Version.java index 639226a172..d192531633 100644 --- a/pgjdbc/src/main/java/org/postgresql/core/Version.java +++ b/pgjdbc/src/main/java/org/postgresql/core/Version.java @@ -14,4 +14,5 @@ public interface Version { */ int getVersionNum(); + int getMajorVersionNumber(); } diff --git a/pgjdbc/src/main/java/org/postgresql/jdbc/PgDatabaseMetaData.java b/pgjdbc/src/main/java/org/postgresql/jdbc/PgDatabaseMetaData.java index 3588f464c9..485032bac0 100644 --- a/pgjdbc/src/main/java/org/postgresql/jdbc/PgDatabaseMetaData.java +++ b/pgjdbc/src/main/java/org/postgresql/jdbc/PgDatabaseMetaData.java @@ -1318,8 +1318,13 @@ public ResultSet getTables(@Nullable String catalog, @Nullable String schemaPatt select += " AND n.nspname LIKE " + escapeQuotes(schemaPattern); } if (connection.getHideUnprivilegedObjects()) { + // as of https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=fefa76f70fdc75c91f80bddce2df7a8825205962 + // The RULE privilege has been removed + String privileges = connection.getServerMajorVersion() < ServerVersion.v18.getMajorVersionNumber() + ? " 'SELECT, INSERT, UPDATE, DELETE, RULE, REFERENCES, TRIGGER')" + : " 'SELECT, INSERT, UPDATE, DELETE, REFERENCES, TRIGGER')"; select += " AND has_table_privilege(c.oid, " - + " 'SELECT, INSERT, UPDATE, DELETE, RULE, REFERENCES, TRIGGER')"; + + privileges; } orderby = " ORDER BY TABLE_TYPE,TABLE_SCHEM,TABLE_NAME "; diff --git a/test-gss/src/main/groovy/TestPostgres.groovy b/test-gss/src/main/groovy/TestPostgres.groovy index e3d01740c3..c721d469e8 100644 --- a/test-gss/src/main/groovy/TestPostgres.groovy +++ b/test-gss/src/main/groovy/TestPostgres.groovy @@ -47,7 +47,7 @@ class TestPostgres { if (isMac) postgres = new Postgres() else - postgres = new Postgres('/usr/lib/postgresql/12/bin/', '/tmp/pggss') + postgres = new Postgres('/usr/lib/postgresql/16/bin/', '/tmp/pggss') /* make sure we can connect */