From 7c4ccebf684f14a86df12f62e21da91a2ed59d78 Mon Sep 17 00:00:00 2001 From: Christoph Pirkl Date: Fri, 29 May 2026 16:24:39 +0200 Subject: [PATCH 1/5] #306: Fix TablesMetadataParser default for missing isIdentity --- doc/changes/changelog.md | 1 + doc/changes/changes_18.0.2.md | 20 +++++ pk_generated_parent.pom | 2 +- pom.xml | 6 +- .../adapter/metadata/ColumnMetadata.java | 8 ++ .../request/parser/TablesMetadataParser.java | 13 +-- .../parser/TablesMetadataParserTest.java | 79 +++++++++++++------ 7 files changed, 95 insertions(+), 34 deletions(-) create mode 100644 doc/changes/changes_18.0.2.md diff --git a/doc/changes/changelog.md b/doc/changes/changelog.md index cd444472..02180d19 100644 --- a/doc/changes/changelog.md +++ b/doc/changes/changelog.md @@ -1,5 +1,6 @@ # Changes +* [18.0.2](changes_18.0.2.md) * [18.0.1](changes_18.0.1.md) * [18.0.0](changes_18.0.0.md) * [17.1.2](changes_17.1.2.md) diff --git a/doc/changes/changes_18.0.2.md b/doc/changes/changes_18.0.2.md new file mode 100644 index 00000000..03e6e719 --- /dev/null +++ b/doc/changes/changes_18.0.2.md @@ -0,0 +1,20 @@ +# Common Module of Exasol Virtual Schemas Adapters 18.0.2, released 2026-??-?? + +Code name: + +## Summary + +## Breaking Changes + +* Constructor `ColumnMetadata.Builder()` is now deprecated for removal. Use `ColumnMetadata.builder()` to create a new instance (#306). + +## Bugfixes + +* #306: Fixed `TablesMetadataParser` so omitted `isIdentity` values default to `false` while omitted + `isNullable` values still default to `true`. + +## Dependency Updates + +### Plugin Dependency Updates + +* Updated `com.exasol:project-keeper-maven-plugin:5.5.2` to `5.6.2` diff --git a/pk_generated_parent.pom b/pk_generated_parent.pom index 8884cbe5..63401e91 100644 --- a/pk_generated_parent.pom +++ b/pk_generated_parent.pom @@ -3,7 +3,7 @@ 4.0.0 com.exasol virtual-schema-common-java-generated-parent - 18.0.1 + 18.0.2 pom UTF-8 diff --git a/pom.xml b/pom.xml index 23c77845..cde3ea0b 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 virtual-schema-common-java - 18.0.1 + 18.0.2 Common module of Exasol Virtual Schemas Adapters This is one of the modules of Virtual Schemas Adapters. The libraries provided by this project are the foundation of the adapter development, i.e. adapters must be implemented on top of them. @@ -79,7 +79,7 @@ com.exasol project-keeper-maven-plugin - 5.5.2 + 5.6.2 @@ -93,7 +93,7 @@ virtual-schema-common-java-generated-parent com.exasol - 18.0.1 + 18.0.2 pk_generated_parent.pom diff --git a/src/main/java/com/exasol/adapter/metadata/ColumnMetadata.java b/src/main/java/com/exasol/adapter/metadata/ColumnMetadata.java index 93ef4046..1aec042d 100644 --- a/src/main/java/com/exasol/adapter/metadata/ColumnMetadata.java +++ b/src/main/java/com/exasol/adapter/metadata/ColumnMetadata.java @@ -192,6 +192,14 @@ public static class Builder { private String originalTypeName = null; private String comment = ""; + /** + * @deprecated use {@link ColumnMetadata#builder()} instead. + */ + @Deprecated(since = "18.0.2", forRemoval = true) + public Builder() { + // intentionally left blank + } + /** * Set the column name * diff --git a/src/main/java/com/exasol/adapter/request/parser/TablesMetadataParser.java b/src/main/java/com/exasol/adapter/request/parser/TablesMetadataParser.java index f6977522..b401a1eb 100644 --- a/src/main/java/com/exasol/adapter/request/parser/TablesMetadataParser.java +++ b/src/main/java/com/exasol/adapter/request/parser/TablesMetadataParser.java @@ -57,8 +57,8 @@ private ColumnMetadata parseColumnMetadata(final JsonObject column) { final String adapterNotes = readAdapterNotes(column); final String comment = column.getString(TABLE_COMMENT_KEY, ""); final String defaultValue = column.getString("default", ""); - final boolean isNullable = applyBooleanValue(column, "isNullable"); - final boolean isIdentity = applyBooleanValue(column, "isIdentity"); + final boolean isNullable = applyBooleanValue(column, "isNullable", true); + final boolean isIdentity = applyBooleanValue(column, "isIdentity", false); final JsonObject dataType = column.getJsonObject(DATA_TYPE); final DataType type = getDataType(dataType); return ColumnMetadata.builder().name(columnName).adapterNotes(adapterNotes).type(type).nullable(isNullable) @@ -81,11 +81,12 @@ private String getAdapterNotesString(final JsonValue notes) { } } - private boolean applyBooleanValue(final JsonObject column, final String bolleanName) { - if (column.containsKey(bolleanName)) { - return column.getBoolean(bolleanName); + private boolean applyBooleanValue(final JsonObject column, final String booleanName, + final boolean defaultValue) { + if (column.containsKey(booleanName)) { + return column.getBoolean(booleanName); } - return true; + return defaultValue; } private static DataType.ExaCharset charSetFromString(final String charset) { diff --git a/src/test/java/com/exasol/adapter/request/parser/TablesMetadataParserTest.java b/src/test/java/com/exasol/adapter/request/parser/TablesMetadataParserTest.java index defabb28..a006d178 100644 --- a/src/test/java/com/exasol/adapter/request/parser/TablesMetadataParserTest.java +++ b/src/test/java/com/exasol/adapter/request/parser/TablesMetadataParserTest.java @@ -22,14 +22,14 @@ class TablesMetadataParserTest { void testParseMetadata() throws IOException { final List tableColumns = new ArrayList<>(); tableColumns.add(ColumnMetadata.builder().name("ID").adapterNotes("").type(DataType.createDecimal(22, 0)) - .nullable(true).identity(true).defaultValue("").comment("").build()); + .nullable(true).identity(false).defaultValue("").comment("").build()); tableColumns.add(ColumnMetadata.builder().name("USER_ID").adapterNotes("").type(DataType.createDecimal(18, 0)) - .nullable(true).identity(true).defaultValue("").comment("").build()); + .nullable(true).identity(false).defaultValue("").comment("").build()); tableColumns.add(ColumnMetadata.builder().name("URL").adapterNotes("").type(DataType.createVarChar(1000, UTF8)) - .nullable(true).identity(true).defaultValue("").comment("").build()); + .nullable(true).identity(false).defaultValue("").comment("").build()); tableColumns.add( ColumnMetadata.builder().name("REQUEST_TIME").adapterNotes("").type(DataType.createTimestamp(false, 3)) - .nullable(true).identity(true).defaultValue("").comment("").build()); + .nullable(true).identity(false).defaultValue("").comment("").build()); final List expectedInvolvedTablesMetadata = new ArrayList<>(); expectedInvolvedTablesMetadata.add(new TableMetadata("CLICKS", "", tableColumns, "")); final JsonArray tablesAsJson = readInvolvedTablesFromJsonFile("target/test-classes/pushdown_request.json"); @@ -60,59 +60,90 @@ void testParseTablesMetadataAllColumnsTypes() throws IOException { private List createExpectedTableMetadata() { final List tableColumns = new ArrayList<>(); tableColumns.add(ColumnMetadata.builder().name("C_DECIMAL").adapterNotes("").type(DataType.createDecimal(18, 2)) - .nullable(true).identity(true).defaultValue("").comment("").build()); + .nullable(true).identity(false).defaultValue("").comment("").build()); tableColumns.add(ColumnMetadata.builder().name("C_DOUBLE").adapterNotes("").type(DataType.createDouble()) - .nullable(true).identity(true).defaultValue("").comment("").build()); + .nullable(true).identity(false).defaultValue("").comment("").build()); tableColumns.add(ColumnMetadata.builder().name("C_VARCHAR_UTF8_1").adapterNotes("") - .type(DataType.createVarChar(10000, UTF8)).nullable(true).identity(true).defaultValue("").comment("") + .type(DataType.createVarChar(10000, UTF8)).nullable(true).identity(false).defaultValue("").comment("") .build()); tableColumns.add(ColumnMetadata.builder().name("C_VARCHAR_UTF8_2").adapterNotes("") - .type(DataType.createVarChar(10000, UTF8)).nullable(true).identity(true).defaultValue("").comment("") + .type(DataType.createVarChar(10000, UTF8)).nullable(true).identity(false).defaultValue("").comment("") .build()); tableColumns.add(ColumnMetadata.builder().name("C_VARCHAR_ASCII").adapterNotes("") - .type(DataType.createVarChar(10000, ASCII)).nullable(true).identity(true).defaultValue("").comment("") + .type(DataType.createVarChar(10000, ASCII)).nullable(true).identity(false).defaultValue("").comment("") .build()); tableColumns.add(ColumnMetadata.builder().name("C_CHAR_UTF8_1").adapterNotes("") - .type(DataType.createChar(3, UTF8)).nullable(true).identity(true).defaultValue("").comment("").build()); + .type(DataType.createChar(3, UTF8)).nullable(true).identity(false).defaultValue("").comment("") + .build()); tableColumns.add(ColumnMetadata.builder().name("C_CHAR_UTF8_2").adapterNotes("") - .type(DataType.createChar(3, UTF8)).nullable(true).identity(true).defaultValue("").comment("").build()); + .type(DataType.createChar(3, UTF8)).nullable(true).identity(false).defaultValue("").comment("") + .build()); tableColumns .add(ColumnMetadata.builder().name("C_CHAR_ASCII").adapterNotes("").type(DataType.createChar(3, ASCII)) - .nullable(true).identity(true).defaultValue("").comment("").build()); + .nullable(true).identity(false).defaultValue("").comment("").build()); tableColumns.add(ColumnMetadata.builder().name("C_DATE").adapterNotes("").type(DataType.createDate()) - .nullable(true).identity(true).defaultValue("").comment("").build()); + .nullable(true).identity(false).defaultValue("").comment("").build()); tableColumns.add( ColumnMetadata.builder().name("C_TIMESTAMP_1").adapterNotes("").type(DataType.createTimestamp(false, 3)) - .nullable(true).identity(true).defaultValue("").comment("").build()); + .nullable(true).identity(false).defaultValue("").comment("").build()); tableColumns.add( ColumnMetadata.builder().name("C_TIMESTAMP_2").adapterNotes("").type(DataType.createTimestamp(false, 3)) - .nullable(true).identity(true).defaultValue("").comment("").build()); + .nullable(true).identity(false).defaultValue("").comment("").build()); tableColumns.add( ColumnMetadata.builder().name("C_TIMESTAMP_3").adapterNotes("").type(DataType.createTimestamp(true, 3)) - .nullable(true).identity(true).defaultValue("").comment("").build()); + .nullable(true).identity(false).defaultValue("").comment("").build()); tableColumns.add( ColumnMetadata.builder().name("C_TIMESTAMP_4").adapterNotes("").type(DataType.createTimestamp(false, 7)) - .nullable(true).identity(true).defaultValue("").comment("").build()); + .nullable(true).identity(false).defaultValue("").comment("").build()); tableColumns.add(ColumnMetadata.builder().name("C_BOOLEAN").adapterNotes("").type(DataType.createBool()) - .nullable(true).identity(true).defaultValue("").comment("").build()); + .nullable(true).identity(false).defaultValue("").comment("").build()); tableColumns.add(ColumnMetadata.builder().name("C_GEOMETRY").adapterNotes("").type(DataType.createGeometry(1)) - .nullable(true).identity(true).defaultValue("").comment("").build()); + .nullable(true).identity(false).defaultValue("").comment("").build()); tableColumns.add(ColumnMetadata.builder().name("C_HASHTYPE").adapterNotes("").type(DataType.createHashtype(16)) - .nullable(true).identity(true).defaultValue("").comment("").build()); + .nullable(true).identity(false).defaultValue("").comment("").build()); tableColumns.add(ColumnMetadata.builder().name("C_INTERVAL_DS_1").adapterNotes("") - .type(DataType.createIntervalDaySecond(2, 3)).nullable(true).identity(true).defaultValue("").comment("") + .type(DataType.createIntervalDaySecond(2, 3)).nullable(true).identity(false).defaultValue("") + .comment("") .build()); tableColumns.add(ColumnMetadata.builder().name("C_INTERVAL_DS_2").adapterNotes("") - .type(DataType.createIntervalDaySecond(3, 4)).nullable(true).identity(true).defaultValue("").comment("") + .type(DataType.createIntervalDaySecond(3, 4)).nullable(true).identity(false).defaultValue("") + .comment("") .build()); tableColumns.add(ColumnMetadata.builder().name("C_INTERVAL_YM_1").adapterNotes("") - .type(DataType.createIntervalYearMonth(2)).nullable(true).identity(true).defaultValue("").comment("") + .type(DataType.createIntervalYearMonth(2)).nullable(true).identity(false).defaultValue("").comment("") .build()); tableColumns.add(ColumnMetadata.builder().name("C_INTERVAL_YM_2").adapterNotes("") - .type(DataType.createIntervalYearMonth(3)).nullable(true).identity(true).defaultValue("").comment("") + .type(DataType.createIntervalYearMonth(3)).nullable(true).identity(false).defaultValue("").comment("") .build()); final List expectedInvolvedTablesMetadata = new ArrayList<>(); expectedInvolvedTablesMetadata.add(new TableMetadata("T1", "", tableColumns, "")); return expectedInvolvedTablesMetadata; } + + @Test + void testParseColumnMetadataUsesBooleanDefaults() { + final JsonArray tablesAsJson = Json.createArrayBuilder().add(Json.createObjectBuilder() + .add("name", "T1") + .add("columns", Json.createArrayBuilder() + .add(Json.createObjectBuilder().add("name", "DEFAULTS") + .add("dataType", Json.createObjectBuilder().add("type", "DECIMAL").add("precision", 18) + .add("scale", 0))) + .add(Json.createObjectBuilder().add("name", "EXPLICIT_VALUES").add("isNullable", false) + .add("isIdentity", true) + .add("dataType", Json.createObjectBuilder().add("type", "DECIMAL").add("precision", 18) + .add("scale", 0))))) + .build(); + + final List tables = TablesMetadataParser.create().parse(tablesAsJson); + + final List expectedColumns = new ArrayList<>(); + expectedColumns.add(ColumnMetadata.builder().name("DEFAULTS").adapterNotes("") + .type(DataType.createDecimal(18, 0)).nullable(true).identity(false).defaultValue("").comment("") + .build()); + expectedColumns.add(ColumnMetadata.builder().name("EXPLICIT_VALUES").adapterNotes("") + .type(DataType.createDecimal(18, 0)).nullable(false).identity(true).defaultValue("").comment("") + .build()); + + assertThat(tables, equalTo(List.of(new TableMetadata("T1", "", expectedColumns, "")))); + } } From 6b2b01bb4cca51d1d199119fea2fc0f6464543c5 Mon Sep 17 00:00:00 2001 From: Christoph Pirkl Date: Fri, 29 May 2026 16:28:36 +0200 Subject: [PATCH 2/5] Cleanup test --- .../parser/TablesMetadataParserTest.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/test/java/com/exasol/adapter/request/parser/TablesMetadataParserTest.java b/src/test/java/com/exasol/adapter/request/parser/TablesMetadataParserTest.java index a006d178..983bc023 100644 --- a/src/test/java/com/exasol/adapter/request/parser/TablesMetadataParserTest.java +++ b/src/test/java/com/exasol/adapter/request/parser/TablesMetadataParserTest.java @@ -3,6 +3,7 @@ import static com.exasol.adapter.metadata.DataType.ExaCharset.ASCII; import static com.exasol.adapter.metadata.DataType.ExaCharset.UTF8; import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.equalTo; import java.io.*; @@ -136,14 +137,14 @@ void testParseColumnMetadataUsesBooleanDefaults() { final List tables = TablesMetadataParser.create().parse(tablesAsJson); - final List expectedColumns = new ArrayList<>(); - expectedColumns.add(ColumnMetadata.builder().name("DEFAULTS").adapterNotes("") - .type(DataType.createDecimal(18, 0)).nullable(true).identity(false).defaultValue("").comment("") - .build()); - expectedColumns.add(ColumnMetadata.builder().name("EXPLICIT_VALUES").adapterNotes("") - .type(DataType.createDecimal(18, 0)).nullable(false).identity(true).defaultValue("").comment("") - .build()); + final List expectedColumns = List.of( + ColumnMetadata.builder().name("DEFAULTS").adapterNotes("") + .type(DataType.createDecimal(18, 0)).nullable(true).identity(false).defaultValue("").comment("") + .build(), + ColumnMetadata.builder().name("EXPLICIT_VALUES").adapterNotes("") + .type(DataType.createDecimal(18, 0)).nullable(false).identity(true).defaultValue("").comment("") + .build()); - assertThat(tables, equalTo(List.of(new TableMetadata("T1", "", expectedColumns, "")))); + assertThat(tables, contains(new TableMetadata("T1", "", expectedColumns, ""))); } } From 98ea62504fabec0eaefd82041fe917787dd5a581 Mon Sep 17 00:00:00 2001 From: Christoph Pirkl Date: Fri, 29 May 2026 16:28:43 +0200 Subject: [PATCH 3/5] Cleanup changelog --- doc/changes/changes_18.0.2.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/changes/changes_18.0.2.md b/doc/changes/changes_18.0.2.md index 03e6e719..a0bdd1b2 100644 --- a/doc/changes/changes_18.0.2.md +++ b/doc/changes/changes_18.0.2.md @@ -10,8 +10,7 @@ Code name: ## Bugfixes -* #306: Fixed `TablesMetadataParser` so omitted `isIdentity` values default to `false` while omitted - `isNullable` values still default to `true`. +* #306: Fixed `TablesMetadataParser` so omitted `isIdentity` values default to `false` while omitted `isNullable` values still default to `true`. ## Dependency Updates From 5569bdca4e286b3336f7813efc1b0986eee823d3 Mon Sep 17 00:00:00 2001 From: Christoph Pirkl Date: Fri, 29 May 2026 16:29:12 +0200 Subject: [PATCH 4/5] Run PK fix --- .github/workflows/broken_links_checker.yml | 9 +- .github/workflows/ci-build.yml | 101 +++++++++++++++++---- .github/workflows/dependencies_check.yml | 13 +-- .github/workflows/dependencies_update.yml | 13 ++- .github/workflows/release.yml | 18 ++-- .github/zizmor.yml | 32 +++++++ pk_generated_parent.pom | 3 + 7 files changed, 151 insertions(+), 38 deletions(-) create mode 100644 .github/zizmor.yml diff --git a/.github/workflows/broken_links_checker.yml b/.github/workflows/broken_links_checker.yml index 5b14f645..22c6b801 100644 --- a/.github/workflows/broken_links_checker.yml +++ b/.github/workflows/broken_links_checker.yml @@ -21,10 +21,11 @@ jobs: cancel-in-progress: true } steps: - - { - id: checkout, + - id: checkout uses: actions/checkout@v6 - } + with: { + persist-credentials: false + } - id: configure-broken-links-checker name: Configure broken links checker run: | @@ -36,7 +37,7 @@ jobs: '{"pattern": "^https?://projects.eclipse.org"}' \ ']}' > ./target/broken_links_checker.json - id: run-broken-links-checker - uses: tcort/github-action-markdown-link-check@v1 + uses: tcort/github-action-markdown-link-check@e7c7a18363c842693fadde5d41a3bd3573a7a225 with: { use-quiet-mode: yes, use-verbose-mode: yes, diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index de9aaaed..df177c0e 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -45,7 +45,8 @@ jobs: id: checkout uses: actions/checkout@v6 with: { - fetch-depth: 0 + fetch-depth: 0, + persist-credentials: false } - name: Set up JDKs id: setup-java @@ -56,9 +57,6 @@ jobs: 11 17 cache: maven - server-id: ossindex - server-username: OSSINDEX_USERNAME - server-password: OSSINDEX_API_TOKEN - name: Cache SonarCloud packages id: cache-sonar uses: actions/cache@v5 @@ -76,17 +74,15 @@ jobs: id: build-pk-verify run: | mvn --batch-mode clean verify \ + -DossindexSkip=true \ -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ -DtrimStackTrace=false - env: { - OSSINDEX_USERNAME: '${{ secrets.OSSINDEX_USERNAME }}', - OSSINDEX_API_TOKEN: '${{ secrets.OSSINDEX_API_TOKEN }}' - } - name: Sonar analysis id: sonar-analysis if: ${{ env.SONAR_TOKEN != null }} run: | mvn --batch-mode org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \ + -DossindexSkip=true \ -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ -DtrimStackTrace=false \ -Dsonar.token=$SONAR_TOKEN @@ -118,7 +114,7 @@ jobs: '{"pattern": "^https?://(www.)?eclipse.org"}' \ '{"pattern": "^https?://projects.eclipse.org"}' \ ']}' > ./target/broken_links_checker.json - - uses: tcort/github-action-markdown-link-check@v1 + - uses: tcort/github-action-markdown-link-check@e7c7a18363c842693fadde5d41a3bd3573a7a225 id: run-link-check with: { use-quiet-mode: yes, @@ -143,7 +139,8 @@ jobs: id: checkout uses: actions/checkout@v6 with: { - fetch-depth: 0 + fetch-depth: 0, + persist-credentials: false } - name: Set up JDK 17 id: setup-java @@ -151,22 +148,91 @@ jobs: with: { distribution: temurin, java-version: '17', - cache: maven, - server-id: ossindex, - server-username: OSSINDEX_USERNAME, - server-password: OSSINDEX_API_TOKEN + cache: maven } - name: Run tests and build with Maven 17 id: build-next-java - run: mvn --batch-mode clean package -DtrimStackTrace=false -Djava.version=17 + run: | + mvn --batch-mode clean package -DtrimStackTrace=false -Djava.version=17 \ + -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ + -DossindexSkip=true \ + ossindex: + runs-on: ubuntu-latest + defaults: + run: { + shell: bash + } + permissions: { + contents: read + } + concurrency: { + group: '${{ github.workflow }}-ossindex-${{ github.ref }}', + cancel-in-progress: true + } + steps: + - name: Checkout the repository + id: checkout + uses: actions/checkout@v6 + with: { + persist-credentials: false + } + - name: Set up JDKs + id: setup-java + uses: actions/setup-java@v5 + with: + distribution: temurin + java-version: |- + 11 + 17 + cache: maven + server-id: ossindex + server-username: OSSINDEX_USERNAME + server-password: OSSINDEX_API_TOKEN + - name: Run Ossindex + id: ossindex + run: | + mvn --batch-mode test-compile \ + org.sonatype.ossindex.maven:ossindex-maven-plugin:audit \ + org.sonatype.ossindex.maven:ossindex-maven-plugin:audit-aggregate \ + -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn env: { OSSINDEX_USERNAME: '${{ secrets.OSSINDEX_USERNAME }}', OSSINDEX_API_TOKEN: '${{ secrets.OSSINDEX_API_TOKEN }}' } + lint-github-actions: + runs-on: ubuntu-latest + defaults: + run: { + shell: bash + } + permissions: { + security-events: write, + contents: read, + actions: read + } + concurrency: { + group: '${{ github.workflow }}-github-actions-linter-${{ github.ref }}', + cancel-in-progress: true + } + steps: + - name: Checkout the repository + id: checkout + uses: actions/checkout@v6 + with: { + persist-credentials: false + } + - name: Lint GitHub actions with Zizmore + id: lint-github-actions + uses: zizmorcore/zizmor-action@b1d7e1fb5de872772f31590499237e7cce841e8e + with: { + advanced-security: false + } build: needs: [ build-and-test, - next-java-compatibility + next-java-compatibility, + ossindex, + lint-github-actions ] runs-on: ubuntu-latest defaults: @@ -185,7 +251,8 @@ jobs: id: checkout uses: actions/checkout@v6 with: { - fetch-depth: 0 + fetch-depth: 0, + persist-credentials: false } - name: Set up JDKs id: setup-java diff --git a/.github/workflows/dependencies_check.yml b/.github/workflows/dependencies_check.yml index 4307252d..c7220ca7 100644 --- a/.github/workflows/dependencies_check.yml +++ b/.github/workflows/dependencies_check.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: null schedule: - { - cron: 0 2 * * * + cron: 42 22 * * 0 } jobs: report_security_issues: @@ -25,11 +25,12 @@ jobs: cancel-in-progress: true } steps: - - { - name: Checkout, - id: checkout, + - name: Checkout + id: checkout uses: actions/checkout@v6 - } + with: { + persist-credentials: false + } - name: Set up JDKs id: setup-jdks uses: actions/setup-java@v5 @@ -55,7 +56,7 @@ jobs: } - name: Create GitHub Issues id: create-security-issues - uses: exasol/python-toolbox/.github/actions/security-issues@6.4.0 + uses: exasol/python-toolbox/.github/actions/security-issues@7.0.0 with: { format: maven, command: cat ossindex-report.json, diff --git a/.github/workflows/dependencies_update.yml b/.github/workflows/dependencies_update.yml index 1fd1e1f4..73478fee 100644 --- a/.github/workflows/dependencies_update.yml +++ b/.github/workflows/dependencies_update.yml @@ -37,7 +37,8 @@ jobs: - uses: actions/checkout@v6 id: checkout with: { - fetch-depth: 0 + fetch-depth: 0, + persist-credentials: true } - name: Set up JDKs id: setup-jdks @@ -61,7 +62,11 @@ jobs: uses: actions/github-script@v9 with: script: | - core.setFailed('Not running on a branch, github.ref is ${{ github.ref }}. Please start this workflow only on main or a branch') + const ref = process.env.GITHUB_REF + core.setFailed(`Not running on a branch, github.ref is '${ref}'. Please start this workflow only on main or a branch`) + env: { + GITHUB_REF: '${{ github.ref }}' + } - name: Update dependencies id: update-dependencies run: | @@ -159,7 +164,7 @@ jobs: - name: Report failure Status to Slack channel id: report-failure-slack if: ${{ always() }} - uses: ravsamhq/notify-slack-action@v2 + uses: ravsamhq/notify-slack-action@be814b201e233b2dc673608aa46e5447c8ab13f2 with: { status: '${{ job.status }}', token: '${{ secrets.GITHUB_TOKEN }}', @@ -173,7 +178,7 @@ jobs: - name: Report new Pull Request to Slack channel id: report-pr-slack if: ${{ steps.create-pr.outputs.pr_url }} - uses: ravsamhq/notify-slack-action@v2 + uses: ravsamhq/notify-slack-action@be814b201e233b2dc673608aa46e5447c8ab13f2 with: { status: '${{ job.status }}', token: '${{ secrets.GITHUB_TOKEN }}', diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c49cfa67..6ca88461 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -77,7 +77,8 @@ jobs: id: checkout uses: actions/checkout@v6 with: { - fetch-depth: 0 + fetch-depth: 0, + persist-credentials: true } - name: Set up Maven Central Repository id: configure-maven-central-credentials @@ -88,7 +89,6 @@ jobs: java-version: |- 11 17 - cache: maven server-id: maven-central-portal server-username: MAVEN_USERNAME server-password: MAVEN_PASSWORD @@ -110,7 +110,11 @@ jobs: uses: actions/github-script@v9 with: script: | - core.setFailed('Not running on main or release branch, github.ref is ${{ github.ref }}. Please start this workflow only on main or a branch starting with release/') + const ref = process.env.GITHUB_REF + core.setFailed(`Not running on main or release branch, github.ref is '${ref}'. Please start this workflow only on main or a branch starting with release/`) + env: { + GITHUB_REF: '${{ github.ref }}' + } - name: Check CI build of this commit succeeded id: check-ci-build-status if: ${{ ! inputs.started-from-ci }} @@ -142,7 +146,7 @@ jobs: - { name: Build project, id: build, - run: mvn --batch-mode -DskipTests -Dossindex.skip=true clean verify + run: mvn --batch-mode -DskipTests -DossindexSkip=true clean verify } - { name: List secret GPG keys, @@ -155,7 +159,7 @@ jobs: if: ${{ true && (! inputs.skip-maven-central) }} run: | echo "#### Maven Central Release" >> "$GITHUB_STEP_SUMMARY" - mvn --batch-mode -Dgpg.skip=false -DskipTests -Dossindex.skip=true deploy \ + mvn --batch-mode -Dgpg.skip=false -DskipTests -DossindexSkip=true deploy \ -Dcentral-publishing.deploymentName="Auto release of repo ${{ github.repository }} using PK release.yml" \ -Dcentral-publishing.autoPublish=${{ inputs.maven-central-auto-publish }} if [[ "${{ inputs.maven-central-auto-publish }}" == "true" ]]; then @@ -236,7 +240,7 @@ jobs: - name: Report failure Status to Slack channel id: report-failure-status-slack if: ${{ always() }} - uses: ravsamhq/notify-slack-action@v2 + uses: ravsamhq/notify-slack-action@be814b201e233b2dc673608aa46e5447c8ab13f2 with: { status: '${{ job.status }}', token: '${{ github.token }}', @@ -250,7 +254,7 @@ jobs: - name: Report new release to Slack channel id: report-new-release-slack if: ${{ steps.create-github-release.outputs.release-url }} - uses: ravsamhq/notify-slack-action@v2 + uses: ravsamhq/notify-slack-action@be814b201e233b2dc673608aa46e5447c8ab13f2 with: { status: '${{ job.status }}', token: '${{ github.token }}', diff --git a/.github/zizmor.yml b/.github/zizmor.yml new file mode 100644 index 00000000..4b5fd609 --- /dev/null +++ b/.github/zizmor.yml @@ -0,0 +1,32 @@ +# Generated by Project Keeper +# https://github.com/exasol/project-keeper/blob/main/project-keeper/src/main/resources/templates/.github/zizmor.yml +# See https://docs.zizmor.sh/configuration/#settings +rules: + unpinned-uses: + config: + policies: + "actions/*": ref-pin + "exasol/python-toolbox/.github/actions/security-issues": ref-pin + "*": hash-pin + cache-poisoning: + ignore: + # Enabling caching is OK for non-release workflows + - ci-build.yml + - ci-build-native-build.yml + - ci-build-db-version-matrix.yml + - project-keeper-verify.yml + - test_on_windows.yml + - test_linux_build_on_windows.yml + obfuscation: + ignore: + # Generated workflows use boolean conditions like ${{ false }} + - ci-build.yml + - release.yml + - project-keeper-verify.yml + secrets-inherit: + ignore: + # Required for passing slack webhooks + - ci-build.yml + - ci-build-db-version-matrix.yml + - dependencies_check.yml + - release.yml diff --git a/pk_generated_parent.pom b/pk_generated_parent.pom index 63401e91..4137a050 100644 --- a/pk_generated_parent.pom +++ b/pk_generated_parent.pom @@ -13,6 +13,7 @@ exasol https://sonarcloud.io + false true false false @@ -168,6 +169,8 @@ 3.2.0 ossindex + + ${ossindexSkip} From 66eb5b1452734ed148c5a892fce2f5749d70e9e9 Mon Sep 17 00:00:00 2001 From: Christoph Pirkl Date: Fri, 29 May 2026 17:09:22 +0200 Subject: [PATCH 5/5] Fix deprecation warning --- .../metadata/converter/SchemaMetadataJsonConverterTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/java/com/exasol/adapter/metadata/converter/SchemaMetadataJsonConverterTest.java b/src/test/java/com/exasol/adapter/metadata/converter/SchemaMetadataJsonConverterTest.java index c250b669..fc7d7f88 100644 --- a/src/test/java/com/exasol/adapter/metadata/converter/SchemaMetadataJsonConverterTest.java +++ b/src/test/java/com/exasol/adapter/metadata/converter/SchemaMetadataJsonConverterTest.java @@ -59,12 +59,12 @@ void testConvert() throws JSONException { + "}"; final List tables = new ArrayList<>(); final List columnsA = new ArrayList<>(); - columnsA.add(new ColumnMetadata.Builder().name("column_A1").comment("comment A1").type(DataType.createDouble()) + columnsA.add(ColumnMetadata.builder().name("column_A1").comment("comment A1").type(DataType.createDouble()) .adapterNotes("notes A1").nullable(false).build()); - columnsA.add(new ColumnMetadata.Builder().name("column_A2").type(DataType.createDate()) + columnsA.add(ColumnMetadata.builder().name("column_A2").type(DataType.createDate()) .defaultValue("default A2").identity(true).build()); final List columnsB = new ArrayList<>(); - columnsB.add(new ColumnMetadata.Builder().name("COLUMN_B1").type(DataType.createBool()).build()); + columnsB.add(ColumnMetadata.builder().name("COLUMN_B1").type(DataType.createBool()).build()); tables.add(new TableMetadata("table_A", "notes A", columnsA, "comment A")); tables.add(new TableMetadata("TABLE_B", null, columnsB, null)); final SchemaMetadata schemaMetadata = new SchemaMetadata(SCHEMA_NAME, tables);