Message-ID: From: "vlsi (@vlsi)" To: "pgjdbc/pgjdbc" Date: Tue, 02 Jun 2026 10:45:45 +0000 Subject: [pgjdbc/pgjdbc] PR #4131: ci: update GitHub Actions on release/42.3.x List-Id: X-GitHub-Additions: 65 X-GitHub-Author-Id: 213894 X-GitHub-Author-Login: vlsi X-GitHub-Base: release/42.3.x X-GitHub-Changed-Files: 12 X-GitHub-Commits: 11 X-GitHub-Deletions: 45 X-GitHub-Head-Branch: update-actions-42.3 X-GitHub-Head-SHA: edbd0eb18a9ad0973bf463981aa171e81d790ccb X-GitHub-Issue: 4131 X-GitHub-Labels: chore X-GitHub-Merge-SHA: 446c4f1a16a1c00ab8945230c334ae13f83ea054 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/4131 Content-Type: text/plain; charset=utf-8 ## What Refresh the GitHub Actions workflows on `release/42.3.x` so CI runs on current GitHub-hosted runners, then fix the build and test failures that change uncovered. The action updates mirror `release/42.4.x`, adapted to the older 42.3 layout (no `matrix.js`, no `gradle-wrapper-validation.yml`). GitHub Actions: - `actions/checkout` → v4 in every workflow. - `actions/setup-java` → v3 (all jobs except `buildcache.yml`, which keeps v1); `build-test` and `gss-encryption` now request the `zulu` distribution explicitly. - Replace the standalone `docker-compose` binary with the `docker compose` plugin; the `docker-compose.yml` file name is unchanged. - Drop PostgreSQL 8.4/9.0 and the self-hosted runners from the matrices. - Run the CI workflow for pull requests targeting `release/*` branches (`pull_request` branch filter `*` → `**`). Without this the workflow never ran on this branch. Build and tests (pre-existing failures the branch-filter change exposed): - Pin `org.ajoberstar.grgit` to 4.1.1 so project configuration resolves; grgit 4.0.x was JCenter-only and is gone from Maven Central. - GSS tests: install the `postgresql` meta-package and point the test-gss harness at `/usr/lib/postgresql/16/bin`. - Drop the `RULE` privilege from `has_table_privilege` on PostgreSQL 18+, which removed it. - Fix a checkstyle `RightCurly` violation, a `Files.createTempFile` nullness error flagged by the Checker Framework, and an `assertEquals` argument order in a metadata test. ## Why The pinned `actions/checkout@v1/v2` and `actions/setup-java@v1/v2` run on Node runtimes the runners no longer provide, the standalone `docker-compose` binary is gone, and the PostgreSQL 8.4/9.0 images and self-hosted runners are unavailable. The `*` branch filter also meant the workflow never triggered on `release/42.3.x` pull requests, which hid build and test failures that only appear on current runners and PostgreSQL. ## How to verify Every `main.yml` job is green on this PR: code style, CheckerFramework, source distribution, the JDK 8/11 test matrix, and GSS. 🤖 Generated with [Claude Code](https://claude.com/claude-code) diff --git a/.github/workflows/buildcache.yml b/.github/workflows/buildcache.yml index c834e472cb..ef344a8df9 100644 --- a/.github/workflows/buildcache.yml +++ b/.github/workflows/buildcache.yml @@ -45,7 +45,7 @@ jobs: name: '${{ matrix.os }}, ${{ matrix.jdk }} seed build cache' runs-on: ${{ matrix.os }}-latest steps: - - uses: actions/checkout@v2 + - 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 27f12baa10..79902f649e 100644 --- a/.github/workflows/debezium.yml +++ b/.github/workflows/debezium.yml @@ -13,11 +13,11 @@ jobs: ACTIONS_STEP_DEBUG: true ACTIONS_RUNNER_DEBUG: true steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 50 - name: 'Set up JDK 11' - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: zulu java-version: 11 diff --git a/.github/workflows/fedora-copr-build.yml b/.github/workflows/fedora-copr-build.yml index 3b25c30e4a..47847a9406 100644 --- a/.github/workflows/fedora-copr-build.yml +++ b/.github/workflows/fedora-copr-build.yml @@ -13,7 +13,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/main.yml b/.github/workflows/main.yml index 7433b23cd9..3e037f096a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,7 +12,7 @@ on: - '.travis/**' pull_request: branches: - - '*' + - '**' paths-ignore: - 'docs/**' - '**/*.md' @@ -38,11 +38,11 @@ jobs: ACTIONS_STEP_DEBUG: true ACTIONS_RUNNER_DEBUG: true steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 50 - name: 'Set up JDK 8' - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: zulu java-version: 8 @@ -59,11 +59,11 @@ jobs: name: 'CheckerFramework' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 50 - name: 'Set up JDK 11' - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: zulu java-version: 11 @@ -81,14 +81,14 @@ jobs: name: 'Source distribution (JDK 11)' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - 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@v2 + uses: actions/setup-java@v3 with: distribution: zulu java-version: 11 @@ -123,8 +123,6 @@ jobs: ], os: [ 'ubuntu-latest', - // Disable self-hosted on forks: - ...(process.env.GITHUB_REPOSITORY === 'pgjdbc/pgjdbc' ? ['self-hosted'] : []) ], })" @@ -139,23 +137,24 @@ jobs: ACTIONS_STEP_DEBUG: true ACTIONS_RUNNER_DEBUG: true steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 50 - name: Start PostgreSQL working-directory: docker/postgres-server run: | - 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 "::set-output name=arch_name::$(uname -i)" id: get_arch_name - name: 'Set up JDK ${{ matrix.jdk }}' if: ${{ steps.get_arch_name.outputs.arch_name != 'aarch64' }} - uses: actions/setup-java@v1 + uses: actions/setup-java@v3 with: + distribution: zulu java-version: ${{ matrix.jdk }} architecture: x64 - name: 'Setup JDK ${{ matrix.jdk }} on ARM64' @@ -182,8 +181,8 @@ 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 gss-encryption: name: 'GSS Test - JDK ${{ matrix.jdk }} on ${{ matrix.os }}' @@ -196,14 +195,15 @@ jobs: ACTIONS_STEP_DEBUG: true ACTIONS_RUNNER_DEBUG: true steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: 'Get test node ARCH' run: echo "::set-output name=arch_name::$(uname -i)" id: get_arch_name - name: 'Set up JDK 8' if: ${{ steps.get_arch_name.outputs.arch_name != 'aarch64' }} - uses: actions/setup-java@v1 + uses: actions/setup-java@v3 with: + distribution: zulu java-version: 8 - name: 'Setup JDK 8 on ARM64' if: ${{ steps.get_arch_name.outputs.arch_name == 'aarch64' }} @@ -216,7 +216,7 @@ jobs: if: ${{ steps.get_arch_name.outputs.arch_name != 'aarch64' }} 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' run: | sudo -- sh -c "echo 127.0.0.1 localhost auth-test-localhost.postgresql.example.com > /etc/hosts" diff --git a/.github/workflows/nightlysnapshot.yml b/.github/workflows/nightlysnapshot.yml index 1b2b8d0151..5b685f6224 100644 --- a/.github/workflows/nightlysnapshot.yml +++ b/.github/workflows/nightlysnapshot.yml @@ -15,11 +15,11 @@ jobs: ACTIONS_STEP_DEBUG: true ACTIONS_RUNNER_DEBUG: true steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 50 - name: 'Set up JDK 8' - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: zulu java-version: 8 diff --git a/.github/workflows/omni.yml b/.github/workflows/omni.yml index aee71cfd3a..12988d8360 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: @@ -75,8 +75,6 @@ jobs: ]; const PG_VERSIONS = [ - '8.4', - '9.0', '9.1', '9.2', '9.3', @@ -283,19 +281,19 @@ jobs: env: MATRIX_JSON: ${{ toJSON(matrix) }} run: echo "${MATRIX_JSON}" - - uses: actions/checkout@v2 + - 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 }} # Install built-in JDK - name: 'Set up JDK ${{ matrix.jdk_version }} / ${{ matrix.jdk_distribution }}' - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 if: ${{ matrix.jdk_distribution != 'jdkfile' }} with: distribution: ${{ matrix.jdk_distribution }} @@ -308,7 +306,7 @@ jobs: jdk_url="${{ matrix.jdk_url }}" wget -nv -O "${{ runner.temp }}/java_package.tar.gz" "${jdk_url}" - name: 'Set up JDK ${{ matrix.jdk_version }} / ${{ matrix.jdk_url }}' - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 if: ${{ matrix.jdk_distribution == 'jdkfile' }} with: distribution: ${{ matrix.jdk_distribution }} @@ -330,7 +328,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()' @@ -363,14 +361,14 @@ jobs: runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v2 + - 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@v2 + uses: actions/setup-java@v3 with: distribution: zulu java-version: 11 @@ -388,7 +386,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/build.gradle.kts b/build.gradle.kts index af61f9b6b0..dd89657916 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -16,6 +16,20 @@ import de.thetaphi.forbiddenapis.gradle.CheckForbiddenApis import de.thetaphi.forbiddenapis.gradle.CheckForbiddenApisExtension import org.postgresql.buildtools.JavaCommentPreprocessorTask +buildscript { + // org.ajoberstar.grgit 4.0.x was published to JCenter only and is no longer + // available on Maven Central, so the stage-vote-release plugin's transitive + // grgit 4.0.1 fails to resolve. Pin grgit to 4.1.1, the oldest 4.x release + // that is still on Maven Central. + configurations.classpath { + resolutionStrategy.eachDependency { + if (requested.group == "org.ajoberstar.grgit") { + useVersion("4.1.1") + } + } + } +} + plugins { publishing // Verification diff --git a/pgjdbc/src/main/java/org/postgresql/jdbc/PgDatabaseMetaData.java b/pgjdbc/src/main/java/org/postgresql/jdbc/PgDatabaseMetaData.java index 8ff7299b41..d7df6605bf 100644 --- a/pgjdbc/src/main/java/org/postgresql/jdbc/PgDatabaseMetaData.java +++ b/pgjdbc/src/main/java/org/postgresql/jdbc/PgDatabaseMetaData.java @@ -1318,8 +1318,15 @@ public ResultSet getTables(@Nullable String catalog, @Nullable String schemaPatt select += " AND n.nspname LIKE " + escapeQuotes(schemaPattern); } if (connection.getHideUnprivilegedObjects()) { - select += " AND has_table_privilege(c.oid, " - + " 'SELECT, INSERT, UPDATE, DELETE, RULE, REFERENCES, TRIGGER')"; + // The RULE privilege was removed from has_table_privilege() in PostgreSQL 18: + // https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=fefa76f70fdc75c91f80bddce2df7a8825205962 + if (connection.getServerMajorVersion() < 18) { + select += " AND has_table_privilege(c.oid, " + + " 'SELECT, INSERT, UPDATE, DELETE, RULE, REFERENCES, TRIGGER')"; + } else { + select += " AND has_table_privilege(c.oid, " + + " 'SELECT, INSERT, UPDATE, DELETE, REFERENCES, TRIGGER')"; + } } orderby = " ORDER BY TABLE_TYPE,TABLE_SCHEM,TABLE_NAME "; diff --git a/pgjdbc/src/main/java/org/postgresql/util/StreamWrapper.java b/pgjdbc/src/main/java/org/postgresql/util/StreamWrapper.java index 1a229e4e6c..2be532498b 100644 --- a/pgjdbc/src/main/java/org/postgresql/util/StreamWrapper.java +++ b/pgjdbc/src/main/java/org/postgresql/util/StreamWrapper.java @@ -52,7 +52,7 @@ public StreamWrapper(InputStream stream) throws PSQLException { if (memoryLength == -1) { final int diskLength; - final File tempFile = Files.createTempFile(TEMP_FILE_PREFIX, null).toFile(); + final File tempFile = Files.createTempFile(TEMP_FILE_PREFIX, ".tmp").toFile(); FileOutputStream diskOutputStream = new FileOutputStream(tempFile); diskOutputStream.write(rawData); try { diff --git a/pgjdbc/src/test/java/org/postgresql/test/jdbc2/DatabaseMetaDataTest.java b/pgjdbc/src/test/java/org/postgresql/test/jdbc2/DatabaseMetaDataTest.java index 4006f082a9..8b57c793e6 100644 --- a/pgjdbc/src/test/java/org/postgresql/test/jdbc2/DatabaseMetaDataTest.java +++ b/pgjdbc/src/test/java/org/postgresql/test/jdbc2/DatabaseMetaDataTest.java @@ -221,7 +221,8 @@ public void testCustomArrayTypeInfo() throws SQLException { assertEquals("__custom_1", res.getString("TYPE_NAME")); } else { assertEquals("___custom", res.getString("TYPE_NAME")); - } } + } + } if (TestUtil.haveMinimumServerVersion(con, ServerVersion.v8_3)) { con.createArrayOf("custom", new Object[]{}); res = dbmd.getColumns(null, null, "customtable", null); diff --git a/pgjdbc/src/test/java/org/postgresql/test/jdbc42/DatabaseMetaDataTest.java b/pgjdbc/src/test/java/org/postgresql/test/jdbc42/DatabaseMetaDataTest.java index e348587d24..5d5f7e4dfe 100644 --- a/pgjdbc/src/test/java/org/postgresql/test/jdbc42/DatabaseMetaDataTest.java +++ b/pgjdbc/src/test/java/org/postgresql/test/jdbc42/DatabaseMetaDataTest.java @@ -104,9 +104,9 @@ public void testGetCorrectSQLTypeForShadowedTypes() throws Exception { assertEquals("c", rs.getString("COLUMN_NAME")); // = array of TYPE test_enum AS ENUM ('value') if (TestUtil.haveMinimumServerVersion(conn, ServerVersion.v16)) { - assertEquals("_test_enum_1", rs.getString("TYPE_NAME"), "Correctly detects shadowed array type name"); + assertEquals("Correctly detects shadowed array type name", "_test_enum_1", rs.getString("TYPE_NAME")); } else { - assertEquals("___test_enum", rs.getString("TYPE_NAME"), "Correctly detects shadowed array type name"); + assertEquals("Correctly detects shadowed array type name", "___test_enum", rs.getString("TYPE_NAME")); } assertEquals("Correctly detects type of shadowed name", Types.ARRAY, rs.getInt("DATA_TYPE")); 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 */