From 599cf579fef4c3f779b1d6ec95129177dff40455 Mon Sep 17 00:00:00 2001 From: jakobbraun Date: Wed, 28 Oct 2020 13:54:01 +0100 Subject: [PATCH 01/37] #8 Added test setup for debugging in UDFs (#9) * #8 Added test setup for debugging in UDFs Co-authored-by: Muhammet Orazov --- README.md | 25 ++++++++- doc/changes/changes_0.2.0.md | 5 +- pom.xml | 33 ++++++----- .../java/com/exasol/udfdebugging/Module.java | 8 +++ .../exasol/udfdebugging/ModuleFactory.java | 26 +++++++++ .../com/exasol/udfdebugging/UdfTestSetup.java | 55 +++++++++++++++++++ .../modules/AbstractModuleFactory.java | 30 ++++++++++ .../modules/debugging/DebuggingModule.java | 25 +++++++++ .../debugging/DebuggingModuleFactory.java | 18 ++++++ .../exasol/udfdebugging/UdfTestSetupTest.java | 39 +++++++++++++ 10 files changed, 248 insertions(+), 16 deletions(-) create mode 100644 src/main/java/com/exasol/udfdebugging/Module.java create mode 100644 src/main/java/com/exasol/udfdebugging/ModuleFactory.java create mode 100644 src/main/java/com/exasol/udfdebugging/UdfTestSetup.java create mode 100644 src/main/java/com/exasol/udfdebugging/modules/AbstractModuleFactory.java create mode 100644 src/main/java/com/exasol/udfdebugging/modules/debugging/DebuggingModule.java create mode 100644 src/main/java/com/exasol/udfdebugging/modules/debugging/DebuggingModuleFactory.java create mode 100644 src/test/java/com/exasol/udfdebugging/UdfTestSetupTest.java diff --git a/README.md b/README.md index 3d35e52..e1ef18c 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,30 @@ This repository contains tools for debugging UDFs. Install as maven dependency. You can get the dependency declaration by clicking the maven badge above. +## Typical Usage + +Typically, you use this package together with [test-db-builder-java](https://github.com/exasol/test-db-builder-java) and [exasol-testcontainers](https://github.com/exasol/exasol-testcontainers) as follows: + +```java +final UdfTestSetup udfTestSetup = new UdfTestSetup(getTestHostIp()); +final ExasolObjectFactory testDbBuilder = new ExasolObjectFactory(EXASOL.createConnection(), + ExasolObjectConfiguration.builder().withJvmOptions(udfTestSetup.getJvmOptions()).build()); +``` + +## Modules + +This package contains multiple modules that you can enable on runtime by setting the corresponding system property to `true`. +Typically, you do so by appending `-D="true"` to your JVM call. + + +### Debugging + +System property: `test.debug` + +This module instructs the UDF JVMs to connect to a Java debugger listening on the default port 8000 on you machine, running the tests. + + ## Additional Information * [Changelog](doc/changes/changelog.md) -* [Dependencies](NOTICE) \ No newline at end of file +* [Dependencies](NOTICE) diff --git a/doc/changes/changes_0.2.0.md b/doc/changes/changes_0.2.0.md index 050ed73..8c3aeeb 100644 --- a/doc/changes/changes_0.2.0.md +++ b/doc/changes/changes_0.2.0.md @@ -1,11 +1,12 @@ -# udf-debugging-java 0.2.0, released 2020-XX-XX +# udf-debugging-java 0.2.0, released 2020-10-28 -Code name: +Code name: Test setup for UDF debugging ## Features / Enhancements * #5: Sonar Cloud setup * #6: Changed default value of getSelectionThatIsSentToTheAdapter to empty string +* #8: Added test setup for debugging in UDFs ## Dependency Updates: diff --git a/pom.xml b/pom.xml index 689fcdc..ddfd4ba 100644 --- a/pom.xml +++ b/pom.xml @@ -121,6 +121,12 @@ ${jacoco.version} test + + org.slf4j + slf4j-api + 1.7.30 + compile + @@ -362,19 +368,20 @@ NOTICE.template - - https://source.jasig.org/licenses/license-mappings.xml - - - - - package - - check - - - - --> + + https://source.jasig.org/licenses/license-mappings.xml + + + + + package + + check + + + + + --> diff --git a/src/main/java/com/exasol/udfdebugging/Module.java b/src/main/java/com/exasol/udfdebugging/Module.java new file mode 100644 index 0000000..dedaa92 --- /dev/null +++ b/src/main/java/com/exasol/udfdebugging/Module.java @@ -0,0 +1,8 @@ +package com.exasol.udfdebugging; + +import java.util.stream.Stream; + +public interface Module { + + public Stream getJvmOptions(); +} diff --git a/src/main/java/com/exasol/udfdebugging/ModuleFactory.java b/src/main/java/com/exasol/udfdebugging/ModuleFactory.java new file mode 100644 index 0000000..1a671e1 --- /dev/null +++ b/src/main/java/com/exasol/udfdebugging/ModuleFactory.java @@ -0,0 +1,26 @@ +package com.exasol.udfdebugging; + +public interface ModuleFactory { + + /** + * Get if this module is enabled by system property. + * + * @return {@code true} if this module is enabled + */ + public boolean isEnabled(); + + /** + * Get the name of the property to enable this module. + * + * @return name of the property to enable this module + */ + public String getModulePropertyName(); + + /** + * Build the {@link Module}. + * + * @param testHostIpAddress IP address of the host running this UDF Test Setup under which UDFs can reach it + * @return built {@link Module} + */ + public Module buildModule(final String testHostIpAddress); +} diff --git a/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java b/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java new file mode 100644 index 0000000..581430a --- /dev/null +++ b/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java @@ -0,0 +1,55 @@ +package com.exasol.udfdebugging; + +import java.util.List; +import java.util.stream.Collectors; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.exasol.udfdebugging.modules.debugging.DebuggingModuleFactory; + +/** + * Test setup for testing UDFs in the database. + */ +public class UdfTestSetup { + private static final List AVAILABLE_MODULES = List.of(new DebuggingModuleFactory()); + private static final Logger LOGGER = LoggerFactory.getLogger(UdfTestSetup.class); + private final List enabledModules; + + /** + * Create a new instance of {@link UdfTestSetup}. + * + * @param testHostIpAddress IP address of the host running this UDF Test Setup under which UDFs can reach it + */ + public UdfTestSetup(final String testHostIpAddress) { + this.enabledModules = AVAILABLE_MODULES.stream().filter(ModuleFactory::isEnabled) + .map(moduleFactory -> moduleFactory.buildModule(testHostIpAddress)).collect(Collectors.toList()); + printInfoMessage(); + } + + /** + * Get JVM options required for this setup. + * + * @return array of JVM options + */ + public String[] getJvmOptions() { + return this.enabledModules.stream().flatMap(Module::getJvmOptions).toArray(String[]::new); + } + + private void printInfoMessage() { + if (LOGGER.isInfoEnabled()) { + LOGGER.info(getInfoMessage()); + } + } + + private String getInfoMessage() { + final StringBuilder messageBuilder = new StringBuilder("Udf Test Setup Configuration:\n"); + AVAILABLE_MODULES.forEach(module -> { + messageBuilder.append(module.getModulePropertyName()); + messageBuilder.append(":\t"); + messageBuilder.append(module.isEnabled() ? "enabled" : "disabled"); + messageBuilder.append("\n"); + }); + return messageBuilder.toString(); + } +} diff --git a/src/main/java/com/exasol/udfdebugging/modules/AbstractModuleFactory.java b/src/main/java/com/exasol/udfdebugging/modules/AbstractModuleFactory.java new file mode 100644 index 0000000..9bc0bfc --- /dev/null +++ b/src/main/java/com/exasol/udfdebugging/modules/AbstractModuleFactory.java @@ -0,0 +1,30 @@ +package com.exasol.udfdebugging.modules; + +import com.exasol.udfdebugging.Module; +import com.exasol.udfdebugging.ModuleFactory; + +/** + * Abstract basis for {@link Module}. + */ +public abstract class AbstractModuleFactory implements ModuleFactory { + private final String moduleProperty; + + /** + * Create a new instance of {@link AbstractModuleFactory}. + * + * @param moduleName name of the module + */ + protected AbstractModuleFactory(final String moduleName) { + this.moduleProperty = "test." + moduleName; + } + + @Override + public final boolean isEnabled() { + return System.getProperty(this.moduleProperty, "false").equals("true"); + } + + @Override + public String getModulePropertyName() { + return this.moduleProperty; + } +} diff --git a/src/main/java/com/exasol/udfdebugging/modules/debugging/DebuggingModule.java b/src/main/java/com/exasol/udfdebugging/modules/debugging/DebuggingModule.java new file mode 100644 index 0000000..542c380 --- /dev/null +++ b/src/main/java/com/exasol/udfdebugging/modules/debugging/DebuggingModule.java @@ -0,0 +1,25 @@ +package com.exasol.udfdebugging.modules.debugging; + +import java.util.stream.Stream; + +import com.exasol.udfdebugging.Module; + +public class DebuggingModule implements Module { + public static final String DEBUGGING_PORT = "8000"; + private final String testHostIpAddress; + + /** + * Create a new instance of {@link DebuggingModule}. + * + * @param testHostIpAddress IP address of the host running this UDF Test Setup under which UDFs can reach it + */ + public DebuggingModule(final String testHostIpAddress) { + this.testHostIpAddress = testHostIpAddress; + } + + @Override + public Stream getJvmOptions() { + return Stream.of("-agentlib:jdwp=transport=dt_socket,server=n,address=" + this.testHostIpAddress + ":" + + DEBUGGING_PORT + ",suspend=y"); + } +} diff --git a/src/main/java/com/exasol/udfdebugging/modules/debugging/DebuggingModuleFactory.java b/src/main/java/com/exasol/udfdebugging/modules/debugging/DebuggingModuleFactory.java new file mode 100644 index 0000000..ed17793 --- /dev/null +++ b/src/main/java/com/exasol/udfdebugging/modules/debugging/DebuggingModuleFactory.java @@ -0,0 +1,18 @@ +package com.exasol.udfdebugging.modules.debugging; + +import com.exasol.udfdebugging.Module; +import com.exasol.udfdebugging.modules.AbstractModuleFactory; + +public class DebuggingModuleFactory extends AbstractModuleFactory { + /** + * Create a new instance of {@link DebuggingModuleFactory}. + */ + public DebuggingModuleFactory() { + super("debug"); + } + + @Override + public Module buildModule(final String testHostIpAddress) { + return new DebuggingModule(testHostIpAddress); + } +} diff --git a/src/test/java/com/exasol/udfdebugging/UdfTestSetupTest.java b/src/test/java/com/exasol/udfdebugging/UdfTestSetupTest.java new file mode 100644 index 0000000..f4c4783 --- /dev/null +++ b/src/test/java/com/exasol/udfdebugging/UdfTestSetupTest.java @@ -0,0 +1,39 @@ +package com.exasol.udfdebugging; + +import static org.hamcrest.CoreMatchers.hasItem; +import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.MatcherAssert.assertThat; + +import java.util.Arrays; +import java.util.List; + +import org.junit.jupiter.api.Test; + +class UdfTestSetupTest { + public static final String DEBUG_PROPERTY = "test.debug"; + private static final String EXPECTED_DEBUG_JVM_OPTION = "-agentlib:jdwp=transport=dt_socket,server=n,address=1.2.3.4:8000,suspend=y"; + + @Test + void testDebuggingEnabled() { + System.setProperty(DEBUG_PROPERTY, "true"); + final UdfTestSetup udfTestSetup = new UdfTestSetup("1.2.3.4"); + final List jvmOptions = Arrays.asList(udfTestSetup.getJvmOptions()); + assertThat(jvmOptions, hasItem(EXPECTED_DEBUG_JVM_OPTION)); + } + + @Test + void testDebuggingIsDisabledByDefault() { + System.clearProperty(DEBUG_PROPERTY); + final UdfTestSetup udfTestSetup = new UdfTestSetup("1.2.3.4"); + final List jvmOptions = Arrays.asList(udfTestSetup.getJvmOptions()); + assertThat(jvmOptions, not(hasItem(EXPECTED_DEBUG_JVM_OPTION))); + } + + @Test + void testDebuggingDisabled() { + System.setProperty(DEBUG_PROPERTY, "false"); + final UdfTestSetup udfTestSetup = new UdfTestSetup("1.2.3.4"); + final List jvmOptions = Arrays.asList(udfTestSetup.getJvmOptions()); + assertThat(jvmOptions, not(hasItem(EXPECTED_DEBUG_JVM_OPTION))); + } +} \ No newline at end of file From 2e0421e8c1994ac30230089ab8d2f7af77e3f59e Mon Sep 17 00:00:00 2001 From: jakobbraun Date: Mon, 23 Nov 2020 09:45:57 +0100 Subject: [PATCH 02/37] #10: Added a module for code coverage in UDFs (#12) * #10: Added a module for code coverage in UDFs Co-authored-by: Muhammet Orazov --- .../{maven.yml => dependencies_check.yml} | 10 +- .github/workflows/maven_central_release.yml | 25 ++++ NOTICE | 21 ++- README.md | 12 +- doc/changes/changelog.md | 1 + doc/changes/changes_0.3.0.md | 20 +++ pom.xml | 91 ++++++++++--- .../java/com/exasol/udfdebugging/Module.java | 8 ++ .../exasol/udfdebugging/ModuleFactory.java | 5 +- .../com/exasol/udfdebugging/UdfTestSetup.java | 11 +- .../modules/coverage/CoverageModule.java | 65 ++++++++++ .../coverage/CoverageModuleFactory.java | 20 +++ .../modules/coverage/JacocoServer.java | 122 ++++++++++++++++++ .../debugging/DebuggingModuleFactory.java | 3 +- .../exasol/udfdebugging/UdfTestSetupTest.java | 34 +++-- .../modules/coverage/CoverageModuleIT.java | 83 ++++++++++++ .../modules/coverage/CoverageModuleTest.java | 35 +++++ versionsMavenPluginRules.xml | 15 ++- 18 files changed, 532 insertions(+), 49 deletions(-) rename .github/workflows/{maven.yml => dependencies_check.yml} (61%) create mode 100644 .github/workflows/maven_central_release.yml create mode 100644 doc/changes/changes_0.3.0.md create mode 100644 src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModule.java create mode 100644 src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleFactory.java create mode 100644 src/main/java/com/exasol/udfdebugging/modules/coverage/JacocoServer.java create mode 100644 src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleIT.java create mode 100644 src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleTest.java diff --git a/.github/workflows/maven.yml b/.github/workflows/dependencies_check.yml similarity index 61% rename from .github/workflows/maven.yml rename to .github/workflows/dependencies_check.yml index 2a4f4d9..2cb0303 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/dependencies_check.yml @@ -1,6 +1,3 @@ -# This workflow will build a Java project with Maven -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven - name: Dependencies Check on: @@ -17,5 +14,12 @@ jobs: uses: actions/setup-java@v1 with: java-version: 11 + - name: Cache local Maven repository + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- - name: Checking dependencies for vulnerabilities run: mvn org.sonatype.ossindex.maven:ossindex-maven-plugin:audit -f pom.xml \ No newline at end of file diff --git a/.github/workflows/maven_central_release.yml b/.github/workflows/maven_central_release.yml new file mode 100644 index 0000000..09757aa --- /dev/null +++ b/.github/workflows/maven_central_release.yml @@ -0,0 +1,25 @@ +name: Maven Central Release + +on: + workflow_dispatch: + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Maven Central Repository + uses: actions/setup-java@v1 + with: + java-version: 11 + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + - name: Import GPG Key + run: + gpg --import --batch <(echo "${{ secrets.OSSRH_GPG_SECRET_KEY }}") + - name: Publish to Central Repository + env: + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} + run: mvn clean -Dgpg.skip=false -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} deploy \ No newline at end of file diff --git a/NOTICE b/NOTICE index ea37de8..5bdd8ee 100644 --- a/NOTICE +++ b/NOTICE @@ -4,14 +4,20 @@ This project has the following dependencies: asm-analysis under BSD-3-Clause asm-commons under BSD-3-Clause asm-tree under BSD-3-Clause + Byte Buddy (without dependencies) under Apache License, Version 2.0 + Byte Buddy agent under Apache License, Version 2.0 + docker-java-api under The Apache Software License, Version 2.0 + docker-java-transport under The Apache Software License, Version 2.0 + docker-java-transport-zerodep under The Apache Software License, Version 2.0 Duct Tape under MIT + error-reporting-java under MIT + Exasol Database fundamentals for Java under MIT EXASolution JDBC Driver under EXAClient License + Hamcrest All under New BSD License Hamcrest Core under New BSD License - JaCoCo :: Agent under Eclipse Public License 2.0 + Jackson-annotations under The Apache Software License, Version 2.0 JaCoCo :: Core under Eclipse Public License 2.0 Java Native Access under LGPL, version 2.1 or Apache License v2.0 - Java Native Access Platform under LGPL, version 2.1 or Apache License v2.0 - JetBrains Java Annotations under The Apache Software License, Version 2.0 JSR 374 (JSON Processing) API under Dual license consisting of the CDDL v1.1 and GPL v2 JUnit under Eclipse Public License 1.0 JUnit Jupiter API under Eclipse Public License v2.0 @@ -22,15 +28,16 @@ This project has the following dependencies: JUnit Platform Launcher under Eclipse Public License v2.0 JUnit Platform Runner under Eclipse Public License v2.0 JUnit Platform Suite API under Eclipse Public License v2.0 - junixsocket-common under Apache License, Version 2.0 - junixsocket-native-common under Apache License, Version 2.0 - Native Library Loader under CC0 1.0 Universal License + mockito-core under The MIT License + MySQL Connector/J under The GNU General Public License, v2 with FOSS exception + Objenesis under Apache License, Version 2.0 org.apiguardian:apiguardian-api under The Apache License, Version 2.0 org.opentest4j:opentest4j under The Apache License, Version 2.0 + Protocol Buffers [Core] under 3-Clause BSD License SLF4J API Module under MIT License SLF4J JDK14 Binding under MIT License - TCP to Unix Socket Proxy under MIT Test containers for Exasol on Docker under MIT + Test Database Builder for Java under MIT Testcontainers :: Database-Commons under MIT Testcontainers :: JDBC under MIT Testcontainers :: JUnit Jupiter Extension under MIT diff --git a/README.md b/README.md index e1ef18c..8629353 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,9 @@ You can get the dependency declaration by clicking the maven badge above. Typically, you use this package together with [test-db-builder-java](https://github.com/exasol/test-db-builder-java) and [exasol-testcontainers](https://github.com/exasol/exasol-testcontainers) as follows: ```java -final UdfTestSetup udfTestSetup = new UdfTestSetup(getTestHostIp()); + +private static final ExasolContainer> EXASOL = new ExasolContainer<>(); +final UdfTestSetup udfTestSetup = new UdfTestSetup(getTestHostIp(), EXASOL.getDefaultBucket()); final ExasolObjectFactory testDbBuilder = new ExasolObjectFactory(EXASOL.createConnection(), ExasolObjectConfiguration.builder().withJvmOptions(udfTestSetup.getJvmOptions()).build()); ``` @@ -32,6 +34,14 @@ System property: `test.debug` This module instructs the UDF JVMs to connect to a Java debugger listening on the default port 8000 on you machine, running the tests. +### Code Coverage + +System property: `test.coverage` + +This module installs a jacoco agent to the UDF JVM and receives the execution data using a TCP socket. + +This module requires additional maven configuration. Use the [project-keeper's](https://github.com/exasol/project-keeper-maven-plugin) `udf_coverage` module to verify it. + ## Additional Information diff --git a/doc/changes/changelog.md b/doc/changes/changelog.md index 39f13d8..d0cd40e 100644 --- a/doc/changes/changelog.md +++ b/doc/changes/changelog.md @@ -1,4 +1,5 @@ # Changes +* [0.3.0](changes_0.3.0.md) * [0.2.0](changes_0.2.0.md) * [0.1.0](changes_0.1.0.md) diff --git a/doc/changes/changes_0.3.0.md b/doc/changes/changes_0.3.0.md new file mode 100644 index 0000000..f8809cc --- /dev/null +++ b/doc/changes/changes_0.3.0.md @@ -0,0 +1,20 @@ +# udf-debugging-java 0.3.0, released 2020-11-23 + +Code name: Test setup for UDF code coverage + +## Features / Enhancements + +* #10: Added a module for code coverage in UDFs + +## Dependency Updates: + +* Updated to `com:exasol:project-keeper-maven-plugin:0.3.0` (was 0.2.0) +* Added `com.exasol:error-reporting-java:0.2.0` +* Added `org.jacoco:org.jacoco.core:0.8.6` +* Added `com.exasol:exasol-testcontainers:3.3.1` +* Added `org.mockito:mockito-core:3.6.0` +* Added `org.hamcrest:hamcrest-all:1.3` +* Added `com.exasol:test-db-builder-java:2.0.0` +* Updated to `org.jacoco:jacoco-maven-plugin:0.8.6` (was 0.8.5) +* Added `org.sonatype.plugins:nexus-staging-maven-plugin:1.6.8` +* Updated `org.jacoco:org.jacoco.agent0.8.6` (was 0.8.5) \ No newline at end of file diff --git a/pom.xml b/pom.xml index ddfd4ba..d8103e5 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.exasol udf-debugging-java - 0.2.0 + 0.3.0 udf-debugging-java Utilities for debugging, profiling and code coverage measure for UDFs. https://github.com/exasol/udf-debugging-javat @@ -14,9 +14,9 @@ 11 5.6.2 1.6.2 - 0.8.5 11.0.0 true + 0.8.6 1.14.3 3.0.0-M4 @@ -76,6 +76,30 @@ javax.json-api 1.1.4 + + com.exasol + error-reporting-java + 0.2.0 + + + org.jacoco + org.jacoco.core + ${jacoco.version} + + + org.jacoco + org.jacoco.agent + ${jacoco.version} + runtime + test + + + + com.exasol + exasol-testcontainers + 3.3.1 + org.junit.jupiter @@ -95,31 +119,29 @@ ${junit.version} test - - com.exasol - exasol-testcontainers - 3.2.0 + org.mockito + mockito-core + 3.6.0 test - org.testcontainers - junit-jupiter - ${org.testcontainers.version} + org.hamcrest + hamcrest-all + 1.3 test + - org.jacoco - org.jacoco.agent - ${jacoco.version} - runtime + org.testcontainers + junit-jupiter + ${org.testcontainers.version} test - org.jacoco - org.jacoco.core - ${jacoco.version} - test + com.exasol + test-db-builder-java + 2.0.0 org.slf4j @@ -324,6 +346,12 @@ + + + + 7ea56ad4-8a8b-4e51-8ed9-5aad83d8efb1 + + org.apache.maven.plugins @@ -348,7 +376,7 @@ com.exasol project-keeper-maven-plugin - 0.2.0 + 0.3.0 @@ -358,6 +386,7 @@ + maven_central @@ -382,6 +411,32 @@ --> + + org.apache.maven.plugins + maven-deploy-plugin + + true + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.8 + + true + ossrh + https://oss.sonatype.org/ + + + + default-deploy + deploy + + deploy + + + + diff --git a/src/main/java/com/exasol/udfdebugging/Module.java b/src/main/java/com/exasol/udfdebugging/Module.java index dedaa92..52331f3 100644 --- a/src/main/java/com/exasol/udfdebugging/Module.java +++ b/src/main/java/com/exasol/udfdebugging/Module.java @@ -2,7 +2,15 @@ import java.util.stream.Stream; +/** + * Modules define a specific functionality that users can enable using system properties. + */ public interface Module { + /** + * Get JVM options required by this module. + * + * @return JVM options + */ public Stream getJvmOptions(); } diff --git a/src/main/java/com/exasol/udfdebugging/ModuleFactory.java b/src/main/java/com/exasol/udfdebugging/ModuleFactory.java index 1a671e1..8bcec20 100644 --- a/src/main/java/com/exasol/udfdebugging/ModuleFactory.java +++ b/src/main/java/com/exasol/udfdebugging/ModuleFactory.java @@ -1,5 +1,7 @@ package com.exasol.udfdebugging; +import com.exasol.bucketfs.Bucket; + public interface ModuleFactory { /** @@ -20,7 +22,8 @@ public interface ModuleFactory { * Build the {@link Module}. * * @param testHostIpAddress IP address of the host running this UDF Test Setup under which UDFs can reach it + * @param bucket BucketFS bucket to upload resource to * @return built {@link Module} */ - public Module buildModule(final String testHostIpAddress); + public Module buildModule(final String testHostIpAddress, Bucket bucket); } diff --git a/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java b/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java index 581430a..20b2ca2 100644 --- a/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java +++ b/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java @@ -6,13 +6,16 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.exasol.bucketfs.Bucket; +import com.exasol.udfdebugging.modules.coverage.CoverageModuleFactory; import com.exasol.udfdebugging.modules.debugging.DebuggingModuleFactory; /** * Test setup for testing UDFs in the database. */ public class UdfTestSetup { - private static final List AVAILABLE_MODULES = List.of(new DebuggingModuleFactory()); + private static final List AVAILABLE_MODULES = List.of(new DebuggingModuleFactory(), + new CoverageModuleFactory()); private static final Logger LOGGER = LoggerFactory.getLogger(UdfTestSetup.class); private final List enabledModules; @@ -20,10 +23,12 @@ public class UdfTestSetup { * Create a new instance of {@link UdfTestSetup}. * * @param testHostIpAddress IP address of the host running this UDF Test Setup under which UDFs can reach it + * @param bucket BucketFS bucket to upload resource to */ - public UdfTestSetup(final String testHostIpAddress) { + public UdfTestSetup(final String testHostIpAddress, final Bucket bucket) { this.enabledModules = AVAILABLE_MODULES.stream().filter(ModuleFactory::isEnabled) - .map(moduleFactory -> moduleFactory.buildModule(testHostIpAddress)).collect(Collectors.toList()); + .map(moduleFactory -> moduleFactory.buildModule(testHostIpAddress, bucket)) + .collect(Collectors.toList()); printInfoMessage(); } diff --git a/src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModule.java b/src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModule.java new file mode 100644 index 0000000..05eeea3 --- /dev/null +++ b/src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModule.java @@ -0,0 +1,65 @@ +package com.exasol.udfdebugging.modules.coverage; + +import java.nio.file.Path; +import java.util.concurrent.TimeoutException; +import java.util.stream.Stream; + +import com.exasol.bucketfs.Bucket; +import com.exasol.bucketfs.BucketAccessException; +import com.exasol.errorreporting.ExaError; +import com.exasol.udfdebugging.Module; + +/** + * {@link Module} for measuring code coverage in UDFs. + */ +public class CoverageModule implements Module { + private static final String JACOCO_AGENT_NAME = "org.jacoco.agent-runtime.jar"; + private static final Path JACOCO_AGENT_PATH = Path.of("target", "jacoco-agent", JACOCO_AGENT_NAME); + private final String jvmOption; + + /** + * Create a new instance of {@link CoverageModule}. + * + * @param testHostIpAddress IP address of the test host from inside of the database + * @param bucket Bucket to upload the agent to + */ + public CoverageModule(final String testHostIpAddress, final Bucket bucket) { + assertJacocoAgentExists(); + uploadAgentToBucketFs(bucket); + JacocoServer.startIfNotRunning(); + this.jvmOption = "-javaagent:/buckets/" + bucket.getBucketFsName() + "/" + bucket.getBucketName() + "/" + + JACOCO_AGENT_NAME + "=output=tcpclient,address=" + testHostIpAddress + ",port=" + JacocoServer.PORT; + } + + private void assertJacocoAgentExists() { + if (!JACOCO_AGENT_PATH.toFile().exists()) { + throw new IllegalArgumentException(ExaError.messageBuilder("E-UDJ-1") + .message( + "Could not find jacoco agent ({{PATH}}). The agent should we generated by the maven build.") + .parameter("PATH", JACOCO_AGENT_PATH.toString()) + .mitigation("Add the 'udf_coverage' module to the project-keeper plugin.").toString()); + } + } + + @Override + public Stream getJvmOptions() { + return Stream.of(this.jvmOption); + } + + private void uploadAgentToBucketFs(final Bucket bucket) { + try { + bucket.uploadFile(JACOCO_AGENT_PATH, JACOCO_AGENT_NAME); + } catch (final TimeoutException | BucketAccessException exception) { + throw getUploadFailedException(exception); + } catch (final InterruptedException exception) { + Thread.currentThread().interrupt(); + throw getUploadFailedException(exception); + } + } + + private IllegalStateException getUploadFailedException(final Exception exception) { + return new IllegalStateException( + ExaError.messageBuilder("E-UDJ-5").message("Failed to upload jacoco agent to BucketFS.").toString(), + exception); + } +} diff --git a/src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleFactory.java b/src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleFactory.java new file mode 100644 index 0000000..fcace89 --- /dev/null +++ b/src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleFactory.java @@ -0,0 +1,20 @@ +package com.exasol.udfdebugging.modules.coverage; + +import com.exasol.bucketfs.Bucket; +import com.exasol.udfdebugging.Module; +import com.exasol.udfdebugging.modules.AbstractModuleFactory; + +public class CoverageModuleFactory extends AbstractModuleFactory { + + /** + * Create a new instance of {@link CoverageModuleFactory}. + */ + public CoverageModuleFactory() { + super("coverage"); + } + + @Override + public Module buildModule(final String testHostIpAddress, final Bucket bucket) { + return new CoverageModule(testHostIpAddress, bucket); + } +} diff --git a/src/main/java/com/exasol/udfdebugging/modules/coverage/JacocoServer.java b/src/main/java/com/exasol/udfdebugging/modules/coverage/JacocoServer.java new file mode 100644 index 0000000..f80f868 --- /dev/null +++ b/src/main/java/com/exasol/udfdebugging/modules/coverage/JacocoServer.java @@ -0,0 +1,122 @@ +package com.exasol.udfdebugging.modules.coverage; + +/* + * ***************************************************************************** + * Modified example from {@link https://raw.githubusercontent.com/jacoco/jacoco/master/org.jacoco.examples/src/org/jacoco/examples/ExecutionDataServer.java} + * + * Original license: + * + * Copyright (c) 2009, 2020 Mountainminds GmbH & Co. KG and Contributors + * This program and the accompanying materials are made available under + * the terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Marc R. Hoffmann - initial API and implementation + * + *******************************************************************************/ + +import java.io.FileOutputStream; +import java.io.IOException; +import java.net.ServerSocket; +import java.net.Socket; +import java.nio.file.Path; + +import org.jacoco.core.data.*; +import org.jacoco.core.runtime.RemoteControlReader; +import org.jacoco.core.runtime.RemoteControlWriter; + +import com.exasol.errorreporting.ExaError; + +/** + * This class starts a socket server to collect the code coverage data from the jacoco agent in the udfs. The collected + * data is dumped to a local file. + */ +final class JacocoServer implements Runnable { + + static final int PORT = 3002; + static final Path COVERAGE_REPORT_PATH = Path.of("target", "jacoco-udf.exec"); + private static JacocoServer instance; + private final ExecutionDataWriter fileWriter; + + private JacocoServer() throws IOException { + this.fileWriter = new ExecutionDataWriter(new FileOutputStream(COVERAGE_REPORT_PATH.toFile())); + } + + static void startIfNotRunning() { + if (instance == null) { + try { + instance = new JacocoServer(); + new Thread(instance).start(); + } catch (final IOException exception) { + throw new IllegalStateException(ExaError.messageBuilder("E-UDJ-2") + .message("Failed to create jacoco log server thread.").toString(), exception); + } + } + } + + @SuppressWarnings("java:S2189") // while loop has no end condition since the server should run forever (until test + // are done) + @Override + public void run() { + try (final ServerSocket server = new ServerSocket(PORT)) { + while (true) { + final Handler handler = new Handler(server.accept(), this.fileWriter); + new Thread(handler).start(); + } + } catch (final IOException exception) { + throw new IllegalStateException( + ExaError.messageBuilder("E-UDJ-3").message("Failed to start jacoco log server.").toString(), + exception); + } + } + + private static class Handler implements Runnable, ISessionInfoVisitor, IExecutionDataVisitor { + + private final Socket socket; + private final RemoteControlReader reader; + private final ExecutionDataWriter fileWriter; + + Handler(final Socket socket, final ExecutionDataWriter fileWriter) throws IOException { + this.socket = socket; + this.fileWriter = fileWriter; + + // Just send a valid header: + new RemoteControlWriter(socket.getOutputStream()); + + this.reader = new RemoteControlReader(socket.getInputStream()); + this.reader.setSessionInfoVisitor(this); + this.reader.setExecutionDataVisitor(this); + } + + public void run() { + try { + while (this.reader.read()) { + // read everything so that visitors are invoked + } + this.socket.close(); + synchronized (this.fileWriter) { + this.fileWriter.flush(); + } + } catch (final IOException exception) { + throw new IllegalStateException( + ExaError.messageBuilder("E-UDJ-7").message("Failed to write jacoco report.").toString(), + exception); + } + } + + public void visitSessionInfo(final SessionInfo info) { + synchronized (this.fileWriter) { + this.fileWriter.visitSessionInfo(info); + } + } + + public void visitClassExecution(final ExecutionData data) { + synchronized (this.fileWriter) { + this.fileWriter.visitClassExecution(data); + } + } + } +} \ No newline at end of file diff --git a/src/main/java/com/exasol/udfdebugging/modules/debugging/DebuggingModuleFactory.java b/src/main/java/com/exasol/udfdebugging/modules/debugging/DebuggingModuleFactory.java index ed17793..4d7fbb7 100644 --- a/src/main/java/com/exasol/udfdebugging/modules/debugging/DebuggingModuleFactory.java +++ b/src/main/java/com/exasol/udfdebugging/modules/debugging/DebuggingModuleFactory.java @@ -1,5 +1,6 @@ package com.exasol.udfdebugging.modules.debugging; +import com.exasol.bucketfs.Bucket; import com.exasol.udfdebugging.Module; import com.exasol.udfdebugging.modules.AbstractModuleFactory; @@ -12,7 +13,7 @@ public DebuggingModuleFactory() { } @Override - public Module buildModule(final String testHostIpAddress) { + public Module buildModule(final String testHostIpAddress, final Bucket bucket) { return new DebuggingModule(testHostIpAddress); } } diff --git a/src/test/java/com/exasol/udfdebugging/UdfTestSetupTest.java b/src/test/java/com/exasol/udfdebugging/UdfTestSetupTest.java index f4c4783..73e03db 100644 --- a/src/test/java/com/exasol/udfdebugging/UdfTestSetupTest.java +++ b/src/test/java/com/exasol/udfdebugging/UdfTestSetupTest.java @@ -1,38 +1,56 @@ package com.exasol.udfdebugging; -import static org.hamcrest.CoreMatchers.hasItem; -import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.CoreMatchers.*; import static org.hamcrest.MatcherAssert.assertThat; +import static org.mockito.Mockito.mock; import java.util.Arrays; import java.util.List; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import com.exasol.bucketfs.Bucket; + class UdfTestSetupTest { + public static final String COVERAGE_PROPERTY = "test.coverage"; public static final String DEBUG_PROPERTY = "test.debug"; private static final String EXPECTED_DEBUG_JVM_OPTION = "-agentlib:jdwp=transport=dt_socket,server=n,address=1.2.3.4:8000,suspend=y"; + @BeforeEach + void before() { + System.clearProperty(DEBUG_PROPERTY); + System.clearProperty(COVERAGE_PROPERTY); + } + @Test void testDebuggingEnabled() { System.setProperty(DEBUG_PROPERTY, "true"); - final UdfTestSetup udfTestSetup = new UdfTestSetup("1.2.3.4"); + final UdfTestSetup udfTestSetup = new UdfTestSetup("1.2.3.4", mock(Bucket.class)); final List jvmOptions = Arrays.asList(udfTestSetup.getJvmOptions()); assertThat(jvmOptions, hasItem(EXPECTED_DEBUG_JVM_OPTION)); } @Test - void testDebuggingIsDisabledByDefault() { - System.clearProperty(DEBUG_PROPERTY); - final UdfTestSetup udfTestSetup = new UdfTestSetup("1.2.3.4"); + void testCoverageEnabled() { + System.setProperty(COVERAGE_PROPERTY, "true"); + final UdfTestSetup udfTestSetup = new UdfTestSetup("1.2.3.4", mock(Bucket.class)); final List jvmOptions = Arrays.asList(udfTestSetup.getJvmOptions()); - assertThat(jvmOptions, not(hasItem(EXPECTED_DEBUG_JVM_OPTION))); + assertThat(jvmOptions, hasItem( + "-javaagent:/buckets/null/null/org.jacoco.agent-runtime.jar=output=tcpclient,address=1.2.3.4,port=3002")); + } + + @Test + void testAllModulesAreDisabledByDefault() { + final UdfTestSetup udfTestSetup = new UdfTestSetup("1.2.3.4", mock(Bucket.class)); + final List jvmOptions = Arrays.asList(udfTestSetup.getJvmOptions()); + assertThat(jvmOptions.isEmpty(), equalTo(true)); } @Test void testDebuggingDisabled() { System.setProperty(DEBUG_PROPERTY, "false"); - final UdfTestSetup udfTestSetup = new UdfTestSetup("1.2.3.4"); + final UdfTestSetup udfTestSetup = new UdfTestSetup("1.2.3.4", mock(Bucket.class)); final List jvmOptions = Arrays.asList(udfTestSetup.getJvmOptions()); assertThat(jvmOptions, not(hasItem(EXPECTED_DEBUG_JVM_OPTION))); } diff --git a/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleIT.java b/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleIT.java new file mode 100644 index 0000000..b76660f --- /dev/null +++ b/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleIT.java @@ -0,0 +1,83 @@ +package com.exasol.udfdebugging.modules.coverage; + +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.MatcherAssert.assertThat; + +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.sql.Connection; +import java.sql.SQLException; +import java.util.Map; +import java.util.concurrent.atomic.AtomicInteger; + +import org.jacoco.core.data.ExecutionDataReader; +import org.junit.jupiter.api.Test; +import org.testcontainers.junit.jupiter.Container; +import org.testcontainers.junit.jupiter.Testcontainers; + +import com.exasol.containers.ExasolContainer; +import com.exasol.dbbuilder.dialects.exasol.ExasolObjectConfiguration; +import com.exasol.dbbuilder.dialects.exasol.ExasolObjectFactory; +import com.exasol.dbbuilder.dialects.exasol.ExasolSchema; +import com.exasol.dbbuilder.dialects.exasol.udf.UdfScript; +import com.exasol.errorreporting.ExaError; +import com.github.dockerjava.api.model.ContainerNetwork; + +@Testcontainers +class CoverageModuleIT { + @Container + private static final ExasolContainer> EXASOL = new ExasolContainer<>().withReuse(true); + private static final String SCHEMA_NAME = "TEST"; + private static final String UDF_NAME = "HELLO_WORLD"; + + private static String getTestHostIpFromInsideExasol() { + final Map networks = EXASOL.getContainerInfo().getNetworkSettings().getNetworks(); + if (networks.size() == 0) { + return null; + } + return networks.values().iterator().next().getGateway(); + } + + @Test + void testCoverageReportIsWritten() throws SQLException, IOException, InterruptedException { + deleteExecutionFile(); + final Connection connection = EXASOL.createConnection(); + final CoverageModule coverageModule = new CoverageModule(getTestHostIpFromInsideExasol(), + EXASOL.getDefaultBucket()); + final ExasolObjectFactory exasolObjectFactory = new ExasolObjectFactory(connection, ExasolObjectConfiguration + .builder().withJvmOptions(coverageModule.getJvmOptions().toArray(String[]::new)).build()); + final ExasolSchema schema = exasolObjectFactory.createSchema(SCHEMA_NAME); + schema.createUdfBuilder(UDF_NAME).inputType(UdfScript.InputType.SCALAR).language(UdfScript.Language.JAVA) + .content("class HELLO_WORLD {\n" + + " static String run(ExaMetadata exa, ExaIterator ctx) throws Exception {\n" + + " \treturn \"hello world\";\n" + " }\n" + "}") + .returns("VARCHAR(2000)").build(); + connection.createStatement().executeQuery("SELECT " + SCHEMA_NAME + "." + UDF_NAME + "()"); + assertThat(countReportedJacocoSessions(), equalTo(1)); + } + + private int countReportedJacocoSessions() throws IOException { + final AtomicInteger sessionCounter = new AtomicInteger(0); + try (final InputStream inputStream = new FileInputStream(JacocoServer.COVERAGE_REPORT_PATH.toFile())) { + final ExecutionDataReader reader = new ExecutionDataReader(inputStream); + reader.setSessionInfoVisitor(sessionInfo -> sessionCounter.addAndGet(1)); + reader.setExecutionDataVisitor(executionData -> { + }); + while (reader.read()) { + // just read everything to invoke the callbacks + } + } + return sessionCounter.get(); + } + + private void deleteExecutionFile() { + if (JacocoServer.COVERAGE_REPORT_PATH.toFile().exists()) { + JacocoServer.COVERAGE_REPORT_PATH.toFile().delete(); + } + if (JacocoServer.COVERAGE_REPORT_PATH.toFile().exists()) { + throw new IllegalStateException(ExaError.messageBuilder("E-UDJ-4") + .message("Failed to delete coverage file before test execution.").toString()); + } + } +} diff --git a/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleTest.java b/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleTest.java new file mode 100644 index 0000000..af844ba --- /dev/null +++ b/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleTest.java @@ -0,0 +1,35 @@ +package com.exasol.udfdebugging.modules.coverage; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.contains; +import static org.mockito.Mockito.*; + +import java.nio.file.Path; +import java.util.concurrent.TimeoutException; +import java.util.stream.Collectors; + +import org.junit.jupiter.api.Test; + +import com.exasol.bucketfs.Bucket; +import com.exasol.bucketfs.BucketAccessException; + +class CoverageModuleTest { + + @Test + void testUpload() throws InterruptedException, BucketAccessException, TimeoutException { + final Bucket bucket = mock(Bucket.class); + new CoverageModule("1.2.3.4", bucket); + verify(bucket).uploadFile(Path.of("target", "jacoco-agent", "org.jacoco.agent-runtime.jar"), + "org.jacoco.agent-runtime.jar"); + } + + @Test + void testGetJvmOptions() { + final Bucket bucket = mock(Bucket.class); + when(bucket.getBucketFsName()).thenReturn("my_bucketfs"); + when(bucket.getBucketName()).thenReturn("my_bucket"); + final CoverageModule coverageModule = new CoverageModule("1.2.3.4", bucket); + assertThat(coverageModule.getJvmOptions().collect(Collectors.toList()), contains( + "-javaagent:/buckets/my_bucketfs/my_bucket/org.jacoco.agent-runtime.jar=output=tcpclient,address=1.2.3.4,port=3002")); + } +} \ No newline at end of file diff --git a/versionsMavenPluginRules.xml b/versionsMavenPluginRules.xml index c566b42..35bd03d 100644 --- a/versionsMavenPluginRules.xml +++ b/versionsMavenPluginRules.xml @@ -4,13 +4,14 @@ xsi:schemaLocation="http://mojo.codehaus.org/versions-maven-plugin/rule/2.0.0 http://mojo.codehaus.org/versions-maven-plugin/xsd/rule-2.0.0.xsd"> - (?i).*Alpha(?:-?\d+)? - (?i).*a(?:-?\d+)? - (?i).*Beta(?:-?\d+)? - (?i).*-B(?:-?\d+)? - (?i).*RC(?:-?\d+)? - (?i).*CR(?:-?\d+)? - (?i).*M(?:-?\d+)? + (?i).*Alpha(?:-?[\d.]+)? + (?i).*a(?:-?[\d.]+)? + (?i).*Beta(?:-?[\d.]+)? + (?i).*-B(?:-?[\d.]+)? + (?i).*-b(?:-?[\d.]+)? + (?i).*RC(?:-?[\d.]+)? + (?i).*CR(?:-?[\d.]+)? + (?i).*M(?:-?[\d.]+)? From 2857bbc19aab74fa192e2eaaa873e06bb08d4a09 Mon Sep 17 00:00:00 2001 From: jakobbraun Date: Mon, 30 Nov 2020 14:24:28 +0100 Subject: [PATCH 03/37] Removed outdated excludeVulnerabilityIds (#14) --- pom.xml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pom.xml b/pom.xml index d8103e5..20acdbf 100644 --- a/pom.xml +++ b/pom.xml @@ -346,12 +346,6 @@ - - - - 7ea56ad4-8a8b-4e51-8ed9-5aad83d8efb1 - - org.apache.maven.plugins From c8562742a5486395b93eae46345f628770a0ba36 Mon Sep 17 00:00:00 2001 From: jakobbraun Date: Thu, 1 Apr 2021 10:12:11 -0300 Subject: [PATCH 04/37] #15: Add API for host port proxy (#16) * #15: Add API for host port proxy --- .github/workflows/broken_links_checker.yml | 17 +++++ .github/workflows/github_release.yml | 36 ---------- ...elease_droid_prepare_original_checksum.yml | 32 +++++++++ .../release_droid_print_quick_checksum.yml | 27 ++++++++ ...elease_droid_release_on_maven_central.yml} | 14 +++- ...ase_droid_upload_github_release_assets.yml | 33 ++++++++++ assembly/all-dependencies.xml | 22 ------- doc/changes/changelog.md | 1 + doc/changes/changes_0.4.0.md | 29 ++++++++ pom.xml | 66 +++++++++++-------- .../udfdebugging/ExposedServiceAddress.java | 38 +++++++++++ .../udfdebugging/LocalServiceExposer.java | 16 +++++ .../exasol/udfdebugging/ModuleFactory.java | 6 +- .../com/exasol/udfdebugging/UdfTestSetup.java | 14 +++- .../modules/coverage/CoverageModule.java | 12 ++-- .../coverage/CoverageModuleFactory.java | 5 +- .../modules/debugging/DebuggingModule.java | 17 +++-- .../debugging/DebuggingModuleFactory.java | 5 +- .../modules/coverage/CoverageModuleIT.java | 23 ++----- .../modules/coverage/CoverageModuleTest.java | 6 +- src/test/resources/logging.properties | 2 +- 21 files changed, 292 insertions(+), 129 deletions(-) create mode 100644 .github/workflows/broken_links_checker.yml delete mode 100644 .github/workflows/github_release.yml create mode 100644 .github/workflows/release_droid_prepare_original_checksum.yml create mode 100644 .github/workflows/release_droid_print_quick_checksum.yml rename .github/workflows/{maven_central_release.yml => release_droid_release_on_maven_central.yml} (61%) create mode 100644 .github/workflows/release_droid_upload_github_release_assets.yml delete mode 100644 assembly/all-dependencies.xml create mode 100644 doc/changes/changes_0.4.0.md create mode 100644 src/main/java/com/exasol/udfdebugging/ExposedServiceAddress.java create mode 100644 src/main/java/com/exasol/udfdebugging/LocalServiceExposer.java diff --git a/.github/workflows/broken_links_checker.yml b/.github/workflows/broken_links_checker.yml new file mode 100644 index 0000000..6697080 --- /dev/null +++ b/.github/workflows/broken_links_checker.yml @@ -0,0 +1,17 @@ +name: Broken Links Checker + +on: + schedule: + - cron: "0 5 * * *" + push: + +jobs: + linkChecker: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: lychee Link Checker + id: lc + uses: lycheeverse/lychee-action@v1.0.6 + - name: Fail if there were link errors + run: exit ${{ steps.lc.outputs.exit_code }} \ No newline at end of file diff --git a/.github/workflows/github_release.yml b/.github/workflows/github_release.yml deleted file mode 100644 index 3afc904..0000000 --- a/.github/workflows/github_release.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: GitHub Release - -on: - workflow_dispatch: - inputs: - upload_url: - description: 'Upload URL' - required: true - asset_name: - description: 'Asset file name' - required: true - asset_path: - description: 'Asset file path' - required: true - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 11 - uses: actions/setup-java@v1 - with: - java-version: 11 - - name: Build with Maven - run: mvn -B clean package --file pom.xml - - - name: Upload Release Asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ github.event.inputs.upload_url }} - asset_path: ${{ github.event.inputs.asset_path }} - asset_name: ${{ github.event.inputs.asset_name }} - asset_content_type: application/java-archive \ No newline at end of file diff --git a/.github/workflows/release_droid_prepare_original_checksum.yml b/.github/workflows/release_droid_prepare_original_checksum.yml new file mode 100644 index 0000000..d4e1866 --- /dev/null +++ b/.github/workflows/release_droid_prepare_original_checksum.yml @@ -0,0 +1,32 @@ +name: Release Droid - Prepare Original Checksum + +on: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout the repository + uses: actions/checkout@v2 + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Cache local Maven repository + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Run tests and build with Maven + run: mvn -B clean verify --file pom.xml + - name: Prepare checksum + run: find target -maxdepth 1 -name *.jar -exec sha256sum "{}" + > original_checksum + - name: Upload checksum to the artifactory + uses: actions/upload-artifact@v2 + with: + name: original_checksum + retention-days: 5 + path: original_checksum \ No newline at end of file diff --git a/.github/workflows/release_droid_print_quick_checksum.yml b/.github/workflows/release_droid_print_quick_checksum.yml new file mode 100644 index 0000000..bc91c61 --- /dev/null +++ b/.github/workflows/release_droid_print_quick_checksum.yml @@ -0,0 +1,27 @@ +name: Release Droid - Print Quick Checksum + +on: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout the repository + uses: actions/checkout@v2 + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Cache local Maven repository + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Build with Maven skipping tests + run: mvn -B clean verify -DskipTests + - name: Print checksum + run: echo 'checksum_start==';find target -maxdepth 1 -name *.jar -exec sha256sum "{}" + | xargs;echo '==checksum_end' + diff --git a/.github/workflows/maven_central_release.yml b/.github/workflows/release_droid_release_on_maven_central.yml similarity index 61% rename from .github/workflows/maven_central_release.yml rename to .github/workflows/release_droid_release_on_maven_central.yml index 09757aa..28f9ba3 100644 --- a/.github/workflows/maven_central_release.yml +++ b/.github/workflows/release_droid_release_on_maven_central.yml @@ -1,4 +1,4 @@ -name: Maven Central Release +name: Release Droid - Release On Maven Central on: workflow_dispatch: @@ -7,7 +7,8 @@ jobs: publish: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - name: Checkout the repository + uses: actions/checkout@v2 - name: Set up Maven Central Repository uses: actions/setup-java@v1 with: @@ -18,8 +19,15 @@ jobs: - name: Import GPG Key run: gpg --import --batch <(echo "${{ secrets.OSSRH_GPG_SECRET_KEY }}") + - name: Cache local Maven repository + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- - name: Publish to Central Repository env: MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} - run: mvn clean -Dgpg.skip=false -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} deploy \ No newline at end of file + run: mvn clean -Dgpg.skip=false -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} -DskipTests deploy \ No newline at end of file diff --git a/.github/workflows/release_droid_upload_github_release_assets.yml b/.github/workflows/release_droid_upload_github_release_assets.yml new file mode 100644 index 0000000..d977542 --- /dev/null +++ b/.github/workflows/release_droid_upload_github_release_assets.yml @@ -0,0 +1,33 @@ +name: Release Droid - Upload GitHub Release Assets + +on: + workflow_dispatch: + inputs: + upload_url: + description: 'Assets upload URL' + required: true + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout the repository + uses: actions/checkout@v2 + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Cache local Maven repository + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Build with Maven skipping tests + run: mvn clean verify -DskipTests + - name: Upload assets to the GitHub release draft + uses: shogo82148/actions-upload-release-asset@v1 + with: + upload_url: ${{ github.event.inputs.upload_url }} + asset_path: target/*.jar \ No newline at end of file diff --git a/assembly/all-dependencies.xml b/assembly/all-dependencies.xml deleted file mode 100644 index efe5abc..0000000 --- a/assembly/all-dependencies.xml +++ /dev/null @@ -1,22 +0,0 @@ - - all-dependencies - - jar - - false - - - - metaInf-services - - - - - true - runtime - / - - - diff --git a/doc/changes/changelog.md b/doc/changes/changelog.md index d0cd40e..065a25c 100644 --- a/doc/changes/changelog.md +++ b/doc/changes/changelog.md @@ -1,5 +1,6 @@ # Changes +* [0.4.0](changes_0.4.0.md) * [0.3.0](changes_0.3.0.md) * [0.2.0](changes_0.2.0.md) * [0.1.0](changes_0.1.0.md) diff --git a/doc/changes/changes_0.4.0.md b/doc/changes/changes_0.4.0.md new file mode 100644 index 0000000..b101ad1 --- /dev/null +++ b/doc/changes/changes_0.4.0.md @@ -0,0 +1,29 @@ +# udf-debugging-java 0.4.0, released 2021-XX-XX + +Code name: + +## Features / Enhancements + +* #15: Add API for host port proxy + +## Dependency Updates + +### Compile Dependency Updates + +* Updated `com.exasol:error-reporting-java:0.2.0` to `0.4.0` +* Updated `com.exasol:exasol-testcontainers:3.3.1` to `3.5.1` +* Updated `com.exasol:test-db-builder-java:2.0.0` to `3.1.1` + +### Test Dependency Updates + +* Updated `org.junit.jupiter:junit-jupiter-engine:5.6.2` to `5.7.1` +* Updated `org.junit.jupiter:junit-jupiter-params:5.6.2` to `5.7.1` +* Updated `org.junit.platform:junit-platform-runner:1.6.2` to `1.7.1` +* Updated `org.mockito:mockito-core:3.6.0` to `3.8.0` +* Updated `org.testcontainers:junit-jupiter:1.14.3` to `1.15.2` + +### Plugin Dependency Updates + +* Added `com.exasol:error-code-crawler-maven-plugin:0.1.1` +* Updated `com.exasol:project-keeper-maven-plugin:0.3.0` to `0.6.0` +* Added `io.github.zlika:reproducible-build-maven-plugin:0.13` diff --git a/pom.xml b/pom.xml index 20acdbf..5dcc7a1 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.exasol udf-debugging-java - 0.3.0 + 0.4.0 udf-debugging-java Utilities for debugging, profiling and code coverage measure for UDFs. https://github.com/exasol/udf-debugging-javat @@ -12,12 +12,12 @@ UTF-8 UTF-8 11 - 5.6.2 - 1.6.2 + 5.7.1 + 1.7.1 11.0.0 true 0.8.6 - 1.14.3 + 1.15.2 3.0.0-M4 @@ -79,7 +79,7 @@ com.exasol error-reporting-java - 0.2.0 + 0.4.0 org.jacoco @@ -98,7 +98,7 @@ com.exasol exasol-testcontainers - 3.3.1 + 3.5.1 @@ -122,7 +122,7 @@ org.mockito mockito-core - 3.6.0 + 3.8.0 test @@ -141,7 +141,7 @@ com.exasol test-db-builder-java - 2.0.0 + 3.1.1 org.slf4j @@ -197,12 +197,7 @@ prepare-agent - - prepare-agent-integration - - prepare-agent-integration - - + report test @@ -210,13 +205,7 @@ report - - report-integration - verify - - report-integration - - + report-udf-integration verify @@ -305,13 +294,6 @@ true true true - - - implNote - Implementation Note: - a - - @@ -370,7 +352,7 @@ com.exasol project-keeper-maven-plugin - 0.3.0 + 0.6.0 @@ -431,6 +413,32 @@ + + com.exasol + error-code-crawler-maven-plugin + 0.1.1 + + + + verify + + + + + + io.github.zlika + reproducible-build-maven-plugin + 0.13 + + + strip-jar + package + + strip-jar + + + + diff --git a/src/main/java/com/exasol/udfdebugging/ExposedServiceAddress.java b/src/main/java/com/exasol/udfdebugging/ExposedServiceAddress.java new file mode 100644 index 0000000..5b12ce3 --- /dev/null +++ b/src/main/java/com/exasol/udfdebugging/ExposedServiceAddress.java @@ -0,0 +1,38 @@ +package com.exasol.udfdebugging; + +/** + * This class describes the address of a proxy for ports of the test host. + */ +public class ExposedServiceAddress { + private final String hostName; + private final int port; + + /** + * Create a new instance of {@link ExposedServiceAddress}. + * + * @param hostName host name of the proxy + * @param port port number + */ + public ExposedServiceAddress(final String hostName, final int port) { + this.hostName = hostName; + this.port = port; + } + + /** + * Get the host name of the proxy. + * + * @return host name + */ + public String getHostName() { + return this.hostName; + } + + /** + * Get the port number of the proxy. + * + * @return port number + */ + public int getPort() { + return this.port; + } +} diff --git a/src/main/java/com/exasol/udfdebugging/LocalServiceExposer.java b/src/main/java/com/exasol/udfdebugging/LocalServiceExposer.java new file mode 100644 index 0000000..a923e37 --- /dev/null +++ b/src/main/java/com/exasol/udfdebugging/LocalServiceExposer.java @@ -0,0 +1,16 @@ +package com.exasol.udfdebugging; + +/** + * Implementors of this interface exposes a local service (socket) into the Exasol database. + */ +@FunctionalInterface +public interface LocalServiceExposer { + + /** + * Get the address for the network scope inside of the Exasol database for a given local service. + * + * @param port port number + * @return proxy + */ + ExposedServiceAddress exposeLocalServiceToDatabase(int port); +} diff --git a/src/main/java/com/exasol/udfdebugging/ModuleFactory.java b/src/main/java/com/exasol/udfdebugging/ModuleFactory.java index 8bcec20..33c21ef 100644 --- a/src/main/java/com/exasol/udfdebugging/ModuleFactory.java +++ b/src/main/java/com/exasol/udfdebugging/ModuleFactory.java @@ -21,9 +21,9 @@ public interface ModuleFactory { /** * Build the {@link Module}. * - * @param testHostIpAddress IP address of the host running this UDF Test Setup under which UDFs can reach it - * @param bucket BucketFS bucket to upload resource to + * @param localServiceExposer Proxy factory that makes ports of the test host available in the container + * @param bucket BucketFS bucket to upload resource to * @return built {@link Module} */ - public Module buildModule(final String testHostIpAddress, Bucket bucket); + public Module buildModule(final LocalServiceExposer localServiceExposer, Bucket bucket); } diff --git a/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java b/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java index 20b2ca2..4b70245 100644 --- a/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java +++ b/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java @@ -21,13 +21,23 @@ public class UdfTestSetup { /** * Create a new instance of {@link UdfTestSetup}. - * + * * @param testHostIpAddress IP address of the host running this UDF Test Setup under which UDFs can reach it * @param bucket BucketFS bucket to upload resource to */ public UdfTestSetup(final String testHostIpAddress, final Bucket bucket) { + this(port -> new ExposedServiceAddress(testHostIpAddress, port), bucket); + } + + /** + * Create a new instance of {@link UdfTestSetup}. + * + * @param localServiceExposer Proxy factory that makes ports of the test host available in the container + * @param bucket BucketFS bucket to upload resource to + */ + public UdfTestSetup(final LocalServiceExposer localServiceExposer, final Bucket bucket) { this.enabledModules = AVAILABLE_MODULES.stream().filter(ModuleFactory::isEnabled) - .map(moduleFactory -> moduleFactory.buildModule(testHostIpAddress, bucket)) + .map(moduleFactory -> moduleFactory.buildModule(localServiceExposer, bucket)) .collect(Collectors.toList()); printInfoMessage(); } diff --git a/src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModule.java b/src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModule.java index 05eeea3..7fa7936 100644 --- a/src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModule.java +++ b/src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModule.java @@ -7,6 +7,7 @@ import com.exasol.bucketfs.Bucket; import com.exasol.bucketfs.BucketAccessException; import com.exasol.errorreporting.ExaError; +import com.exasol.udfdebugging.*; import com.exasol.udfdebugging.Module; /** @@ -20,15 +21,18 @@ public class CoverageModule implements Module { /** * Create a new instance of {@link CoverageModule}. * - * @param testHostIpAddress IP address of the test host from inside of the database - * @param bucket Bucket to upload the agent to + * @param localServiceExposer Proxy factory that makes ports of the test host available in the container + * @param bucket Bucket to upload the agent to */ - public CoverageModule(final String testHostIpAddress, final Bucket bucket) { + public CoverageModule(final LocalServiceExposer localServiceExposer, final Bucket bucket) { assertJacocoAgentExists(); uploadAgentToBucketFs(bucket); JacocoServer.startIfNotRunning(); + final ExposedServiceAddress proxyForHostPort = localServiceExposer + .exposeLocalServiceToDatabase(JacocoServer.PORT); this.jvmOption = "-javaagent:/buckets/" + bucket.getBucketFsName() + "/" + bucket.getBucketName() + "/" - + JACOCO_AGENT_NAME + "=output=tcpclient,address=" + testHostIpAddress + ",port=" + JacocoServer.PORT; + + JACOCO_AGENT_NAME + "=output=tcpclient,address=" + proxyForHostPort.getHostName() + ",port=" + + proxyForHostPort.getPort(); } private void assertJacocoAgentExists() { diff --git a/src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleFactory.java b/src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleFactory.java index fcace89..c889ba6 100644 --- a/src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleFactory.java +++ b/src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleFactory.java @@ -1,6 +1,7 @@ package com.exasol.udfdebugging.modules.coverage; import com.exasol.bucketfs.Bucket; +import com.exasol.udfdebugging.LocalServiceExposer; import com.exasol.udfdebugging.Module; import com.exasol.udfdebugging.modules.AbstractModuleFactory; @@ -14,7 +15,7 @@ public CoverageModuleFactory() { } @Override - public Module buildModule(final String testHostIpAddress, final Bucket bucket) { - return new CoverageModule(testHostIpAddress, bucket); + public Module buildModule(final LocalServiceExposer localServiceExposer, final Bucket bucket) { + return new CoverageModule(localServiceExposer, bucket); } } diff --git a/src/main/java/com/exasol/udfdebugging/modules/debugging/DebuggingModule.java b/src/main/java/com/exasol/udfdebugging/modules/debugging/DebuggingModule.java index 542c380..0601e63 100644 --- a/src/main/java/com/exasol/udfdebugging/modules/debugging/DebuggingModule.java +++ b/src/main/java/com/exasol/udfdebugging/modules/debugging/DebuggingModule.java @@ -2,24 +2,27 @@ import java.util.stream.Stream; +import com.exasol.udfdebugging.*; import com.exasol.udfdebugging.Module; public class DebuggingModule implements Module { - public static final String DEBUGGING_PORT = "8000"; - private final String testHostIpAddress; + public static final int DEBUGGING_PORT = 8000; + private final LocalServiceExposer localServiceExposer; /** * Create a new instance of {@link DebuggingModule}. * - * @param testHostIpAddress IP address of the host running this UDF Test Setup under which UDFs can reach it + * @param localServiceExposer Proxy factory that makes ports of the test host available in the container */ - public DebuggingModule(final String testHostIpAddress) { - this.testHostIpAddress = testHostIpAddress; + public DebuggingModule(final LocalServiceExposer localServiceExposer) { + this.localServiceExposer = localServiceExposer; } @Override public Stream getJvmOptions() { - return Stream.of("-agentlib:jdwp=transport=dt_socket,server=n,address=" + this.testHostIpAddress + ":" - + DEBUGGING_PORT + ",suspend=y"); + final ExposedServiceAddress proxyForHostPort = this.localServiceExposer + .exposeLocalServiceToDatabase(DEBUGGING_PORT); + return Stream.of("-agentlib:jdwp=transport=dt_socket,server=n,address=" + proxyForHostPort.getHostName() + ":" + + proxyForHostPort.getPort() + ",suspend=y"); } } diff --git a/src/main/java/com/exasol/udfdebugging/modules/debugging/DebuggingModuleFactory.java b/src/main/java/com/exasol/udfdebugging/modules/debugging/DebuggingModuleFactory.java index 4d7fbb7..3a97a19 100644 --- a/src/main/java/com/exasol/udfdebugging/modules/debugging/DebuggingModuleFactory.java +++ b/src/main/java/com/exasol/udfdebugging/modules/debugging/DebuggingModuleFactory.java @@ -1,6 +1,7 @@ package com.exasol.udfdebugging.modules.debugging; import com.exasol.bucketfs.Bucket; +import com.exasol.udfdebugging.LocalServiceExposer; import com.exasol.udfdebugging.Module; import com.exasol.udfdebugging.modules.AbstractModuleFactory; @@ -13,7 +14,7 @@ public DebuggingModuleFactory() { } @Override - public Module buildModule(final String testHostIpAddress, final Bucket bucket) { - return new DebuggingModule(testHostIpAddress); + public Module buildModule(final LocalServiceExposer localServiceExposer, final Bucket bucket) { + return new DebuggingModule(localServiceExposer); } } diff --git a/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleIT.java b/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleIT.java index b76660f..2c204e4 100644 --- a/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleIT.java +++ b/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleIT.java @@ -3,12 +3,9 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.MatcherAssert.assertThat; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; +import java.io.*; import java.sql.Connection; import java.sql.SQLException; -import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; import org.jacoco.core.data.ExecutionDataReader; @@ -17,12 +14,11 @@ import org.testcontainers.junit.jupiter.Testcontainers; import com.exasol.containers.ExasolContainer; -import com.exasol.dbbuilder.dialects.exasol.ExasolObjectConfiguration; -import com.exasol.dbbuilder.dialects.exasol.ExasolObjectFactory; -import com.exasol.dbbuilder.dialects.exasol.ExasolSchema; +import com.exasol.dbbuilder.dialects.exasol.*; import com.exasol.dbbuilder.dialects.exasol.udf.UdfScript; import com.exasol.errorreporting.ExaError; -import com.github.dockerjava.api.model.ContainerNetwork; +import com.exasol.udfdebugging.ExposedServiceAddress; +import com.exasol.udfdebugging.LocalServiceExposer; @Testcontainers class CoverageModuleIT { @@ -31,20 +27,15 @@ class CoverageModuleIT { private static final String SCHEMA_NAME = "TEST"; private static final String UDF_NAME = "HELLO_WORLD"; - private static String getTestHostIpFromInsideExasol() { - final Map networks = EXASOL.getContainerInfo().getNetworkSettings().getNetworks(); - if (networks.size() == 0) { - return null; - } - return networks.values().iterator().next().getGateway(); + private static LocalServiceExposer getHostPortProxy() { + return port -> new ExposedServiceAddress(EXASOL.getHostIp(), port); } @Test void testCoverageReportIsWritten() throws SQLException, IOException, InterruptedException { deleteExecutionFile(); final Connection connection = EXASOL.createConnection(); - final CoverageModule coverageModule = new CoverageModule(getTestHostIpFromInsideExasol(), - EXASOL.getDefaultBucket()); + final CoverageModule coverageModule = new CoverageModule(getHostPortProxy(), EXASOL.getDefaultBucket()); final ExasolObjectFactory exasolObjectFactory = new ExasolObjectFactory(connection, ExasolObjectConfiguration .builder().withJvmOptions(coverageModule.getJvmOptions().toArray(String[]::new)).build()); final ExasolSchema schema = exasolObjectFactory.createSchema(SCHEMA_NAME); diff --git a/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleTest.java b/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleTest.java index af844ba..5eb4370 100644 --- a/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleTest.java +++ b/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleTest.java @@ -12,13 +12,14 @@ import com.exasol.bucketfs.Bucket; import com.exasol.bucketfs.BucketAccessException; +import com.exasol.udfdebugging.ExposedServiceAddress; class CoverageModuleTest { @Test void testUpload() throws InterruptedException, BucketAccessException, TimeoutException { final Bucket bucket = mock(Bucket.class); - new CoverageModule("1.2.3.4", bucket); + new CoverageModule((port) -> new ExposedServiceAddress("1.2.3.4", port), bucket); verify(bucket).uploadFile(Path.of("target", "jacoco-agent", "org.jacoco.agent-runtime.jar"), "org.jacoco.agent-runtime.jar"); } @@ -28,7 +29,8 @@ void testGetJvmOptions() { final Bucket bucket = mock(Bucket.class); when(bucket.getBucketFsName()).thenReturn("my_bucketfs"); when(bucket.getBucketName()).thenReturn("my_bucket"); - final CoverageModule coverageModule = new CoverageModule("1.2.3.4", bucket); + final CoverageModule coverageModule = new CoverageModule((port) -> new ExposedServiceAddress("1.2.3.4", port), + bucket); assertThat(coverageModule.getJvmOptions().collect(Collectors.toList()), contains( "-javaagent:/buckets/my_bucketfs/my_bucket/org.jacoco.agent-runtime.jar=output=tcpclient,address=1.2.3.4,port=3002")); } diff --git a/src/test/resources/logging.properties b/src/test/resources/logging.properties index ad3bc9a..8c97abe 100644 --- a/src/test/resources/logging.properties +++ b/src/test/resources/logging.properties @@ -3,4 +3,4 @@ handlers=java.util.logging.ConsoleHandler java.util.logging.ConsoleHandler.level=ALL java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter java.util.logging.SimpleFormatter.format=%1$tF %1$tT.%1$tL [%4$-7s] %5$s %n -com.exasol=ALL \ No newline at end of file +com.exasol.level=ALL From 637b2614fe4e541d9d65141fdf260fba8f397a77 Mon Sep 17 00:00:00 2001 From: jakobbraun Date: Mon, 7 Jun 2021 15:02:17 +0200 Subject: [PATCH 05/37] Refactor/15 remove testcontainer (#19) * #11: Removed exasol-testconatiner compile dependency --- doc/changes/changes_0.4.0.md | 10 +++- pom.xml | 18 +++--- .../udfdebugging/modules/TestSetup.java | 58 +++++++++++++++++++ .../modules/coverage/CoverageModuleIT.java | 35 ++--------- 4 files changed, 80 insertions(+), 41 deletions(-) create mode 100644 src/test/java/com/exasol/udfdebugging/modules/TestSetup.java diff --git a/doc/changes/changes_0.4.0.md b/doc/changes/changes_0.4.0.md index b101ad1..66ebfba 100644 --- a/doc/changes/changes_0.4.0.md +++ b/doc/changes/changes_0.4.0.md @@ -6,19 +6,25 @@ Code name: * #15: Add API for host port proxy +## Refactoring: + +* #11: Removed exasol-testconatiner compile dependency + ## Dependency Updates ### Compile Dependency Updates +* Added `com.exasol:bucketfs-java:1.0.0` * Updated `com.exasol:error-reporting-java:0.2.0` to `0.4.0` -* Updated `com.exasol:exasol-testcontainers:3.3.1` to `3.5.1` +* Removed `com.exasol:exasol-testcontainers:3.3.1` * Updated `com.exasol:test-db-builder-java:2.0.0` to `3.1.1` ### Test Dependency Updates +* Added `com.exasol:exasol-testcontainers:3.5.2` * Updated `org.junit.jupiter:junit-jupiter-engine:5.6.2` to `5.7.1` * Updated `org.junit.jupiter:junit-jupiter-params:5.6.2` to `5.7.1` -* Updated `org.junit.platform:junit-platform-runner:1.6.2` to `1.7.1` +* Removed `org.junit.platform:junit-platform-runner:1.6.2` * Updated `org.mockito:mockito-core:3.6.0` to `3.8.0` * Updated `org.testcontainers:junit-jupiter:1.14.3` to `1.15.2` diff --git a/pom.xml b/pom.xml index 5dcc7a1..72dec91 100644 --- a/pom.xml +++ b/pom.xml @@ -93,12 +93,10 @@ runtime test - com.exasol - exasol-testcontainers - 3.5.1 + bucketfs-java + 1.0.0 @@ -107,12 +105,6 @@ ${junit.version} test - - org.junit.platform - junit-platform-runner - ${junit.platform.version} - test - org.junit.jupiter junit-jupiter-params @@ -132,6 +124,12 @@ test + + com.exasol + exasol-testcontainers + 3.5.2 + test + org.testcontainers junit-jupiter diff --git a/src/test/java/com/exasol/udfdebugging/modules/TestSetup.java b/src/test/java/com/exasol/udfdebugging/modules/TestSetup.java new file mode 100644 index 0000000..b1d221f --- /dev/null +++ b/src/test/java/com/exasol/udfdebugging/modules/TestSetup.java @@ -0,0 +1,58 @@ +package com.exasol.udfdebugging.modules; + +import java.io.Closeable; +import java.sql.*; +import java.util.stream.Stream; + +import com.exasol.bucketfs.Bucket; +import com.exasol.containers.ExasolContainer; +import com.exasol.dbbuilder.dialects.exasol.*; +import com.exasol.dbbuilder.dialects.exasol.udf.UdfScript; +import com.exasol.udfdebugging.ExposedServiceAddress; +import com.exasol.udfdebugging.LocalServiceExposer; + +/** + * This class contains common integration test setup. + */ +public class TestSetup implements Closeable, AutoCloseable { + private static final String SCHEMA_NAME = "TEST"; + private static final String UDF_NAME = "HELLO_WORLD"; + + private final ExasolContainer> exasol = new ExasolContainer<>().withReuse(true); + + public TestSetup() { + this.exasol.start(); + } + + public LocalServiceExposer getHostPortProxy() { + return port -> new ExposedServiceAddress(this.exasol.getHostIp(), port); + } + + public Bucket getDefaultBucket() { + return this.exasol.getDefaultBucket(); + } + + public ExasolContainer> getExasolContainer() { + return this.exasol; + } + + public void runJavaUdf(final Stream jvmOptions) throws SQLException { + try (final Connection connection = this.exasol.createConnection(); + final Statement statement = connection.createStatement()) { + final ExasolObjectFactory exasolObjectFactory = new ExasolObjectFactory(connection, + ExasolObjectConfiguration.builder().withJvmOptions(jvmOptions.toArray(String[]::new)).build()); + final ExasolSchema schema = exasolObjectFactory.createSchema(SCHEMA_NAME); + schema.createUdfBuilder(UDF_NAME).inputType(UdfScript.InputType.SCALAR).language(UdfScript.Language.JAVA) + .content("class HELLO_WORLD {\n" + + " static String run(ExaMetadata exa, ExaIterator ctx) throws Exception {\n" + + " \treturn \"\";\n" + " }\n" + "}") + .returns("VARCHAR(2000)").build(); + statement.executeQuery("SELECT " + SCHEMA_NAME + "." + UDF_NAME + "()").close(); + } + } + + @Override + public void close() { + this.exasol.stop(); + } +} diff --git a/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleIT.java b/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleIT.java index 2c204e4..28356a4 100644 --- a/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleIT.java +++ b/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleIT.java @@ -4,47 +4,24 @@ import static org.hamcrest.MatcherAssert.assertThat; import java.io.*; -import java.sql.Connection; import java.sql.SQLException; import java.util.concurrent.atomic.AtomicInteger; import org.jacoco.core.data.ExecutionDataReader; import org.junit.jupiter.api.Test; -import org.testcontainers.junit.jupiter.Container; -import org.testcontainers.junit.jupiter.Testcontainers; -import com.exasol.containers.ExasolContainer; -import com.exasol.dbbuilder.dialects.exasol.*; -import com.exasol.dbbuilder.dialects.exasol.udf.UdfScript; import com.exasol.errorreporting.ExaError; -import com.exasol.udfdebugging.ExposedServiceAddress; -import com.exasol.udfdebugging.LocalServiceExposer; +import com.exasol.udfdebugging.modules.TestSetup; -@Testcontainers class CoverageModuleIT { - @Container - private static final ExasolContainer> EXASOL = new ExasolContainer<>().withReuse(true); - private static final String SCHEMA_NAME = "TEST"; - private static final String UDF_NAME = "HELLO_WORLD"; - - private static LocalServiceExposer getHostPortProxy() { - return port -> new ExposedServiceAddress(EXASOL.getHostIp(), port); - } @Test - void testCoverageReportIsWritten() throws SQLException, IOException, InterruptedException { + void testCoverageReportIsWritten() throws SQLException, IOException { deleteExecutionFile(); - final Connection connection = EXASOL.createConnection(); - final CoverageModule coverageModule = new CoverageModule(getHostPortProxy(), EXASOL.getDefaultBucket()); - final ExasolObjectFactory exasolObjectFactory = new ExasolObjectFactory(connection, ExasolObjectConfiguration - .builder().withJvmOptions(coverageModule.getJvmOptions().toArray(String[]::new)).build()); - final ExasolSchema schema = exasolObjectFactory.createSchema(SCHEMA_NAME); - schema.createUdfBuilder(UDF_NAME).inputType(UdfScript.InputType.SCALAR).language(UdfScript.Language.JAVA) - .content("class HELLO_WORLD {\n" - + " static String run(ExaMetadata exa, ExaIterator ctx) throws Exception {\n" - + " \treturn \"hello world\";\n" + " }\n" + "}") - .returns("VARCHAR(2000)").build(); - connection.createStatement().executeQuery("SELECT " + SCHEMA_NAME + "." + UDF_NAME + "()"); + final TestSetup udfSetup = new TestSetup(); + final CoverageModule coverageModule = new CoverageModule(udfSetup.getHostPortProxy(), + udfSetup.getDefaultBucket()); + udfSetup.runJavaUdf(coverageModule.getJvmOptions()); assertThat(countReportedJacocoSessions(), equalTo(1)); } From 0992151b129c1b466c65ef1f2f762dedebcb3519 Mon Sep 17 00:00:00 2001 From: jakobbraun Date: Mon, 7 Jun 2021 15:58:02 +0200 Subject: [PATCH 06/37] #18: Fixed broken url (#24) --- doc/changes/changes_0.4.0.md | 4 ++++ pom.xml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/changes/changes_0.4.0.md b/doc/changes/changes_0.4.0.md index 66ebfba..3a4a300 100644 --- a/doc/changes/changes_0.4.0.md +++ b/doc/changes/changes_0.4.0.md @@ -10,6 +10,10 @@ Code name: * #11: Removed exasol-testconatiner compile dependency +## Bug Fixes: + +* #18: Fixed Broken URL link in the pom.xml + ## Dependency Updates ### Compile Dependency Updates diff --git a/pom.xml b/pom.xml index 72dec91..ee449a9 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ 0.4.0 udf-debugging-java Utilities for debugging, profiling and code coverage measure for UDFs. - https://github.com/exasol/udf-debugging-javat + https://github.com/exasol/udf-debugging-java UTF-8 UTF-8 From 142db9735084a5e68b4b62892031c5b2d3257a0c Mon Sep 17 00:00:00 2001 From: Muhammet Orazov Date: Mon, 5 Jul 2021 16:13:39 +0200 Subject: [PATCH 07/37] Updated branch in travis link (#25) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8629353..544f01d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # UDF Debugging Tools for Java -[![Build Status](https://travis-ci.com/exasol/udf-debugging-java.svg?branch=master)](https://travis-ci.com/exasol/udf-debugging-java) +[![Build Status](https://travis-ci.com/exasol/udf-debugging-java.svg?branch=main)](https://travis-ci.com/exasol/udf-debugging-java) [![Maven Central](https://img.shields.io/maven-central/v/com.exasol/udf-debugging-java)](https://search.maven.org/artifact/com.exasol/udf-debugging-java) This repository contains tools for debugging UDFs. From 0827ed9679668548da30733bd7d8537f30a31dab Mon Sep 17 00:00:00 2001 From: jakobbraun Date: Tue, 6 Jul 2021 04:40:57 -0300 Subject: [PATCH 08/37] feature/26: Added support for exasol-test-setup-abstraction (#27) * feature/26: Added support for exasol-test-setup-abstraction --- .github/workflows/ci-build.yml | 30 ++++++ ...elease_droid_prepare_original_checksum.yml | 2 + .../release_droid_print_quick_checksum.yml | 2 + ...release_droid_release_on_maven_central.yml | 2 + ...ase_droid_upload_github_release_assets.yml | 2 + .travis.yml | 16 ---- NOTICE | 47 --------- NOTICE.template | 2 - README.md | 37 ++++--- dependencies.md | 96 +++++++++++++++++++ doc/changes/changes_0.4.0.md | 6 +- error_code_config.yml | 4 + pom.xml | 65 +++++++------ .../udfdebugging/ExposedServiceAddress.java | 38 -------- .../udfdebugging/LocalServiceExposer.java | 4 +- .../com/exasol/udfdebugging/UdfTestSetup.java | 15 ++- .../modules/coverage/CoverageModule.java | 6 +- .../modules/debugging/DebuggingModule.java | 6 +- .../udfdebugging/modules/TestSetup.java | 4 +- .../modules/coverage/CoverageModuleTest.java | 7 +- 20 files changed, 224 insertions(+), 167 deletions(-) create mode 100644 .github/workflows/ci-build.yml delete mode 100644 .travis.yml delete mode 100644 NOTICE delete mode 100644 NOTICE.template create mode 100644 dependencies.md create mode 100644 error_code_config.yml delete mode 100644 src/main/java/com/exasol/udfdebugging/ExposedServiceAddress.java diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml new file mode 100644 index 0000000..94c3309 --- /dev/null +++ b/.github/workflows/ci-build.yml @@ -0,0 +1,30 @@ +name: CI Build + +on: + - push + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout the repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Cache local Maven repository + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Run tests and build with Maven + run: mvn -B clean verify sonar:sonar --file pom.xml -Dsonar.organization=exasol -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONAR_TOKEN + env: + GITHUB_OAUTH: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release_droid_prepare_original_checksum.yml b/.github/workflows/release_droid_prepare_original_checksum.yml index d4e1866..5133083 100644 --- a/.github/workflows/release_droid_prepare_original_checksum.yml +++ b/.github/workflows/release_droid_prepare_original_checksum.yml @@ -9,6 +9,8 @@ jobs: steps: - name: Checkout the repository uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Set up JDK 11 uses: actions/setup-java@v1 with: diff --git a/.github/workflows/release_droid_print_quick_checksum.yml b/.github/workflows/release_droid_print_quick_checksum.yml index bc91c61..f5f938f 100644 --- a/.github/workflows/release_droid_print_quick_checksum.yml +++ b/.github/workflows/release_droid_print_quick_checksum.yml @@ -9,6 +9,8 @@ jobs: steps: - name: Checkout the repository uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Set up JDK 11 uses: actions/setup-java@v1 with: diff --git a/.github/workflows/release_droid_release_on_maven_central.yml b/.github/workflows/release_droid_release_on_maven_central.yml index 28f9ba3..e768946 100644 --- a/.github/workflows/release_droid_release_on_maven_central.yml +++ b/.github/workflows/release_droid_release_on_maven_central.yml @@ -9,6 +9,8 @@ jobs: steps: - name: Checkout the repository uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Set up Maven Central Repository uses: actions/setup-java@v1 with: diff --git a/.github/workflows/release_droid_upload_github_release_assets.yml b/.github/workflows/release_droid_upload_github_release_assets.yml index d977542..7b20aa3 100644 --- a/.github/workflows/release_droid_upload_github_release_assets.yml +++ b/.github/workflows/release_droid_upload_github_release_assets.yml @@ -13,6 +13,8 @@ jobs: steps: - name: Checkout the repository uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Set up JDK 11 uses: actions/setup-java@v1 with: diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f6845a5..0000000 --- a/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: java -sudo: required -matrix: - include: - - jdk: openjdk11 -addons: - sonarcloud: - organization: exasol - token: - secure: AgZwCb56VbdlHlyTAsRi99yVB/+/inLhki2+mzMWf5BJ8IZhjJNN5zRP+gmjf0sjHwKtL3NdoPeqjMy3Q4+UxhydEd3mbZ8NaIYeQ3ZBE9zBZqBCEG15TfVCL9gSNkXuFfmpdyQt+MdnzkL9/vUKlMajfUuywDj/4FOzCW6PfPrDCvxHEUwkmWYLCTqxnDAGJu6ogb8RrpOqoWSOyUH2hMm+Qm5YKY9+xn+UjfD0kApv868BF1g7Jgz6PYv1hiQMwPjTNlI1ISuom3RXY5QtNSchB7/ZLK3KXpbpwjDNh+AfDFCrrCNiHM24kIp4gwJoyjg4wh/ao3umTalIR3iVErMmz7F/Mbd7ZJHNFC9rqXbgzrj1rySYJ0QemeI7FvTqdRQTaXENlz45sw3YRf4PU/Palpga/RCqwFYxuF5wErSngMOFVvaxjxYUDrNz3aO4v1ZYCOksKM7LhnOPE+sqrZAWBRDU+iKfevoLXUpfWMfedKYVQAqO+tqgolxPSUVmyfzgQC1vqhVrcDbXHFXfE5hJdCUd9YN4PJo98EtUXou4SGp6dpwRn/D9M3nZjOsfpahPFMYYzfaBpIIG6AEN6eGVbE9AA94x/tMKdhlUcEiHBA57YbyvHly8wA8wHoMWFWe7QxE7cP3afi/ognfHRb77/Ay0ggcG1CT9VeCov6A= -script: - - mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent org.jacoco:jacoco-maven-plugin:prepare-agent-integration - verify sonar:sonar -Dsonar.login=${SONAR_TOKEN} -Dsonar.coverage.jacoco.xmlReportPaths=target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,target/site/jacoco-udf/jacoco.xml -cache: - directories: - - "$HOME/.m2" diff --git a/NOTICE b/NOTICE deleted file mode 100644 index 5bdd8ee..0000000 --- a/NOTICE +++ /dev/null @@ -1,47 +0,0 @@ -This project has the following dependencies: - Apache Commons Compress under Apache License, Version 2.0 - asm under BSD-3-Clause - asm-analysis under BSD-3-Clause - asm-commons under BSD-3-Clause - asm-tree under BSD-3-Clause - Byte Buddy (without dependencies) under Apache License, Version 2.0 - Byte Buddy agent under Apache License, Version 2.0 - docker-java-api under The Apache Software License, Version 2.0 - docker-java-transport under The Apache Software License, Version 2.0 - docker-java-transport-zerodep under The Apache Software License, Version 2.0 - Duct Tape under MIT - error-reporting-java under MIT - Exasol Database fundamentals for Java under MIT - EXASolution JDBC Driver under EXAClient License - Hamcrest All under New BSD License - Hamcrest Core under New BSD License - Jackson-annotations under The Apache Software License, Version 2.0 - JaCoCo :: Core under Eclipse Public License 2.0 - Java Native Access under LGPL, version 2.1 or Apache License v2.0 - JSR 374 (JSON Processing) API under Dual license consisting of the CDDL v1.1 and GPL v2 - JUnit under Eclipse Public License 1.0 - JUnit Jupiter API under Eclipse Public License v2.0 - JUnit Jupiter Engine under Eclipse Public License v2.0 - JUnit Jupiter Params under Eclipse Public License v2.0 - JUnit Platform Commons under Eclipse Public License v2.0 - JUnit Platform Engine API under Eclipse Public License v2.0 - JUnit Platform Launcher under Eclipse Public License v2.0 - JUnit Platform Runner under Eclipse Public License v2.0 - JUnit Platform Suite API under Eclipse Public License v2.0 - mockito-core under The MIT License - MySQL Connector/J under The GNU General Public License, v2 with FOSS exception - Objenesis under Apache License, Version 2.0 - org.apiguardian:apiguardian-api under The Apache License, Version 2.0 - org.opentest4j:opentest4j under The Apache License, Version 2.0 - Protocol Buffers [Core] under 3-Clause BSD License - SLF4J API Module under MIT License - SLF4J JDK14 Binding under MIT License - Test containers for Exasol on Docker under MIT - Test Database Builder for Java under MIT - Testcontainers :: Database-Commons under MIT - Testcontainers :: JDBC under MIT - Testcontainers :: JUnit Jupiter Extension under MIT - Testcontainers Core under MIT - udf-debugging-java under MIT - Visible Assertions under MIT - diff --git a/NOTICE.template b/NOTICE.template deleted file mode 100644 index b8b28b0..0000000 --- a/NOTICE.template +++ /dev/null @@ -1,2 +0,0 @@ -This project has the following dependencies: -#GENERATED_NOTICES# \ No newline at end of file diff --git a/README.md b/README.md index 544f01d..86e7d74 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,25 @@ # UDF Debugging Tools for Java -[![Build Status](https://travis-ci.com/exasol/udf-debugging-java.svg?branch=main)](https://travis-ci.com/exasol/udf-debugging-java) -[![Maven Central](https://img.shields.io/maven-central/v/com.exasol/udf-debugging-java)](https://search.maven.org/artifact/com.exasol/udf-debugging-java) +[![Build Status](https://github.com/exasol/udf-debugging-java/actions/workflows/ci-build.yml/badge.svg)](https://github.com/exasol/udf-debugging-java/actions/workflows/ci-build.yml) +[![Maven Central](https://img.shields.io/maven-central/v/com.exasol/udf-debugging-java)](https://search.maven.org/artifact/com.exasol/udf-debugging-java) + +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Audf-debugging-java&metric=alert_status)](https://sonarcloud.io/dashboard?id=com.exasol%3Audf-debugging-java) + +[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Audf-debugging-java&metric=security_rating)](https://sonarcloud.io/dashboard?id=com.exasol%3Audf-debugging-java) +[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Audf-debugging-java&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=com.exasol%3Audf-debugging-java) +[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Audf-debugging-java&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=com.exasol%3Audf-debugging-java) +[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Audf-debugging-java&metric=sqale_index)](https://sonarcloud.io/dashboard?id=com.exasol%3Audf-debugging-java) + +[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Audf-debugging-java&metric=code_smells)](https://sonarcloud.io/dashboard?id=com.exasol%3Audf-debugging-java) +[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Audf-debugging-java&metric=coverage)](https://sonarcloud.io/dashboard?id=com.exasol%3Audf-debugging-java) +[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Audf-debugging-java&metric=duplicated_lines_density)](https://sonarcloud.io/dashboard?id=com.exasol%3Audf-debugging-java) +[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Audf-debugging-java&metric=ncloc)](https://sonarcloud.io/dashboard?id=com.exasol%3Audf-debugging-java) This repository contains tools for debugging UDFs. ## Installation -Install as maven dependency. -You can get the dependency declaration by clicking the maven badge above. +Install as maven dependency. You can get the dependency declaration by clicking the maven badge above. ## Typical Usage @@ -16,17 +27,15 @@ Typically, you use this package together with [test-db-builder-java](https://git ```java -private static final ExasolContainer> EXASOL = new ExasolContainer<>(); -final UdfTestSetup udfTestSetup = new UdfTestSetup(getTestHostIp(), EXASOL.getDefaultBucket()); -final ExasolObjectFactory testDbBuilder = new ExasolObjectFactory(EXASOL.createConnection(), - ExasolObjectConfiguration.builder().withJvmOptions(udfTestSetup.getJvmOptions()).build()); +private static final ExasolContainer> EXASOL=new ExasolContainer<>(); +final UdfTestSetup udfTestSetup=new UdfTestSetup(getTestHostIp(),EXASOL.getDefaultBucket()); +final ExasolObjectFactory testDbBuilder=new ExasolObjectFactory(EXASOL.createConnection(), + ExasolObjectConfiguration.builder().withJvmOptions(udfTestSetup.getJvmOptions()).build()); ``` ## Modules -This package contains multiple modules that you can enable on runtime by setting the corresponding system property to `true`. -Typically, you do so by appending `-D="true"` to your JVM call. - +This package contains multiple modules that you can enable on runtime by setting the corresponding system property to `true`. Typically, you do so by appending `-D="true"` to your JVM call. ### Debugging @@ -40,10 +49,10 @@ System property: `test.coverage` This module installs a jacoco agent to the UDF JVM and receives the execution data using a TCP socket. -This module requires additional maven configuration. Use the [project-keeper's](https://github.com/exasol/project-keeper-maven-plugin) `udf_coverage` module to verify it. - +This module requires additional maven configuration. Use the [project-keeper's](https://github.com/exasol/project-keeper-maven-plugin) `udf_coverage` module to verify it. ## Additional Information * [Changelog](doc/changes/changelog.md) -* [Dependencies](NOTICE) +* [Dependencies](dependencies.md) + diff --git a/dependencies.md b/dependencies.md new file mode 100644 index 0000000..43b66a2 --- /dev/null +++ b/dependencies.md @@ -0,0 +1,96 @@ + +# Dependencies + +## Compile Dependencies + +| Dependency | License | +| --------------------------------------- | -------------------------------------------------------- | +| [JSR 374 (JSON Processing) API][0] | [Dual license consisting of the CDDL v1.1 and GPL v2][1] | +| [error-reporting-java][2] | [MIT][3] | +| [JaCoCo :: Core][4] | [Eclipse Public License 2.0][5] | +| [BucketFS Java][6] | [MIT][3] | +| [exasol-test-setup-abstraction-java][8] | [MIT][3] | +| [Test Database Builder for Java][10] | [MIT][3] | +| [SLF4J API Module][12] | [MIT License][13] | + +## Test Dependencies + +| Dependency | License | +| ----------------------------------------------- | --------------------------------- | +| [JaCoCo :: Agent][4] | [Eclipse Public License 2.0][5] | +| [JUnit Jupiter Engine][16] | [Eclipse Public License v2.0][17] | +| [JUnit Jupiter Params][16] | [Eclipse Public License v2.0][17] | +| [mockito-core][20] | [The MIT License][21] | +| [Hamcrest All][22] | [New BSD License][23] | +| [Test containers for Exasol on Docker][24] | [MIT][3] | +| [Testcontainers :: JUnit Jupiter Extension][26] | [MIT][27] | + +## Plugin Dependencies + +| Dependency | License | +| ------------------------------------------------------- | ---------------------------------------------- | +| [Maven Surefire Plugin][28] | [Apache License, Version 2.0][29] | +| [Maven Failsafe Plugin][30] | [Apache License, Version 2.0][29] | +| [JaCoCo :: Maven Plugin][4] | [Eclipse Public License 2.0][5] | +| [Apache Maven Compiler Plugin][34] | [Apache License, Version 2.0][29] | +| [Maven Dependency Plugin][36] | [The Apache Software License, Version 2.0][37] | +| [Versions Maven Plugin][38] | [Apache License, Version 2.0][29] | +| [Apache Maven Source Plugin][40] | [Apache License, Version 2.0][29] | +| [Apache Maven Javadoc Plugin][42] | [Apache License, Version 2.0][29] | +| [Apache Maven GPG Plugin][44] | [Apache License, Version 2.0][37] | +| [org.sonatype.ossindex.maven:ossindex-maven-plugin][46] | [ASL2][37] | +| [Apache Maven Enforcer Plugin][48] | [Apache License, Version 2.0][29] | +| [Project keeper maven plugin][50] | [MIT][3] | +| [Maven Deploy Plugin][52] | [The Apache Software License, Version 2.0][37] | +| [Nexus Staging Maven Plugin][54] | [Eclipse Public License][55] | +| [error-code-crawler-maven-plugin][56] | [MIT][3] | +| [Reproducible Build Maven Plugin][58] | [Apache 2.0][37] | +| [Maven Clean Plugin][60] | [The Apache Software License, Version 2.0][37] | +| [Maven Resources Plugin][62] | [The Apache Software License, Version 2.0][37] | +| [Maven JAR Plugin][64] | [The Apache Software License, Version 2.0][37] | +| [Maven Install Plugin][66] | [The Apache Software License, Version 2.0][37] | +| [Maven Site Plugin 3][68] | [The Apache Software License, Version 2.0][37] | + +[4]: https://www.eclemma.org/jacoco/index.html +[50]: https://github.com/exasol/project-keeper-maven-plugin +[6]: https://github.com/exasol/bucketfs-java +[2]: https://github.com/exasol/error-reporting-java +[0]: https://javaee.github.io/jsonp +[37]: http://www.apache.org/licenses/LICENSE-2.0.txt +[28]: https://maven.apache.org/surefire/maven-surefire-plugin/ +[54]: http://www.sonatype.com/public-parent/nexus-maven-plugins/nexus-staging/nexus-staging-maven-plugin/ +[60]: http://maven.apache.org/plugins/maven-clean-plugin/ +[3]: https://opensource.org/licenses/MIT +[20]: https://github.com/mockito/mockito +[30]: https://maven.apache.org/surefire/maven-failsafe-plugin/ +[36]: http://maven.apache.org/plugins/maven-dependency-plugin/ +[38]: http://www.mojohaus.org/versions-maven-plugin/ +[34]: https://maven.apache.org/plugins/maven-compiler-plugin/ +[1]: https://oss.oracle.com/licenses/CDDL+GPL-1.1 +[27]: http://opensource.org/licenses/MIT +[44]: http://maven.apache.org/plugins/maven-gpg-plugin/ +[5]: https://www.eclipse.org/legal/epl-2.0/ +[55]: http://www.eclipse.org/legal/epl-v10.html +[24]: https://github.com/exasol/exasol-testcontainers +[22]: https://github.com/hamcrest/JavaHamcrest/hamcrest-all +[58]: http://zlika.github.io/reproducible-build-maven-plugin +[64]: http://maven.apache.org/plugins/maven-jar-plugin/ +[13]: http://www.opensource.org/licenses/mit-license.php +[29]: https://www.apache.org/licenses/LICENSE-2.0.txt +[48]: https://maven.apache.org/enforcer/maven-enforcer-plugin/ +[21]: https://github.com/mockito/mockito/blob/release/3.x/LICENSE +[17]: https://www.eclipse.org/legal/epl-v20.html +[23]: http://www.opensource.org/licenses/bsd-license.php +[66]: http://maven.apache.org/plugins/maven-install-plugin/ +[16]: https://junit.org/junit5/ +[46]: https://sonatype.github.io/ossindex-maven/maven-plugin/ +[26]: https://testcontainers.org +[40]: https://maven.apache.org/plugins/maven-source-plugin/ +[12]: http://www.slf4j.org +[52]: http://maven.apache.org/plugins/maven-deploy-plugin/ +[68]: http://maven.apache.org/plugins/maven-site-plugin/ +[62]: http://maven.apache.org/plugins/maven-resources-plugin/ +[42]: https://maven.apache.org/plugins/maven-javadoc-plugin/ +[56]: https://github.com/exasol/error-code-crawler-maven-plugin +[8]: https://github.com/exasol/exasol-test-setup-abstraction-java +[10]: https://github.com/exasol/test-db-builder diff --git a/doc/changes/changes_0.4.0.md b/doc/changes/changes_0.4.0.md index 3a4a300..24b11a9 100644 --- a/doc/changes/changes_0.4.0.md +++ b/doc/changes/changes_0.4.0.md @@ -5,6 +5,7 @@ Code name: ## Features / Enhancements * #15: Add API for host port proxy +* #26: Added support for exasol-test-setup-abstraction ## Refactoring: @@ -20,6 +21,7 @@ Code name: * Added `com.exasol:bucketfs-java:1.0.0` * Updated `com.exasol:error-reporting-java:0.2.0` to `0.4.0` +* Added `com.exasol:exasol-test-setup-abstraction-java:0.1.0` * Removed `com.exasol:exasol-testcontainers:3.3.1` * Updated `com.exasol:test-db-builder-java:2.0.0` to `3.1.1` @@ -34,6 +36,6 @@ Code name: ### Plugin Dependency Updates -* Added `com.exasol:error-code-crawler-maven-plugin:0.1.1` -* Updated `com.exasol:project-keeper-maven-plugin:0.3.0` to `0.6.0` +* Added `com.exasol:error-code-crawler-maven-plugin:0.5.0` +* Updated `com.exasol:project-keeper-maven-plugin:0.3.0` to `0.9.0` * Added `io.github.zlika:reproducible-build-maven-plugin:0.13` diff --git a/error_code_config.yml b/error_code_config.yml new file mode 100644 index 0000000..634fed3 --- /dev/null +++ b/error_code_config.yml @@ -0,0 +1,4 @@ +error-tags: + UDJ: + packages: + - com.exasol.udfdebugging \ No newline at end of file diff --git a/pom.xml b/pom.xml index ee449a9..d9b9e59 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.exasol udf-debugging-java - 0.4.0 + 0.4.0-SNAPSHOT udf-debugging-java Utilities for debugging, profiling and code coverage measure for UDFs. https://github.com/exasol/udf-debugging-java @@ -98,6 +98,11 @@ bucketfs-java 1.0.0 + + com.exasol + exasol-test-setup-abstraction-java + 0.1.0 + org.junit.jupiter @@ -195,24 +200,38 @@ prepare-agent - - report - test + prepare-agent-integration - report + prepare-agent-integration - - report-udf-integration + merge-results verify - report-integration + merge - ${project.build.directory}/jacoco-udf.exec - ${project.reporting.outputDirectory}/jacoco-udf + + + ${project.build.directory}/ + + jacoco*.exec + + + + ${project.build.directory}/aggregate.exec + + + + report + verify + + report + + + ${project.build.directory}/aggregate.exec @@ -350,7 +369,7 @@ com.exasol project-keeper-maven-plugin - 0.6.0 + 0.9.0 @@ -361,30 +380,10 @@ maven_central + integration_tests - org.apache.maven.plugins maven-deploy-plugin @@ -414,7 +413,7 @@ com.exasol error-code-crawler-maven-plugin - 0.1.1 + 0.5.0 diff --git a/src/main/java/com/exasol/udfdebugging/ExposedServiceAddress.java b/src/main/java/com/exasol/udfdebugging/ExposedServiceAddress.java deleted file mode 100644 index 5b12ce3..0000000 --- a/src/main/java/com/exasol/udfdebugging/ExposedServiceAddress.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.exasol.udfdebugging; - -/** - * This class describes the address of a proxy for ports of the test host. - */ -public class ExposedServiceAddress { - private final String hostName; - private final int port; - - /** - * Create a new instance of {@link ExposedServiceAddress}. - * - * @param hostName host name of the proxy - * @param port port number - */ - public ExposedServiceAddress(final String hostName, final int port) { - this.hostName = hostName; - this.port = port; - } - - /** - * Get the host name of the proxy. - * - * @return host name - */ - public String getHostName() { - return this.hostName; - } - - /** - * Get the port number of the proxy. - * - * @return port number - */ - public int getPort() { - return this.port; - } -} diff --git a/src/main/java/com/exasol/udfdebugging/LocalServiceExposer.java b/src/main/java/com/exasol/udfdebugging/LocalServiceExposer.java index a923e37..19535b0 100644 --- a/src/main/java/com/exasol/udfdebugging/LocalServiceExposer.java +++ b/src/main/java/com/exasol/udfdebugging/LocalServiceExposer.java @@ -1,5 +1,7 @@ package com.exasol.udfdebugging; +import com.exasol.exasoltestsetup.ServiceAddress; + /** * Implementors of this interface exposes a local service (socket) into the Exasol database. */ @@ -12,5 +14,5 @@ public interface LocalServiceExposer { * @param port port number * @return proxy */ - ExposedServiceAddress exposeLocalServiceToDatabase(int port); + ServiceAddress exposeLocalServiceToDatabase(int port); } diff --git a/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java b/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java index 4b70245..5336973 100644 --- a/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java +++ b/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java @@ -7,6 +7,8 @@ import org.slf4j.LoggerFactory; import com.exasol.bucketfs.Bucket; +import com.exasol.exasoltestsetup.ExasolTestSetup; +import com.exasol.exasoltestsetup.ServiceAddress; import com.exasol.udfdebugging.modules.coverage.CoverageModuleFactory; import com.exasol.udfdebugging.modules.debugging.DebuggingModuleFactory; @@ -26,7 +28,7 @@ public class UdfTestSetup { * @param bucket BucketFS bucket to upload resource to */ public UdfTestSetup(final String testHostIpAddress, final Bucket bucket) { - this(port -> new ExposedServiceAddress(testHostIpAddress, port), bucket); + this(port -> new ServiceAddress(testHostIpAddress, port), bucket); } /** @@ -35,13 +37,22 @@ public UdfTestSetup(final String testHostIpAddress, final Bucket bucket) { * @param localServiceExposer Proxy factory that makes ports of the test host available in the container * @param bucket BucketFS bucket to upload resource to */ - public UdfTestSetup(final LocalServiceExposer localServiceExposer, final Bucket bucket) { + private UdfTestSetup(final LocalServiceExposer localServiceExposer, final Bucket bucket) { this.enabledModules = AVAILABLE_MODULES.stream().filter(ModuleFactory::isEnabled) .map(moduleFactory -> moduleFactory.buildModule(localServiceExposer, bucket)) .collect(Collectors.toList()); printInfoMessage(); } + /** + * Create a new instance of {@link UdfTestSetup}. + * + * @param testSetup Exasol test setup + */ + public UdfTestSetup(final ExasolTestSetup testSetup) { + this(testSetup::makeLocalTcpServiceAccessibleFromDatabase, testSetup.getDefaultBucket()); + } + /** * Get JVM options required for this setup. * diff --git a/src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModule.java b/src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModule.java index 7fa7936..33e5ed9 100644 --- a/src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModule.java +++ b/src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModule.java @@ -7,7 +7,8 @@ import com.exasol.bucketfs.Bucket; import com.exasol.bucketfs.BucketAccessException; import com.exasol.errorreporting.ExaError; -import com.exasol.udfdebugging.*; +import com.exasol.exasoltestsetup.ServiceAddress; +import com.exasol.udfdebugging.LocalServiceExposer; import com.exasol.udfdebugging.Module; /** @@ -28,8 +29,7 @@ public CoverageModule(final LocalServiceExposer localServiceExposer, final Bucke assertJacocoAgentExists(); uploadAgentToBucketFs(bucket); JacocoServer.startIfNotRunning(); - final ExposedServiceAddress proxyForHostPort = localServiceExposer - .exposeLocalServiceToDatabase(JacocoServer.PORT); + final ServiceAddress proxyForHostPort = localServiceExposer.exposeLocalServiceToDatabase(JacocoServer.PORT); this.jvmOption = "-javaagent:/buckets/" + bucket.getBucketFsName() + "/" + bucket.getBucketName() + "/" + JACOCO_AGENT_NAME + "=output=tcpclient,address=" + proxyForHostPort.getHostName() + ",port=" + proxyForHostPort.getPort(); diff --git a/src/main/java/com/exasol/udfdebugging/modules/debugging/DebuggingModule.java b/src/main/java/com/exasol/udfdebugging/modules/debugging/DebuggingModule.java index 0601e63..7d8b975 100644 --- a/src/main/java/com/exasol/udfdebugging/modules/debugging/DebuggingModule.java +++ b/src/main/java/com/exasol/udfdebugging/modules/debugging/DebuggingModule.java @@ -2,7 +2,8 @@ import java.util.stream.Stream; -import com.exasol.udfdebugging.*; +import com.exasol.exasoltestsetup.ServiceAddress; +import com.exasol.udfdebugging.LocalServiceExposer; import com.exasol.udfdebugging.Module; public class DebuggingModule implements Module { @@ -20,8 +21,7 @@ public DebuggingModule(final LocalServiceExposer localServiceExposer) { @Override public Stream getJvmOptions() { - final ExposedServiceAddress proxyForHostPort = this.localServiceExposer - .exposeLocalServiceToDatabase(DEBUGGING_PORT); + final ServiceAddress proxyForHostPort = this.localServiceExposer.exposeLocalServiceToDatabase(DEBUGGING_PORT); return Stream.of("-agentlib:jdwp=transport=dt_socket,server=n,address=" + proxyForHostPort.getHostName() + ":" + proxyForHostPort.getPort() + ",suspend=y"); } diff --git a/src/test/java/com/exasol/udfdebugging/modules/TestSetup.java b/src/test/java/com/exasol/udfdebugging/modules/TestSetup.java index b1d221f..e92d43b 100644 --- a/src/test/java/com/exasol/udfdebugging/modules/TestSetup.java +++ b/src/test/java/com/exasol/udfdebugging/modules/TestSetup.java @@ -8,7 +8,7 @@ import com.exasol.containers.ExasolContainer; import com.exasol.dbbuilder.dialects.exasol.*; import com.exasol.dbbuilder.dialects.exasol.udf.UdfScript; -import com.exasol.udfdebugging.ExposedServiceAddress; +import com.exasol.exasoltestsetup.ServiceAddress; import com.exasol.udfdebugging.LocalServiceExposer; /** @@ -25,7 +25,7 @@ public TestSetup() { } public LocalServiceExposer getHostPortProxy() { - return port -> new ExposedServiceAddress(this.exasol.getHostIp(), port); + return port -> new ServiceAddress(this.exasol.getHostIp(), port); } public Bucket getDefaultBucket() { diff --git a/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleTest.java b/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleTest.java index 5eb4370..b973152 100644 --- a/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleTest.java +++ b/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleTest.java @@ -12,14 +12,14 @@ import com.exasol.bucketfs.Bucket; import com.exasol.bucketfs.BucketAccessException; -import com.exasol.udfdebugging.ExposedServiceAddress; +import com.exasol.exasoltestsetup.ServiceAddress; class CoverageModuleTest { @Test void testUpload() throws InterruptedException, BucketAccessException, TimeoutException { final Bucket bucket = mock(Bucket.class); - new CoverageModule((port) -> new ExposedServiceAddress("1.2.3.4", port), bucket); + new CoverageModule((port) -> new ServiceAddress("1.2.3.4", port), bucket); verify(bucket).uploadFile(Path.of("target", "jacoco-agent", "org.jacoco.agent-runtime.jar"), "org.jacoco.agent-runtime.jar"); } @@ -29,8 +29,7 @@ void testGetJvmOptions() { final Bucket bucket = mock(Bucket.class); when(bucket.getBucketFsName()).thenReturn("my_bucketfs"); when(bucket.getBucketName()).thenReturn("my_bucket"); - final CoverageModule coverageModule = new CoverageModule((port) -> new ExposedServiceAddress("1.2.3.4", port), - bucket); + final CoverageModule coverageModule = new CoverageModule((port) -> new ServiceAddress("1.2.3.4", port), bucket); assertThat(coverageModule.getJvmOptions().collect(Collectors.toList()), contains( "-javaagent:/buckets/my_bucketfs/my_bucket/org.jacoco.agent-runtime.jar=output=tcpclient,address=1.2.3.4,port=3002")); } From f8ca7453a9f81327cb1da092838c644347e6a810 Mon Sep 17 00:00:00 2001 From: jakobbraun Date: Thu, 15 Jul 2021 04:13:06 -0300 Subject: [PATCH 09/37] feature/20 jprofiler (#22) * #20 Added module for JProfiler Co-authored-by: Muhammet Orazov --- .github/workflows/broken_links_checker.yml | 9 +- ...ase_droid_upload_github_release_assets.yml | 7 +- README.md | 23 ++- dependencies.md | 131 +++++++++--------- doc/changes/changes_0.4.0.md | 1 + pom.xml | 45 ++---- .../com/exasol/udfdebugging/UdfTestSetup.java | 3 +- .../modules/coverage/CoverageModule.java | 16 +-- .../InArchiveProfilerAgentPathDetector.java | 49 +++++++ .../modules/jprofiler/JProfilerModule.java | 70 ++++++++++ .../jprofiler/JProfilerModuleFactory.java | 24 ++++ .../modules/coverage/CoverageModuleTest.java | 3 +- ...nArchiveProfilerAgentPathDetectorTest.java | 17 +++ .../jprofiler/JProfilerModuleTest.java | 43 ++++++ .../resources/jprofilerArchiveMock.tar.gz | Bin 0 -> 194 bytes 15 files changed, 327 insertions(+), 114 deletions(-) create mode 100644 src/main/java/com/exasol/udfdebugging/modules/jprofiler/InArchiveProfilerAgentPathDetector.java create mode 100644 src/main/java/com/exasol/udfdebugging/modules/jprofiler/JProfilerModule.java create mode 100644 src/main/java/com/exasol/udfdebugging/modules/jprofiler/JProfilerModuleFactory.java create mode 100644 src/test/java/com/exasol/udfdebugging/modules/jprofiler/InArchiveProfilerAgentPathDetectorTest.java create mode 100644 src/test/java/com/exasol/udfdebugging/modules/jprofiler/JProfilerModuleTest.java create mode 100644 src/test/resources/jprofilerArchiveMock.tar.gz diff --git a/.github/workflows/broken_links_checker.yml b/.github/workflows/broken_links_checker.yml index 6697080..6a69306 100644 --- a/.github/workflows/broken_links_checker.yml +++ b/.github/workflows/broken_links_checker.yml @@ -10,8 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: lychee Link Checker - id: lc - uses: lycheeverse/lychee-action@v1.0.6 - - name: Fail if there were link errors - run: exit ${{ steps.lc.outputs.exit_code }} \ No newline at end of file + - uses: gaurav-nelson/github-action-markdown-link-check@v1 + with: + use-quiet-mode: 'yes' + use-verbose-mode: 'yes' \ No newline at end of file diff --git a/.github/workflows/release_droid_upload_github_release_assets.yml b/.github/workflows/release_droid_upload_github_release_assets.yml index 7b20aa3..aeb2121 100644 --- a/.github/workflows/release_droid_upload_github_release_assets.yml +++ b/.github/workflows/release_droid_upload_github_release_assets.yml @@ -32,4 +32,9 @@ jobs: uses: shogo82148/actions-upload-release-asset@v1 with: upload_url: ${{ github.event.inputs.upload_url }} - asset_path: target/*.jar \ No newline at end of file + asset_path: target/*.jar + - name: Upload error-code-report + uses: shogo82148/actions-upload-release-asset@v1 + with: + upload_url: ${{ github.event.inputs.upload_url }} + asset_path: target/error_code_report.json \ No newline at end of file diff --git a/README.md b/README.md index 86e7d74..bd3966d 100644 --- a/README.md +++ b/README.md @@ -51,8 +51,29 @@ This module installs a jacoco agent to the UDF JVM and receives the execution da This module requires additional maven configuration. Use the [project-keeper's](https://github.com/exasol/project-keeper-maven-plugin) `udf_coverage` module to verify it. +### JProfiler + +System property: `test.jprofiler` + +This module allows you to profile UDF runs using [JProfiler](https://www.ej-technologies.com/products/jprofiler/overview.html). For that it uploads the JProfiler archive to BucketFs and adds the agent to the UDF command. + +Since JProfiler uses a forward TCP connection you can only profile one UDF instance at once. Make sure that you don't start multiple parallel instances. + +#### Usage + +* Install JProfiler on your system +* Download JProfiler for Linux without JRE as `.tar.gz` (Also choose the Linux version if you're on a different operating system!) +* Now you've two options: + * Store it as `jprofiler.tar.gz` in your home directory + * Store it somewhere and pass `-DjProfilerAgent=` to each test run +* Run your tests with `-Dtest.jprofiler=true` +* Find out the IPv4 address of your Exasol DB (for docker use `docker inspect`) +* Start JProfiler GUI +* Connect to `:11002` + * The UDF execution will wait until you connect the profiler + * Ensure that the port is reachable from your system (for AWS instances you can use an SSH tunnel from inside JProfiler) + ## Additional Information * [Changelog](doc/changes/changelog.md) * [Dependencies](dependencies.md) - diff --git a/dependencies.md b/dependencies.md index 43b66a2..17109cd 100644 --- a/dependencies.md +++ b/dependencies.md @@ -10,87 +10,90 @@ | [JaCoCo :: Core][4] | [Eclipse Public License 2.0][5] | | [BucketFS Java][6] | [MIT][3] | | [exasol-test-setup-abstraction-java][8] | [MIT][3] | -| [Test Database Builder for Java][10] | [MIT][3] | -| [SLF4J API Module][12] | [MIT License][13] | +| [Apache Commons Compress][10] | [Apache License, Version 2.0][11] | +| [Test Database Builder for Java][12] | [MIT][3] | +| [SLF4J API Module][14] | [MIT License][15] | ## Test Dependencies | Dependency | License | | ----------------------------------------------- | --------------------------------- | | [JaCoCo :: Agent][4] | [Eclipse Public License 2.0][5] | -| [JUnit Jupiter Engine][16] | [Eclipse Public License v2.0][17] | -| [JUnit Jupiter Params][16] | [Eclipse Public License v2.0][17] | -| [mockito-core][20] | [The MIT License][21] | -| [Hamcrest All][22] | [New BSD License][23] | -| [Test containers for Exasol on Docker][24] | [MIT][3] | -| [Testcontainers :: JUnit Jupiter Extension][26] | [MIT][27] | +| [JUnit Jupiter Engine][18] | [Eclipse Public License v2.0][19] | +| [JUnit Jupiter Params][18] | [Eclipse Public License v2.0][19] | +| [mockito-core][22] | [The MIT License][23] | +| [Hamcrest All][24] | [New BSD License][25] | +| [Test containers for Exasol on Docker][26] | [MIT][3] | +| [Testcontainers :: JUnit Jupiter Extension][28] | [MIT][29] | ## Plugin Dependencies | Dependency | License | | ------------------------------------------------------- | ---------------------------------------------- | -| [Maven Surefire Plugin][28] | [Apache License, Version 2.0][29] | -| [Maven Failsafe Plugin][30] | [Apache License, Version 2.0][29] | -| [JaCoCo :: Maven Plugin][4] | [Eclipse Public License 2.0][5] | -| [Apache Maven Compiler Plugin][34] | [Apache License, Version 2.0][29] | -| [Maven Dependency Plugin][36] | [The Apache Software License, Version 2.0][37] | -| [Versions Maven Plugin][38] | [Apache License, Version 2.0][29] | -| [Apache Maven Source Plugin][40] | [Apache License, Version 2.0][29] | -| [Apache Maven Javadoc Plugin][42] | [Apache License, Version 2.0][29] | -| [Apache Maven GPG Plugin][44] | [Apache License, Version 2.0][37] | -| [org.sonatype.ossindex.maven:ossindex-maven-plugin][46] | [ASL2][37] | -| [Apache Maven Enforcer Plugin][48] | [Apache License, Version 2.0][29] | -| [Project keeper maven plugin][50] | [MIT][3] | -| [Maven Deploy Plugin][52] | [The Apache Software License, Version 2.0][37] | -| [Nexus Staging Maven Plugin][54] | [Eclipse Public License][55] | -| [error-code-crawler-maven-plugin][56] | [MIT][3] | -| [Reproducible Build Maven Plugin][58] | [Apache 2.0][37] | -| [Maven Clean Plugin][60] | [The Apache Software License, Version 2.0][37] | -| [Maven Resources Plugin][62] | [The Apache Software License, Version 2.0][37] | -| [Maven JAR Plugin][64] | [The Apache Software License, Version 2.0][37] | -| [Maven Install Plugin][66] | [The Apache Software License, Version 2.0][37] | -| [Maven Site Plugin 3][68] | [The Apache Software License, Version 2.0][37] | +| [Maven Surefire Plugin][30] | [Apache License, Version 2.0][11] | +| [Maven Failsafe Plugin][32] | [Apache License, Version 2.0][11] | +| [JaCoCo :: Maven Plugin][34] | [Eclipse Public License 2.0][5] | +| [Apache Maven Compiler Plugin][36] | [Apache License, Version 2.0][11] | +| [Maven Dependency Plugin][38] | [The Apache Software License, Version 2.0][39] | +| [Versions Maven Plugin][40] | [Apache License, Version 2.0][11] | +| [Apache Maven Source Plugin][42] | [Apache License, Version 2.0][11] | +| [Apache Maven Javadoc Plugin][44] | [Apache License, Version 2.0][11] | +| [Apache Maven GPG Plugin][46] | [Apache License, Version 2.0][39] | +| [org.sonatype.ossindex.maven:ossindex-maven-plugin][48] | [ASL2][39] | +| [Apache Maven Enforcer Plugin][50] | [Apache License, Version 2.0][11] | +| [Project keeper maven plugin][52] | [MIT][3] | +| [Maven Deploy Plugin][54] | [The Apache Software License, Version 2.0][39] | +| [Nexus Staging Maven Plugin][56] | [Eclipse Public License][57] | +| [error-code-crawler-maven-plugin][58] | [MIT][3] | +| [Reproducible Build Maven Plugin][60] | [Apache 2.0][39] | +| [Maven Clean Plugin][62] | [The Apache Software License, Version 2.0][39] | +| [Maven Resources Plugin][64] | [The Apache Software License, Version 2.0][39] | +| [Maven JAR Plugin][66] | [The Apache Software License, Version 2.0][39] | +| [Maven Install Plugin][68] | [The Apache Software License, Version 2.0][39] | +| [Maven Site Plugin 3][70] | [The Apache Software License, Version 2.0][39] | [4]: https://www.eclemma.org/jacoco/index.html -[50]: https://github.com/exasol/project-keeper-maven-plugin +[52]: https://github.com/exasol/project-keeper-maven-plugin [6]: https://github.com/exasol/bucketfs-java [2]: https://github.com/exasol/error-reporting-java [0]: https://javaee.github.io/jsonp -[37]: http://www.apache.org/licenses/LICENSE-2.0.txt -[28]: https://maven.apache.org/surefire/maven-surefire-plugin/ -[54]: http://www.sonatype.com/public-parent/nexus-maven-plugins/nexus-staging/nexus-staging-maven-plugin/ -[60]: http://maven.apache.org/plugins/maven-clean-plugin/ +[39]: http://www.apache.org/licenses/LICENSE-2.0.txt +[30]: https://maven.apache.org/surefire/maven-surefire-plugin/ +[56]: http://www.sonatype.com/public-parent/nexus-maven-plugins/nexus-staging/nexus-staging-maven-plugin/ +[62]: http://maven.apache.org/plugins/maven-clean-plugin/ [3]: https://opensource.org/licenses/MIT -[20]: https://github.com/mockito/mockito -[30]: https://maven.apache.org/surefire/maven-failsafe-plugin/ -[36]: http://maven.apache.org/plugins/maven-dependency-plugin/ -[38]: http://www.mojohaus.org/versions-maven-plugin/ -[34]: https://maven.apache.org/plugins/maven-compiler-plugin/ +[22]: https://github.com/mockito/mockito +[32]: https://maven.apache.org/surefire/maven-failsafe-plugin/ +[12]: https://github.com/exasol/test-db-builder-java +[10]: https://commons.apache.org/proper/commons-compress/ +[38]: http://maven.apache.org/plugins/maven-dependency-plugin/ +[40]: http://www.mojohaus.org/versions-maven-plugin/ +[36]: https://maven.apache.org/plugins/maven-compiler-plugin/ [1]: https://oss.oracle.com/licenses/CDDL+GPL-1.1 -[27]: http://opensource.org/licenses/MIT -[44]: http://maven.apache.org/plugins/maven-gpg-plugin/ +[29]: http://opensource.org/licenses/MIT +[46]: http://maven.apache.org/plugins/maven-gpg-plugin/ [5]: https://www.eclipse.org/legal/epl-2.0/ -[55]: http://www.eclipse.org/legal/epl-v10.html -[24]: https://github.com/exasol/exasol-testcontainers -[22]: https://github.com/hamcrest/JavaHamcrest/hamcrest-all -[58]: http://zlika.github.io/reproducible-build-maven-plugin -[64]: http://maven.apache.org/plugins/maven-jar-plugin/ -[13]: http://www.opensource.org/licenses/mit-license.php -[29]: https://www.apache.org/licenses/LICENSE-2.0.txt -[48]: https://maven.apache.org/enforcer/maven-enforcer-plugin/ -[21]: https://github.com/mockito/mockito/blob/release/3.x/LICENSE -[17]: https://www.eclipse.org/legal/epl-v20.html -[23]: http://www.opensource.org/licenses/bsd-license.php -[66]: http://maven.apache.org/plugins/maven-install-plugin/ -[16]: https://junit.org/junit5/ -[46]: https://sonatype.github.io/ossindex-maven/maven-plugin/ -[26]: https://testcontainers.org -[40]: https://maven.apache.org/plugins/maven-source-plugin/ -[12]: http://www.slf4j.org -[52]: http://maven.apache.org/plugins/maven-deploy-plugin/ -[68]: http://maven.apache.org/plugins/maven-site-plugin/ -[62]: http://maven.apache.org/plugins/maven-resources-plugin/ -[42]: https://maven.apache.org/plugins/maven-javadoc-plugin/ -[56]: https://github.com/exasol/error-code-crawler-maven-plugin +[57]: http://www.eclipse.org/legal/epl-v10.html +[26]: https://github.com/exasol/exasol-testcontainers +[34]: https://www.jacoco.org/jacoco/trunk/doc/maven.html +[24]: https://github.com/hamcrest/JavaHamcrest/hamcrest-all +[23]: https://github.com/mockito/mockito/blob/main/LICENSE +[60]: http://zlika.github.io/reproducible-build-maven-plugin +[66]: http://maven.apache.org/plugins/maven-jar-plugin/ +[15]: http://www.opensource.org/licenses/mit-license.php +[11]: https://www.apache.org/licenses/LICENSE-2.0.txt +[50]: https://maven.apache.org/enforcer/maven-enforcer-plugin/ +[19]: https://www.eclipse.org/legal/epl-v20.html +[25]: http://www.opensource.org/licenses/bsd-license.php +[68]: http://maven.apache.org/plugins/maven-install-plugin/ +[18]: https://junit.org/junit5/ +[48]: https://sonatype.github.io/ossindex-maven/maven-plugin/ +[28]: https://testcontainers.org +[42]: https://maven.apache.org/plugins/maven-source-plugin/ +[14]: http://www.slf4j.org +[54]: http://maven.apache.org/plugins/maven-deploy-plugin/ +[70]: http://maven.apache.org/plugins/maven-site-plugin/ +[64]: http://maven.apache.org/plugins/maven-resources-plugin/ +[44]: https://maven.apache.org/plugins/maven-javadoc-plugin/ +[58]: https://github.com/exasol/error-code-crawler-maven-plugin [8]: https://github.com/exasol/exasol-test-setup-abstraction-java -[10]: https://github.com/exasol/test-db-builder diff --git a/doc/changes/changes_0.4.0.md b/doc/changes/changes_0.4.0.md index 24b11a9..8008b76 100644 --- a/doc/changes/changes_0.4.0.md +++ b/doc/changes/changes_0.4.0.md @@ -6,6 +6,7 @@ Code name: * #15: Add API for host port proxy * #26: Added support for exasol-test-setup-abstraction +* #20: Added module for JProfiler ## Refactoring: diff --git a/pom.xml b/pom.xml index d9b9e59..83549e4 100644 --- a/pom.xml +++ b/pom.xml @@ -12,12 +12,12 @@ UTF-8 UTF-8 11 - 5.7.1 + 5.7.2 1.7.1 11.0.0 true - 0.8.6 - 1.15.2 + 0.8.7 + 1.15.3 3.0.0-M4 @@ -50,26 +50,6 @@ scm:git:https://github.com/exasol/udf-debugging-java.git https://github.com/exasol/udf-debugging-java/tree/master - - - maven.exasol.com - https://maven.exasol.com/artifactory/exasol-releases - - false - - - - maven.exasol.com-snapshots - https://maven.exasol.com/artifactory/exasol-snapshots - - true - - - - jitpack.io - https://jitpack.io - - javax.json @@ -96,12 +76,17 @@ com.exasol bucketfs-java - 1.0.0 + 2.0.1 com.exasol exasol-test-setup-abstraction-java - 0.1.0 + 0.1.1 + + + org.apache.commons + commons-compress + 1.21 @@ -119,7 +104,7 @@ org.mockito mockito-core - 3.8.0 + 3.11.2 test @@ -132,7 +117,7 @@ com.exasol exasol-testcontainers - 3.5.2 + 3.5.3 test @@ -144,12 +129,12 @@ com.exasol test-db-builder-java - 3.1.1 + 3.2.0 org.slf4j slf4j-api - 1.7.30 + 1.7.31 compile @@ -369,7 +354,7 @@ com.exasol project-keeper-maven-plugin - 0.9.0 + 0.10.0 diff --git a/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java b/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java index 5336973..e12d17c 100644 --- a/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java +++ b/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java @@ -11,13 +11,14 @@ import com.exasol.exasoltestsetup.ServiceAddress; import com.exasol.udfdebugging.modules.coverage.CoverageModuleFactory; import com.exasol.udfdebugging.modules.debugging.DebuggingModuleFactory; +import com.exasol.udfdebugging.modules.jprofiler.JProfilerModuleFactory; /** * Test setup for testing UDFs in the database. */ public class UdfTestSetup { private static final List AVAILABLE_MODULES = List.of(new DebuggingModuleFactory(), - new CoverageModuleFactory()); + new CoverageModuleFactory(), new JProfilerModuleFactory()); private static final Logger LOGGER = LoggerFactory.getLogger(UdfTestSetup.class); private final List enabledModules; diff --git a/src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModule.java b/src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModule.java index 33e5ed9..d8272f9 100644 --- a/src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModule.java +++ b/src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModule.java @@ -1,5 +1,6 @@ package com.exasol.udfdebugging.modules.coverage; +import java.io.FileNotFoundException; import java.nio.file.Path; import java.util.concurrent.TimeoutException; import java.util.stream.Stream; @@ -53,17 +54,10 @@ public Stream getJvmOptions() { private void uploadAgentToBucketFs(final Bucket bucket) { try { bucket.uploadFile(JACOCO_AGENT_PATH, JACOCO_AGENT_NAME); - } catch (final TimeoutException | BucketAccessException exception) { - throw getUploadFailedException(exception); - } catch (final InterruptedException exception) { - Thread.currentThread().interrupt(); - throw getUploadFailedException(exception); + } catch (final TimeoutException | BucketAccessException | FileNotFoundException exception) { + throw new IllegalStateException( + ExaError.messageBuilder("E-UDJ-5").message("Failed to upload jacoco agent to BucketFS.").toString(), + exception); } } - - private IllegalStateException getUploadFailedException(final Exception exception) { - return new IllegalStateException( - ExaError.messageBuilder("E-UDJ-5").message("Failed to upload jacoco agent to BucketFS.").toString(), - exception); - } } diff --git a/src/main/java/com/exasol/udfdebugging/modules/jprofiler/InArchiveProfilerAgentPathDetector.java b/src/main/java/com/exasol/udfdebugging/modules/jprofiler/InArchiveProfilerAgentPathDetector.java new file mode 100644 index 0000000..bf3fef4 --- /dev/null +++ b/src/main/java/com/exasol/udfdebugging/modules/jprofiler/InArchiveProfilerAgentPathDetector.java @@ -0,0 +1,49 @@ +package com.exasol.udfdebugging.modules.jprofiler; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; + +import org.apache.commons.compress.archivers.ArchiveEntry; +import org.apache.commons.compress.archivers.tar.TarArchiveInputStream; +import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream; + +import com.exasol.errorreporting.ExaError; + +/** + * This class finds the path to the libjprofilerti.so in the jprofiler tar.gz archive. + */ +class InArchiveProfilerAgentPathDetector { + private static final String AGENT_NAME = "linux-x64/libjprofilerti.so"; + + /** + * Find the path to the libjprofilerti.so in the jprofiler tar.gz archive. + * + * @param jprofilerArchive path of the jprofiler tar.gz archive + * @return path to the agent lib inside of the archive + */ + String findPathToAgent(final Path jprofilerArchive) { + try (final TarArchiveInputStream tarInput = new TarArchiveInputStream( + new GzipCompressorInputStream(Files.newInputStream(jprofilerArchive)))) { + ArchiveEntry nextEntry = tarInput.getNextEntry(); + while (nextEntry != null) { + final String entryPath = nextEntry.getName(); + if (entryPath.endsWith(AGENT_NAME)) { + return entryPath; + } + nextEntry = tarInput.getNextEntry(); + } + } catch (final IOException exception) { + throw new IllegalStateException(ExaError.messageBuilder("F-UDJ-14") + .message("Failed to extract JProfiler tar.gz archive for extracting the version information.") + .ticketMitigation().toString(), exception); + } + throw new IllegalStateException(ExaError.messageBuilder("E-UDJ-15") + .message("Could not find " + AGENT_NAME + " in the provided jprofiler archive ({{archive file}}).", + jprofilerArchive) + .mitigation("Make sure that you specified the correct jprofiler archive.") + .mitigation( + "Future version of JProfiler could also have different agent file names. In that case, please open a ticket.") + .toString()); + } +} diff --git a/src/main/java/com/exasol/udfdebugging/modules/jprofiler/JProfilerModule.java b/src/main/java/com/exasol/udfdebugging/modules/jprofiler/JProfilerModule.java new file mode 100644 index 0000000..8ffbb4c --- /dev/null +++ b/src/main/java/com/exasol/udfdebugging/modules/jprofiler/JProfilerModule.java @@ -0,0 +1,70 @@ +package com.exasol.udfdebugging.modules.jprofiler; + +import java.io.FileNotFoundException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.concurrent.TimeoutException; +import java.util.stream.Stream; + +import com.exasol.bucketfs.Bucket; +import com.exasol.bucketfs.BucketAccessException; +import com.exasol.errorreporting.ExaError; +import com.exasol.udfdebugging.Module; + +/** + * {@link Module} for adding a JProfiler to an UDF instance. + */ +class JProfilerModule implements Module { + public static final String AGENT_OPTION = "jProfilerAgent"; + private final String jvmOption; + private final Path jprofilerArchive; + + /** + * Create a new instance of {@link JProfilerModule}. + * + * @param bucket bucket to upload the profiler to + */ + JProfilerModule(final Bucket bucket) { + this.jprofilerArchive = getJProfilerArchive(); + assertProfilerExists(this.jprofilerArchive); + final String inArchivePath = new InArchiveProfilerAgentPathDetector().findPathToAgent(this.jprofilerArchive); + uploadProfiler(bucket); + this.jvmOption = "-agentpath:" + "/buckets/" + bucket.getBucketFsName() + "/" + bucket.getBucketName() + + "/jprofiler/" + inArchivePath + "=port=11002"; + } + + private void uploadProfiler(final Bucket bucket) { + try { + bucket.uploadFile(this.jprofilerArchive, "jprofiler.tar.gz"); + } catch (final BucketAccessException | TimeoutException | FileNotFoundException exception) { + throw new IllegalStateException( + ExaError.messageBuilder("E-UDJ-13").message("Failed to upload jprofiler tar").toString(), + exception); + } + } + + private void assertProfilerExists(final Path jprofilerAgent) { + if (!Files.exists(jprofilerAgent)) { + throw new IllegalStateException(ExaError.messageBuilder("E-UDJ-8") + .message("Could not find jprofiler archive or open on path {{agent path}}).", jprofilerAgent) + .mitigation("Please download the JProfiler for Linux without JRE from the JProfiler website " + + "and specify the commandline option -D" + AGENT_OPTION + + "= or save it as ~/jprofiler.tar.gz.") + .toString()); + } + } + + private Path getJProfilerArchive() { + final String jProfilerAgentProperty = System.getProperty(AGENT_OPTION, ""); + if (jProfilerAgentProperty.isBlank()) { + return Path.of(System.getProperty("user.home")).resolve("jprofiler.tar.gz"); + } else { + return Path.of(jProfilerAgentProperty); + } + } + + @Override + public Stream getJvmOptions() { + return Stream.of(this.jvmOption); + } +} diff --git a/src/main/java/com/exasol/udfdebugging/modules/jprofiler/JProfilerModuleFactory.java b/src/main/java/com/exasol/udfdebugging/modules/jprofiler/JProfilerModuleFactory.java new file mode 100644 index 0000000..35016a5 --- /dev/null +++ b/src/main/java/com/exasol/udfdebugging/modules/jprofiler/JProfilerModuleFactory.java @@ -0,0 +1,24 @@ +package com.exasol.udfdebugging.modules.jprofiler; + +import com.exasol.bucketfs.Bucket; +import com.exasol.udfdebugging.*; +import com.exasol.udfdebugging.Module; +import com.exasol.udfdebugging.modules.AbstractModuleFactory; + +/** + * {@link ModuleFactory} for {@link JProfilerModule}. + */ +public class JProfilerModuleFactory extends AbstractModuleFactory { + + /** + * Create a new instance of {@link JProfilerModuleFactory}. + */ + public JProfilerModuleFactory() { + super("jprofiler"); + } + + @Override + public Module buildModule(final LocalServiceExposer localServiceExposer, final Bucket bucket) { + return new JProfilerModule(bucket); + } +} diff --git a/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleTest.java b/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleTest.java index b973152..214bb26 100644 --- a/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleTest.java +++ b/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleTest.java @@ -4,6 +4,7 @@ import static org.hamcrest.Matchers.contains; import static org.mockito.Mockito.*; +import java.io.FileNotFoundException; import java.nio.file.Path; import java.util.concurrent.TimeoutException; import java.util.stream.Collectors; @@ -17,7 +18,7 @@ class CoverageModuleTest { @Test - void testUpload() throws InterruptedException, BucketAccessException, TimeoutException { + void testUpload() throws BucketAccessException, TimeoutException, FileNotFoundException { final Bucket bucket = mock(Bucket.class); new CoverageModule((port) -> new ServiceAddress("1.2.3.4", port), bucket); verify(bucket).uploadFile(Path.of("target", "jacoco-agent", "org.jacoco.agent-runtime.jar"), diff --git a/src/test/java/com/exasol/udfdebugging/modules/jprofiler/InArchiveProfilerAgentPathDetectorTest.java b/src/test/java/com/exasol/udfdebugging/modules/jprofiler/InArchiveProfilerAgentPathDetectorTest.java new file mode 100644 index 0000000..3a12816 --- /dev/null +++ b/src/test/java/com/exasol/udfdebugging/modules/jprofiler/InArchiveProfilerAgentPathDetectorTest.java @@ -0,0 +1,17 @@ +package com.exasol.udfdebugging.modules.jprofiler; + +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.MatcherAssert.assertThat; + +import java.nio.file.Path; + +import org.junit.jupiter.api.Test; + +class InArchiveProfilerAgentPathDetectorTest { + @Test + void testExtractPath() { + final Path exampleArchive = Path.of("src", "test", "resources", "jprofilerArchiveMock.tar.gz"); + assertThat(new InArchiveProfilerAgentPathDetector().findPathToAgent(exampleArchive), + equalTo("subfolderA/linux-x64/libjprofilerti.so")); + } +} \ No newline at end of file diff --git a/src/test/java/com/exasol/udfdebugging/modules/jprofiler/JProfilerModuleTest.java b/src/test/java/com/exasol/udfdebugging/modules/jprofiler/JProfilerModuleTest.java new file mode 100644 index 0000000..ff5741c --- /dev/null +++ b/src/test/java/com/exasol/udfdebugging/modules/jprofiler/JProfilerModuleTest.java @@ -0,0 +1,43 @@ +package com.exasol.udfdebugging.modules.jprofiler; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.contains; +import static org.mockito.Mockito.*; + +import java.io.FileNotFoundException; +import java.nio.file.Path; +import java.util.concurrent.TimeoutException; +import java.util.stream.Collectors; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import com.exasol.bucketfs.Bucket; +import com.exasol.bucketfs.BucketAccessException; + +class JProfilerModuleTest { + private static final Path MOCK_AGENT_ARCHIVE = Path.of("src", "test", "resources", "jprofilerArchiveMock.tar.gz"); + + @BeforeAll + static void beforeAll() { + System.setProperty(JProfilerModule.AGENT_OPTION, MOCK_AGENT_ARCHIVE.toString()); + } + + @Test + void testUpload() throws BucketAccessException, TimeoutException, FileNotFoundException { + final Bucket bucket = mock(Bucket.class); + new JProfilerModule(bucket); + verify(bucket).uploadFile(MOCK_AGENT_ARCHIVE, "jprofiler.tar.gz"); + } + + @Test + void testGetJvmOptions() { + final Bucket bucket = mock(Bucket.class); + when(bucket.getBucketFsName()).thenReturn("my_bucketfs"); + when(bucket.getBucketName()).thenReturn("my_bucket"); + final JProfilerModule coverageModule = new JProfilerModule(bucket); + assertThat(coverageModule.getJvmOptions().collect(Collectors.toList()), + contains("-agentpath:/buckets/my_bucketfs/my_bucket/jprofiler/subfolderA/linux-x64/libjprofilerti.so" + + "=port=11002")); + } +} \ No newline at end of file diff --git a/src/test/resources/jprofilerArchiveMock.tar.gz b/src/test/resources/jprofilerArchiveMock.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..8f99ba88a40ea64f4c079603bf57bc5e8f3789c5 GIT binary patch literal 194 zcmV;z06qU7iwFP^wC!L31MQMc3c@fDMzi)5xqv$PnatXwwAeywFp{Lu;6$_%KksWL;uc}%_aESx+)~Qi~hYg w`h6Iq=ltX7UrN%3g9KE_I4m>bJb&&#RWWV8T_TgoWHKM;3ehf*d;kmp0NXfWumAu6 literal 0 HcmV?d00001 From 40fb301ee3ec2b2b713873002e0529b6d65a018b Mon Sep 17 00:00:00 2001 From: jakobbraun Date: Fri, 16 Jul 2021 07:38:17 -0300 Subject: [PATCH 10/37] prepared release 0.4.0 (#28) * prepared release 0.4.0 --- dependencies.md | 2 +- doc/changes/changes_0.4.0.md | 27 ++++++++++++++++----------- pom.xml | 5 ++++- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/dependencies.md b/dependencies.md index 17109cd..faa4a6d 100644 --- a/dependencies.md +++ b/dependencies.md @@ -76,7 +76,6 @@ [57]: http://www.eclipse.org/legal/epl-v10.html [26]: https://github.com/exasol/exasol-testcontainers [34]: https://www.jacoco.org/jacoco/trunk/doc/maven.html -[24]: https://github.com/hamcrest/JavaHamcrest/hamcrest-all [23]: https://github.com/mockito/mockito/blob/main/LICENSE [60]: http://zlika.github.io/reproducible-build-maven-plugin [66]: http://maven.apache.org/plugins/maven-jar-plugin/ @@ -88,6 +87,7 @@ [68]: http://maven.apache.org/plugins/maven-install-plugin/ [18]: https://junit.org/junit5/ [48]: https://sonatype.github.io/ossindex-maven/maven-plugin/ +[24]: https://github.com/hamcrest/JavaHamcrest/ [28]: https://testcontainers.org [42]: https://maven.apache.org/plugins/maven-source-plugin/ [14]: http://www.slf4j.org diff --git a/doc/changes/changes_0.4.0.md b/doc/changes/changes_0.4.0.md index 8008b76..ef22173 100644 --- a/doc/changes/changes_0.4.0.md +++ b/doc/changes/changes_0.4.0.md @@ -1,6 +1,6 @@ -# udf-debugging-java 0.4.0, released 2021-XX-XX +# udf-debugging-java 0.4.0, released 2021-07-16 -Code name: +Code name: Added JProfiler Module ## Features / Enhancements @@ -20,23 +20,28 @@ Code name: ### Compile Dependency Updates -* Added `com.exasol:bucketfs-java:1.0.0` +* Added `com.exasol:bucketfs-java:2.0.1` * Updated `com.exasol:error-reporting-java:0.2.0` to `0.4.0` -* Added `com.exasol:exasol-test-setup-abstraction-java:0.1.0` +* Added `com.exasol:exasol-test-setup-abstraction-java:0.1.1` * Removed `com.exasol:exasol-testcontainers:3.3.1` -* Updated `com.exasol:test-db-builder-java:2.0.0` to `3.1.1` +* Updated `com.exasol:test-db-builder-java:2.0.0` to `3.2.0` +* Added `org.apache.commons:commons-compress:1.21` +* Updated `org.jacoco:org.jacoco.core:0.8.6` to `0.8.7` +* Updated `org.slf4j:slf4j-api:1.7.30` to `1.7.31` ### Test Dependency Updates -* Added `com.exasol:exasol-testcontainers:3.5.2` -* Updated `org.junit.jupiter:junit-jupiter-engine:5.6.2` to `5.7.1` -* Updated `org.junit.jupiter:junit-jupiter-params:5.6.2` to `5.7.1` +* Added `com.exasol:exasol-testcontainers:3.5.3` +* Updated `org.jacoco:org.jacoco.agent:0.8.6` to `0.8.7` +* Updated `org.junit.jupiter:junit-jupiter-engine:5.6.2` to `5.7.2` +* Updated `org.junit.jupiter:junit-jupiter-params:5.6.2` to `5.7.2` * Removed `org.junit.platform:junit-platform-runner:1.6.2` -* Updated `org.mockito:mockito-core:3.6.0` to `3.8.0` -* Updated `org.testcontainers:junit-jupiter:1.14.3` to `1.15.2` +* Updated `org.mockito:mockito-core:3.6.0` to `3.11.2` +* Updated `org.testcontainers:junit-jupiter:1.14.3` to `1.15.3` ### Plugin Dependency Updates * Added `com.exasol:error-code-crawler-maven-plugin:0.5.0` -* Updated `com.exasol:project-keeper-maven-plugin:0.3.0` to `0.9.0` +* Updated `com.exasol:project-keeper-maven-plugin:0.3.0` to `0.10.0` * Added `io.github.zlika:reproducible-build-maven-plugin:0.13` +* Updated `org.jacoco:jacoco-maven-plugin:0.8.6` to `0.8.7` diff --git a/pom.xml b/pom.xml index 83549e4..063519d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.exasol udf-debugging-java - 0.4.0-SNAPSHOT + 0.4.0 udf-debugging-java Utilities for debugging, profiling and code coverage measure for UDFs. https://github.com/exasol/udf-debugging-java @@ -367,6 +367,9 @@ maven_central integration_tests + + https://github.com/hamcrest/JavaHamcrest/hamcrest-all|https://github.com/hamcrest/JavaHamcrest/ + From 3444eadb1df182a8e6a21d50305fd8d88dd8eb31 Mon Sep 17 00:00:00 2001 From: jakobbraun Date: Fri, 1 Oct 2021 14:42:36 +0200 Subject: [PATCH 11/37] Refactor/29 replace json (#30) * refactor/29: Replace javax.json by jakarta.json * fixed typo * updated PK --- ...ase_droid_upload_github_release_assets.yml | 7 + dependencies.md | 173 +++++++++--------- doc/changes/changelog.md | 1 + doc/changes/changes_0.4.1.md | 35 ++++ pom.xml | 34 ++-- .../exasol/udfdebugging/PushDownTesting.java | 12 +- 6 files changed, 158 insertions(+), 104 deletions(-) create mode 100644 doc/changes/changes_0.4.1.md diff --git a/.github/workflows/release_droid_upload_github_release_assets.yml b/.github/workflows/release_droid_upload_github_release_assets.yml index aeb2121..97f9914 100644 --- a/.github/workflows/release_droid_upload_github_release_assets.yml +++ b/.github/workflows/release_droid_upload_github_release_assets.yml @@ -28,11 +28,18 @@ jobs: ${{ runner.os }}-maven- - name: Build with Maven skipping tests run: mvn clean verify -DskipTests + - name: Generate sha256sum files + run: find target -maxdepth 1 -name *.jar -exec bash -c 'sha256sum {} > {}.sha256' \; - name: Upload assets to the GitHub release draft uses: shogo82148/actions-upload-release-asset@v1 with: upload_url: ${{ github.event.inputs.upload_url }} asset_path: target/*.jar + - name: Upload sha256sum files + uses: shogo82148/actions-upload-release-asset@v1 + with: + upload_url: ${{ github.event.inputs.upload_url }} + asset_path: target/*.sha256 - name: Upload error-code-report uses: shogo82148/actions-upload-release-asset@v1 with: diff --git a/dependencies.md b/dependencies.md index faa4a6d..a01d149 100644 --- a/dependencies.md +++ b/dependencies.md @@ -3,97 +3,104 @@ ## Compile Dependencies -| Dependency | License | -| --------------------------------------- | -------------------------------------------------------- | -| [JSR 374 (JSON Processing) API][0] | [Dual license consisting of the CDDL v1.1 and GPL v2][1] | -| [error-reporting-java][2] | [MIT][3] | -| [JaCoCo :: Core][4] | [Eclipse Public License 2.0][5] | -| [BucketFS Java][6] | [MIT][3] | -| [exasol-test-setup-abstraction-java][8] | [MIT][3] | -| [Apache Commons Compress][10] | [Apache License, Version 2.0][11] | -| [Test Database Builder for Java][12] | [MIT][3] | -| [SLF4J API Module][14] | [MIT License][15] | +| Dependency | License | +| --------------------------------------- | ------------------------------------------------------------------------------------------------------------ | +| [Jakarta JSON Processing API][0] | [Eclipse Public License 2.0][1]; [GNU General Public License, version 2 with the GNU Classpath Exception][2] | +| [error-reporting-java][3] | [MIT][4] | +| [JaCoCo :: Core][5] | [Eclipse Public License 2.0][6] | +| [BucketFS Java][7] | [MIT][4] | +| [exasol-test-setup-abstraction-java][9] | [MIT][4] | +| [Apache Commons Compress][11] | [Apache License, Version 2.0][12] | +| [Test Database Builder for Java][13] | [MIT][4] | +| [SLF4J API Module][15] | [MIT License][16] | ## Test Dependencies | Dependency | License | | ----------------------------------------------- | --------------------------------- | -| [JaCoCo :: Agent][4] | [Eclipse Public License 2.0][5] | -| [JUnit Jupiter Engine][18] | [Eclipse Public License v2.0][19] | -| [JUnit Jupiter Params][18] | [Eclipse Public License v2.0][19] | -| [mockito-core][22] | [The MIT License][23] | -| [Hamcrest All][24] | [New BSD License][25] | -| [Test containers for Exasol on Docker][26] | [MIT][3] | -| [Testcontainers :: JUnit Jupiter Extension][28] | [MIT][29] | +| [JaCoCo :: Agent][5] | [Eclipse Public License 2.0][6] | +| [JUnit Jupiter Engine][19] | [Eclipse Public License v2.0][20] | +| [JUnit Jupiter Params][19] | [Eclipse Public License v2.0][20] | +| [mockito-core][23] | [The MIT License][24] | +| [Hamcrest All][25] | [New BSD License][26] | +| [Test containers for Exasol on Docker][27] | [MIT][4] | +| [Testcontainers :: JUnit Jupiter Extension][29] | [MIT][30] | + +## Runtime Dependencies + +| Dependency | License | +| ---------------------------- | ------------------------------------------------------------------------------------------------------------ | +| [JSON-P Default Provider][0] | [Eclipse Public License 2.0][1]; [GNU General Public License, version 2 with the GNU Classpath Exception][2] | ## Plugin Dependencies | Dependency | License | | ------------------------------------------------------- | ---------------------------------------------- | -| [Maven Surefire Plugin][30] | [Apache License, Version 2.0][11] | -| [Maven Failsafe Plugin][32] | [Apache License, Version 2.0][11] | -| [JaCoCo :: Maven Plugin][34] | [Eclipse Public License 2.0][5] | -| [Apache Maven Compiler Plugin][36] | [Apache License, Version 2.0][11] | -| [Maven Dependency Plugin][38] | [The Apache Software License, Version 2.0][39] | -| [Versions Maven Plugin][40] | [Apache License, Version 2.0][11] | -| [Apache Maven Source Plugin][42] | [Apache License, Version 2.0][11] | -| [Apache Maven Javadoc Plugin][44] | [Apache License, Version 2.0][11] | -| [Apache Maven GPG Plugin][46] | [Apache License, Version 2.0][39] | -| [org.sonatype.ossindex.maven:ossindex-maven-plugin][48] | [ASL2][39] | -| [Apache Maven Enforcer Plugin][50] | [Apache License, Version 2.0][11] | -| [Project keeper maven plugin][52] | [MIT][3] | -| [Maven Deploy Plugin][54] | [The Apache Software License, Version 2.0][39] | -| [Nexus Staging Maven Plugin][56] | [Eclipse Public License][57] | -| [error-code-crawler-maven-plugin][58] | [MIT][3] | -| [Reproducible Build Maven Plugin][60] | [Apache 2.0][39] | -| [Maven Clean Plugin][62] | [The Apache Software License, Version 2.0][39] | -| [Maven Resources Plugin][64] | [The Apache Software License, Version 2.0][39] | -| [Maven JAR Plugin][66] | [The Apache Software License, Version 2.0][39] | -| [Maven Install Plugin][68] | [The Apache Software License, Version 2.0][39] | -| [Maven Site Plugin 3][70] | [The Apache Software License, Version 2.0][39] | +| [Maven Surefire Plugin][34] | [Apache License, Version 2.0][12] | +| [Maven Failsafe Plugin][36] | [Apache License, Version 2.0][12] | +| [JaCoCo :: Maven Plugin][38] | [Eclipse Public License 2.0][6] | +| [Apache Maven Compiler Plugin][40] | [Apache License, Version 2.0][12] | +| [Maven Dependency Plugin][42] | [The Apache Software License, Version 2.0][43] | +| [Versions Maven Plugin][44] | [Apache License, Version 2.0][12] | +| [Apache Maven Source Plugin][46] | [Apache License, Version 2.0][12] | +| [Apache Maven Javadoc Plugin][48] | [Apache License, Version 2.0][12] | +| [Apache Maven GPG Plugin][50] | [Apache License, Version 2.0][43] | +| [org.sonatype.ossindex.maven:ossindex-maven-plugin][52] | [ASL2][43] | +| [Apache Maven Enforcer Plugin][54] | [Apache License, Version 2.0][12] | +| [Project keeper maven plugin][56] | [MIT][4] | +| [Maven Deploy Plugin][58] | [The Apache Software License, Version 2.0][43] | +| [Nexus Staging Maven Plugin][60] | [Eclipse Public License][61] | +| [error-code-crawler-maven-plugin][62] | [MIT][4] | +| [Reproducible Build Maven Plugin][64] | [Apache 2.0][43] | +| [Maven Clean Plugin][66] | [The Apache Software License, Version 2.0][43] | +| [Maven Resources Plugin][68] | [The Apache Software License, Version 2.0][43] | +| [Maven JAR Plugin][70] | [The Apache Software License, Version 2.0][43] | +| [Maven Install Plugin][72] | [The Apache Software License, Version 2.0][43] | +| [Maven Site Plugin 3][74] | [The Apache Software License, Version 2.0][43] | -[4]: https://www.eclemma.org/jacoco/index.html -[52]: https://github.com/exasol/project-keeper-maven-plugin -[6]: https://github.com/exasol/bucketfs-java -[2]: https://github.com/exasol/error-reporting-java -[0]: https://javaee.github.io/jsonp -[39]: http://www.apache.org/licenses/LICENSE-2.0.txt -[30]: https://maven.apache.org/surefire/maven-surefire-plugin/ -[56]: http://www.sonatype.com/public-parent/nexus-maven-plugins/nexus-staging/nexus-staging-maven-plugin/ -[62]: http://maven.apache.org/plugins/maven-clean-plugin/ -[3]: https://opensource.org/licenses/MIT -[22]: https://github.com/mockito/mockito -[32]: https://maven.apache.org/surefire/maven-failsafe-plugin/ -[12]: https://github.com/exasol/test-db-builder-java -[10]: https://commons.apache.org/proper/commons-compress/ -[38]: http://maven.apache.org/plugins/maven-dependency-plugin/ -[40]: http://www.mojohaus.org/versions-maven-plugin/ -[36]: https://maven.apache.org/plugins/maven-compiler-plugin/ -[1]: https://oss.oracle.com/licenses/CDDL+GPL-1.1 -[29]: http://opensource.org/licenses/MIT -[46]: http://maven.apache.org/plugins/maven-gpg-plugin/ -[5]: https://www.eclipse.org/legal/epl-2.0/ -[57]: http://www.eclipse.org/legal/epl-v10.html -[26]: https://github.com/exasol/exasol-testcontainers -[34]: https://www.jacoco.org/jacoco/trunk/doc/maven.html -[23]: https://github.com/mockito/mockito/blob/main/LICENSE -[60]: http://zlika.github.io/reproducible-build-maven-plugin -[66]: http://maven.apache.org/plugins/maven-jar-plugin/ -[15]: http://www.opensource.org/licenses/mit-license.php -[11]: https://www.apache.org/licenses/LICENSE-2.0.txt -[50]: https://maven.apache.org/enforcer/maven-enforcer-plugin/ -[19]: https://www.eclipse.org/legal/epl-v20.html -[25]: http://www.opensource.org/licenses/bsd-license.php -[68]: http://maven.apache.org/plugins/maven-install-plugin/ -[18]: https://junit.org/junit5/ -[48]: https://sonatype.github.io/ossindex-maven/maven-plugin/ -[24]: https://github.com/hamcrest/JavaHamcrest/ -[28]: https://testcontainers.org -[42]: https://maven.apache.org/plugins/maven-source-plugin/ -[14]: http://www.slf4j.org -[54]: http://maven.apache.org/plugins/maven-deploy-plugin/ -[70]: http://maven.apache.org/plugins/maven-site-plugin/ -[64]: http://maven.apache.org/plugins/maven-resources-plugin/ -[44]: https://maven.apache.org/plugins/maven-javadoc-plugin/ -[58]: https://github.com/exasol/error-code-crawler-maven-plugin -[8]: https://github.com/exasol/exasol-test-setup-abstraction-java +[5]: https://www.eclemma.org/jacoco/index.html +[56]: https://github.com/exasol/project-keeper-maven-plugin +[7]: https://github.com/exasol/bucketfs-java +[3]: https://github.com/exasol/error-reporting-java +[43]: http://www.apache.org/licenses/LICENSE-2.0.txt +[34]: https://maven.apache.org/surefire/maven-surefire-plugin/ +[60]: http://www.sonatype.com/public-parent/nexus-maven-plugins/nexus-staging/nexus-staging-maven-plugin/ +[66]: http://maven.apache.org/plugins/maven-clean-plugin/ +[4]: https://opensource.org/licenses/MIT +[23]: https://github.com/mockito/mockito +[36]: https://maven.apache.org/surefire/maven-failsafe-plugin/ +[13]: https://github.com/exasol/test-db-builder-java +[11]: https://commons.apache.org/proper/commons-compress/ +[42]: http://maven.apache.org/plugins/maven-dependency-plugin/ +[44]: http://www.mojohaus.org/versions-maven-plugin/ +[40]: https://maven.apache.org/plugins/maven-compiler-plugin/ +[30]: http://opensource.org/licenses/MIT +[50]: http://maven.apache.org/plugins/maven-gpg-plugin/ +[6]: https://www.eclipse.org/legal/epl-2.0/ +[61]: http://www.eclipse.org/legal/epl-v10.html +[27]: https://github.com/exasol/exasol-testcontainers +[38]: https://www.jacoco.org/jacoco/trunk/doc/maven.html +[24]: https://github.com/mockito/mockito/blob/main/LICENSE +[64]: http://zlika.github.io/reproducible-build-maven-plugin +[70]: http://maven.apache.org/plugins/maven-jar-plugin/ +[1]: https://projects.eclipse.org/license/epl-2.0 +[16]: http://www.opensource.org/licenses/mit-license.php +[12]: https://www.apache.org/licenses/LICENSE-2.0.txt +[54]: https://maven.apache.org/enforcer/maven-enforcer-plugin/ +[20]: https://www.eclipse.org/legal/epl-v20.html +[26]: http://www.opensource.org/licenses/bsd-license.php +[72]: http://maven.apache.org/plugins/maven-install-plugin/ +[19]: https://junit.org/junit5/ +[52]: https://sonatype.github.io/ossindex-maven/maven-plugin/ +[25]: https://github.com/hamcrest/JavaHamcrest/ +[29]: https://testcontainers.org +[0]: https://github.com/eclipse-ee4j/jsonp +[46]: https://maven.apache.org/plugins/maven-source-plugin/ +[2]: https://projects.eclipse.org/license/secondary-gpl-2.0-cp +[15]: http://www.slf4j.org +[58]: http://maven.apache.org/plugins/maven-deploy-plugin/ +[74]: http://maven.apache.org/plugins/maven-site-plugin/ +[68]: http://maven.apache.org/plugins/maven-resources-plugin/ +[48]: https://maven.apache.org/plugins/maven-javadoc-plugin/ +[62]: https://github.com/exasol/error-code-crawler-maven-plugin +[9]: https://github.com/exasol/exasol-test-setup-abstraction-java diff --git a/doc/changes/changelog.md b/doc/changes/changelog.md index 065a25c..79dd0c1 100644 --- a/doc/changes/changelog.md +++ b/doc/changes/changelog.md @@ -1,5 +1,6 @@ # Changes +* [0.4.1](changes_0.4.1.md) * [0.4.0](changes_0.4.0.md) * [0.3.0](changes_0.3.0.md) * [0.2.0](changes_0.2.0.md) diff --git a/doc/changes/changes_0.4.1.md b/doc/changes/changes_0.4.1.md new file mode 100644 index 0000000..bd4a3b3 --- /dev/null +++ b/doc/changes/changes_0.4.1.md @@ -0,0 +1,35 @@ +# udf-debugging-java 0.4.1, released 2021-10-01 + +Code name: Dependency Updates on Added JProfiler Module + +## Features + +* #29: Replaced javax.json by jakarta.json + +## Dependency Updates + +### Compile Dependency Updates + +* Updated `com.exasol:bucketfs-java:2.0.1` to `2.2.0` +* Updated `com.exasol:exasol-test-setup-abstraction-java:0.1.1` to `0.2.0` +* Updated `com.exasol:test-db-builder-java:3.2.0` to `3.2.1` +* Added `jakarta.json:jakarta.json-api:2.0.1` +* Removed `javax.json:javax.json-api:1.1.4` +* Updated `org.slf4j:slf4j-api:1.7.31` to `1.7.32` + +### Runtime Dependency Updates + +* Added `org.glassfish:jakarta.json:2.0.1` + +### Test Dependency Updates + +* Updated `com.exasol:exasol-testcontainers:3.5.3` to `5.1.0` +* Updated `org.junit.jupiter:junit-jupiter-engine:5.7.2` to `5.8.1` +* Updated `org.junit.jupiter:junit-jupiter-params:5.7.2` to `5.8.1` +* Updated `org.mockito:mockito-core:3.11.2` to `3.12.4` +* Updated `org.testcontainers:junit-jupiter:1.15.3` to `1.16.0` + +### Plugin Dependency Updates + +* Updated `com.exasol:error-code-crawler-maven-plugin:0.5.0` to `0.6.0` +* Updated `com.exasol:project-keeper-maven-plugin:0.10.0` to `1.2.0` diff --git a/pom.xml b/pom.xml index 063519d..4aa9d79 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.exasol udf-debugging-java - 0.4.0 + 0.4.1 udf-debugging-java Utilities for debugging, profiling and code coverage measure for UDFs. https://github.com/exasol/udf-debugging-java @@ -12,12 +12,12 @@ UTF-8 UTF-8 11 - 5.7.2 + 5.8.1 1.7.1 11.0.0 true 0.8.7 - 1.15.3 + 1.16.0 3.0.0-M4 @@ -52,9 +52,15 @@ - javax.json - javax.json-api - 1.1.4 + jakarta.json + jakarta.json-api + 2.0.1 + + + org.glassfish + jakarta.json + 2.0.1 + runtime com.exasol @@ -76,12 +82,12 @@ com.exasol bucketfs-java - 2.0.1 + 2.2.0 com.exasol exasol-test-setup-abstraction-java - 0.1.1 + 0.2.0 org.apache.commons @@ -104,7 +110,7 @@ org.mockito mockito-core - 3.11.2 + 3.12.4 test @@ -117,7 +123,7 @@ com.exasol exasol-testcontainers - 3.5.3 + 5.1.0 test @@ -129,12 +135,12 @@ com.exasol test-db-builder-java - 3.2.0 + 3.2.1 org.slf4j slf4j-api - 1.7.31 + 1.7.32 compile @@ -354,7 +360,7 @@ com.exasol project-keeper-maven-plugin - 0.10.0 + 1.2.0 @@ -401,7 +407,7 @@ com.exasol error-code-crawler-maven-plugin - 0.5.0 + 0.6.0 diff --git a/src/main/java/com/exasol/udfdebugging/PushDownTesting.java b/src/main/java/com/exasol/udfdebugging/PushDownTesting.java index 466baeb..8aa4eb0 100644 --- a/src/main/java/com/exasol/udfdebugging/PushDownTesting.java +++ b/src/main/java/com/exasol/udfdebugging/PushDownTesting.java @@ -1,12 +1,9 @@ package com.exasol.udfdebugging; -import javax.json.Json; -import javax.json.JsonObject; -import javax.json.JsonReader; import java.io.StringReader; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; +import java.sql.*; + +import jakarta.json.*; public class PushDownTesting { public static String getPushDownSql(final Statement statement, final String query) throws SQLException { @@ -17,7 +14,8 @@ public static String getPushDownSql(final Statement statement, final String quer } } - public static String getSelectionThatIsSentToTheAdapter(final Statement statement, final String query) throws SQLException { + public static String getSelectionThatIsSentToTheAdapter(final Statement statement, final String query) + throws SQLException { try (final ResultSet pushDownSqlResult = statement .executeQuery("SELECT PUSHDOWN_JSON FROM (EXPLAIN VIRTUAL " + query + ");")) { pushDownSqlResult.next(); From 5960d3d9948c0ac19a675d8ed7d5499bf0684196 Mon Sep 17 00:00:00 2001 From: jakobbraun Date: Wed, 12 Jan 2022 09:10:57 +0100 Subject: [PATCH 12/37] Feature/31 UDF Logs (#32) * feature/31: Added module for capturing logs from UDFs Co-authored-by: Muhammet Orazov --- .github/workflows/broken_links_checker.yml | 10 +- .github/workflows/ci-build-next-java.yml | 37 ++++++ .github/workflows/dependencies_check.yml | 3 +- ...elease_droid_prepare_original_checksum.yml | 5 +- .../release_droid_print_quick_checksum.yml | 5 +- ...release_droid_release_on_maven_central.yml | 3 +- ...ase_droid_upload_github_release_assets.yml | 5 +- .gitignore | 7 ++ .settings/org.eclipse.jdt.core.prefs | 43 +++++++ .settings/org.eclipse.jdt.ui.prefs | 80 +++++++++++- README.md | 12 ++ dependencies.md | 105 ++++++++-------- doc/changes/changelog.md | 1 + doc/changes/changes_0.5.0.md | 29 +++++ pom.xml | 32 +++-- .../java/com/exasol/udfdebugging/Module.java | 3 +- .../exasol/udfdebugging/ModuleFactory.java | 9 +- .../exasol/udfdebugging/PushDownTesting.java | 20 +++ .../com/exasol/udfdebugging/UdfTestSetup.java | 35 ++++-- .../modules/coverage/CoverageModule.java | 6 + .../coverage/CoverageModuleFactory.java | 8 +- .../modules/debugging/DebuggingModule.java | 9 ++ .../debugging/DebuggingModuleFactory.java | 8 +- .../modules/jprofiler/JProfilerModule.java | 5 + .../jprofiler/JProfilerModuleFactory.java | 5 +- .../modules/udflogs/LogRecorder.java | 115 ++++++++++++++++++ .../modules/udflogs/UdfLogsModule.java | 83 +++++++++++++ .../modules/udflogs/UdfLogsModuleFactory.java | 26 ++++ .../exasol/udfdebugging/UdfTestSetupTest.java | 59 ++++++--- .../udfdebugging/modules/TestSetup.java | 25 ++-- .../modules/coverage/CoverageModuleIT.java | 9 +- .../jprofiler/JProfilerModuleTest.java | 15 ++- .../modules/udflogs/LogRecorderTest.java | 71 +++++++++++ .../modules/udflogs/UdfLogsModuleIT.java | 26 ++++ .../modules/udflogs/UdfLogsModuleTest.java | 54 ++++++++ 35 files changed, 847 insertions(+), 121 deletions(-) create mode 100644 .github/workflows/ci-build-next-java.yml create mode 100644 doc/changes/changes_0.5.0.md create mode 100644 src/main/java/com/exasol/udfdebugging/modules/udflogs/LogRecorder.java create mode 100644 src/main/java/com/exasol/udfdebugging/modules/udflogs/UdfLogsModule.java create mode 100644 src/main/java/com/exasol/udfdebugging/modules/udflogs/UdfLogsModuleFactory.java create mode 100644 src/test/java/com/exasol/udfdebugging/modules/udflogs/LogRecorderTest.java create mode 100644 src/test/java/com/exasol/udfdebugging/modules/udflogs/UdfLogsModuleIT.java create mode 100644 src/test/java/com/exasol/udfdebugging/modules/udflogs/UdfLogsModuleTest.java diff --git a/.github/workflows/broken_links_checker.yml b/.github/workflows/broken_links_checker.yml index 6a69306..c268e21 100644 --- a/.github/workflows/broken_links_checker.yml +++ b/.github/workflows/broken_links_checker.yml @@ -4,13 +4,21 @@ on: schedule: - cron: "0 5 * * *" push: + branches: + - main + pull_request: jobs: linkChecker: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - name: Configure broken links checker + run: | + mkdir -p ./target + echo '{ "aliveStatusCodes": [429, 200] }' > ./target/broken_links_checker.json - uses: gaurav-nelson/github-action-markdown-link-check@v1 with: use-quiet-mode: 'yes' - use-verbose-mode: 'yes' \ No newline at end of file + use-verbose-mode: 'yes' + config-file: ./target/broken_links_checker.json \ No newline at end of file diff --git a/.github/workflows/ci-build-next-java.yml b/.github/workflows/ci-build-next-java.yml new file mode 100644 index 0000000..2abe7cb --- /dev/null +++ b/.github/workflows/ci-build-next-java.yml @@ -0,0 +1,37 @@ +name: CI Build next Java + +on: + push: + branches: + - main + pull_request: + +jobs: + java-17-compatibility: + runs-on: ubuntu-latest + steps: + - name: Checkout the repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Set up JDK 17 + uses: actions/setup-java@v2 + with: + distribution: 'temurin' + java-version: 17 + - name: Cache local Maven repository + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Run tests and build with Maven + run: | + mvn --batch-mode --update-snapshots clean package -DtrimStackTrace=false \ + -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn + - name: Publish Test Report + uses: scacap/action-surefire-report@v1 + if: ${{ always() && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' }} + with: + github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/dependencies_check.yml b/.github/workflows/dependencies_check.yml index 2cb0303..d28c0b4 100644 --- a/.github/workflows/dependencies_check.yml +++ b/.github/workflows/dependencies_check.yml @@ -11,8 +11,9 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set up JDK 11 - uses: actions/setup-java@v1 + uses: actions/setup-java@v2 with: + distribution: 'temurin' java-version: 11 - name: Cache local Maven repository uses: actions/cache@v2 diff --git a/.github/workflows/release_droid_prepare_original_checksum.yml b/.github/workflows/release_droid_prepare_original_checksum.yml index 5133083..650b120 100644 --- a/.github/workflows/release_droid_prepare_original_checksum.yml +++ b/.github/workflows/release_droid_prepare_original_checksum.yml @@ -12,8 +12,9 @@ jobs: with: fetch-depth: 0 - name: Set up JDK 11 - uses: actions/setup-java@v1 + uses: actions/setup-java@v2 with: + distribution: 'temurin' java-version: 11 - name: Cache local Maven repository uses: actions/cache@v2 @@ -23,7 +24,7 @@ jobs: restore-keys: | ${{ runner.os }}-maven- - name: Run tests and build with Maven - run: mvn -B clean verify --file pom.xml + run: mvn --batch-mode clean verify --file pom.xml - name: Prepare checksum run: find target -maxdepth 1 -name *.jar -exec sha256sum "{}" + > original_checksum - name: Upload checksum to the artifactory diff --git a/.github/workflows/release_droid_print_quick_checksum.yml b/.github/workflows/release_droid_print_quick_checksum.yml index f5f938f..746fc43 100644 --- a/.github/workflows/release_droid_print_quick_checksum.yml +++ b/.github/workflows/release_droid_print_quick_checksum.yml @@ -12,8 +12,9 @@ jobs: with: fetch-depth: 0 - name: Set up JDK 11 - uses: actions/setup-java@v1 + uses: actions/setup-java@v2 with: + distribution: 'temurin' java-version: 11 - name: Cache local Maven repository uses: actions/cache@v2 @@ -23,7 +24,7 @@ jobs: restore-keys: | ${{ runner.os }}-maven- - name: Build with Maven skipping tests - run: mvn -B clean verify -DskipTests + run: mvn --batch-mode clean verify -DskipTests - name: Print checksum run: echo 'checksum_start==';find target -maxdepth 1 -name *.jar -exec sha256sum "{}" + | xargs;echo '==checksum_end' diff --git a/.github/workflows/release_droid_release_on_maven_central.yml b/.github/workflows/release_droid_release_on_maven_central.yml index e768946..5758ecf 100644 --- a/.github/workflows/release_droid_release_on_maven_central.yml +++ b/.github/workflows/release_droid_release_on_maven_central.yml @@ -12,8 +12,9 @@ jobs: with: fetch-depth: 0 - name: Set up Maven Central Repository - uses: actions/setup-java@v1 + uses: actions/setup-java@v2 with: + distribution: 'temurin' java-version: 11 server-id: ossrh server-username: MAVEN_USERNAME diff --git a/.github/workflows/release_droid_upload_github_release_assets.yml b/.github/workflows/release_droid_upload_github_release_assets.yml index 97f9914..e2c761b 100644 --- a/.github/workflows/release_droid_upload_github_release_assets.yml +++ b/.github/workflows/release_droid_upload_github_release_assets.yml @@ -16,8 +16,9 @@ jobs: with: fetch-depth: 0 - name: Set up JDK 11 - uses: actions/setup-java@v1 + uses: actions/setup-java@v2 with: + distribution: 'temurin' java-version: 11 - name: Cache local Maven repository uses: actions/cache@v2 @@ -27,7 +28,7 @@ jobs: restore-keys: | ${{ runner.os }}-maven- - name: Build with Maven skipping tests - run: mvn clean verify -DskipTests + run: mvn --batch-mode clean verify -DskipTests - name: Generate sha256sum files run: find target -maxdepth 1 -name *.jar -exec bash -c 'sha256sum {} > {}.sha256' \; - name: Upload assets to the GitHub release draft diff --git a/.gitignore b/.gitignore index c250eb4..3f3c805 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,10 @@ Scripts **/*.log .directory venv/ + +~* +*.lock +*.bak +*.orig +*.old +*.md.html \ No newline at end of file diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index e3a8580..8b5a9aa 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -111,6 +111,7 @@ org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.processAnnotations=enabled org.eclipse.jdt.core.compiler.release=disabled org.eclipse.jdt.core.compiler.source=11 org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false @@ -119,12 +120,20 @@ org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns=false org.eclipse.jdt.core.formatter.align_with_spaces=false org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_annotations_on_enum_constant=49 +org.eclipse.jdt.core.formatter.alignment_for_annotations_on_field=49 +org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable=49 +org.eclipse.jdt.core.formatter.alignment_for_annotations_on_method=49 +org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package=49 +org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter=0 +org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type=49 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assertion_message=0 org.eclipse.jdt.core.formatter.alignment_for_assignment=0 org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16 org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 @@ -142,6 +151,7 @@ org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16 org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0 org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_record_components=16 org.eclipse.jdt.core.formatter.alignment_for_relational_operator=0 org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 @@ -149,14 +159,18 @@ org.eclipse.jdt.core.formatter.alignment_for_shift_operator=0 org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16 org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_record_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_type_annotations=0 org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0 org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0 org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_last_class_body_declaration=0 org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method=1 org.eclipse.jdt.core.formatter.blank_lines_before_field=0 org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 @@ -165,6 +179,7 @@ org.eclipse.jdt.core.formatter.blank_lines_before_method=1 org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 org.eclipse.jdt.core.formatter.blank_lines_before_package=0 org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_statement_group_in_switch=0 org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line @@ -176,6 +191,8 @@ org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_record_constructor=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_record_declaration=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped=true @@ -193,6 +210,7 @@ org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false org.eclipse.jdt.core.formatter.comment.indent_root_tags=false org.eclipse.jdt.core.formatter.comment.indent_tag_description=false org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags=do not insert org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert org.eclipse.jdt.core.formatter.comment.line_length=120 org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true @@ -208,6 +226,7 @@ org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=fals org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_record_header=true org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true org.eclipse.jdt.core.formatter.indent_empty_lines=false @@ -234,6 +253,8 @@ org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=d org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default=insert org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert @@ -263,13 +284,16 @@ org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arg org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_record_components=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_not_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert @@ -286,6 +310,7 @@ org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not ins org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_record_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert @@ -302,6 +327,8 @@ org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case=insert +org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default=insert org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert @@ -321,6 +348,7 @@ org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not in org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_record_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert @@ -347,7 +375,9 @@ org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_ar org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_record_components=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_switch_case_expressions=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert @@ -365,6 +395,8 @@ org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_ org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_constructor=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_declaration=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert @@ -380,6 +412,7 @@ org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_record_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert @@ -419,6 +452,8 @@ org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line=one_line_never org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line=one_line_never org.eclipse.jdt.core.formatter.keep_method_body_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_record_constructor_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_record_declaration_on_one_line=one_line_never org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line=false org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line=false org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line=false @@ -428,7 +463,12 @@ org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line=one_line_never org.eclipse.jdt.core.formatter.lineSplit=120 org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_after_code_block=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block=0 org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_before_code_block=0 org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines @@ -438,14 +478,17 @@ org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=commo org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_record_declaration=common_lines org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true org.eclipse.jdt.core.formatter.tabulation.char=space org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.text_block_indentation=0 org.eclipse.jdt.core.formatter.use_on_off_tags=false org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=true org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true +org.eclipse.jdt.core.formatter.wrap_before_assertion_message_operator=true org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true diff --git a/.settings/org.eclipse.jdt.ui.prefs b/.settings/org.eclipse.jdt.ui.prefs index e7e7880..1add06a 100644 --- a/.settings/org.eclipse.jdt.ui.prefs +++ b/.settings/org.eclipse.jdt.ui.prefs @@ -61,11 +61,12 @@ cleanup_settings_version=2 eclipse.preferences.version=1 editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true formatter_profile=_Exasol -formatter_settings_version=16 +formatter_settings_version=21 org.eclipse.jdt.ui.ignorelowercasenames=true org.eclipse.jdt.ui.importorder=java;javax;org;com; org.eclipse.jdt.ui.ondemandthreshold=3 org.eclipse.jdt.ui.staticondemandthreshold=3 +sp_cleanup.add_all=false sp_cleanup.add_default_serial_version_id=true sp_cleanup.add_generated_serial_version_id=false sp_cleanup.add_missing_annotations=true @@ -79,26 +80,73 @@ sp_cleanup.always_use_blocks=true sp_cleanup.always_use_parentheses_in_expressions=true sp_cleanup.always_use_this_for_non_static_field_access=true sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.array_with_curly=false +sp_cleanup.arrays_fill=false +sp_cleanup.bitwise_conditional_expression=false +sp_cleanup.boolean_literal=false +sp_cleanup.boolean_value_rather_than_comparison=false +sp_cleanup.break_loop=false +sp_cleanup.collection_cloning=false +sp_cleanup.comparing_on_criteria=false +sp_cleanup.comparison_statement=false +sp_cleanup.controlflow_merge=false sp_cleanup.convert_functional_interfaces=true sp_cleanup.convert_to_enhanced_for_loop=true +sp_cleanup.convert_to_enhanced_for_loop_if_loop_var_used=false +sp_cleanup.convert_to_switch_expressions=false sp_cleanup.correct_indentation=true +sp_cleanup.do_while_rather_than_while=false +sp_cleanup.double_negation=false +sp_cleanup.else_if=false +sp_cleanup.embedded_if=false +sp_cleanup.evaluate_nullable=false +sp_cleanup.extract_increment=false sp_cleanup.format_source_code=true sp_cleanup.format_source_code_changes_only=false +sp_cleanup.hash=false +sp_cleanup.if_condition=false sp_cleanup.insert_inferred_type_arguments=false +sp_cleanup.instanceof=false +sp_cleanup.instanceof_keyword=false +sp_cleanup.invert_equals=false +sp_cleanup.join=false +sp_cleanup.lazy_logical_operator=false sp_cleanup.make_local_variable_final=true sp_cleanup.make_parameters_final=true sp_cleanup.make_private_fields_final=true sp_cleanup.make_type_abstract_if_missing_method=false sp_cleanup.make_variable_declarations_final=true +sp_cleanup.map_cloning=false +sp_cleanup.merge_conditional_blocks=false +sp_cleanup.multi_catch=false sp_cleanup.never_use_blocks=false sp_cleanup.never_use_parentheses_in_expressions=false +sp_cleanup.no_string_creation=false +sp_cleanup.no_super=false +sp_cleanup.number_suffix=false +sp_cleanup.objects_equals=false sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.one_if_rather_than_duplicate_blocks_that_fall_through=false +sp_cleanup.operand_factorization=false sp_cleanup.organize_imports=true +sp_cleanup.overridden_assignment=false +sp_cleanup.plain_replacement=false +sp_cleanup.precompile_regex=false +sp_cleanup.primitive_comparison=false +sp_cleanup.primitive_parsing=false +sp_cleanup.primitive_rather_than_wrapper=false +sp_cleanup.primitive_serialization=false +sp_cleanup.pull_out_if_from_if_else=false +sp_cleanup.pull_up_assignment=false +sp_cleanup.push_down_negation=false sp_cleanup.qualify_static_field_accesses_with_declaring_class=false sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true sp_cleanup.qualify_static_member_accesses_with_declaring_class=true sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.reduce_indentation=false +sp_cleanup.redundant_comparator=false +sp_cleanup.redundant_falling_through_block_end=false sp_cleanup.remove_private_constructors=true sp_cleanup.remove_redundant_modifiers=false sp_cleanup.remove_redundant_semicolons=true @@ -106,6 +154,7 @@ sp_cleanup.remove_redundant_type_arguments=true sp_cleanup.remove_trailing_whitespaces=true sp_cleanup.remove_trailing_whitespaces_all=true sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_array_creation=false sp_cleanup.remove_unnecessary_casts=true sp_cleanup.remove_unnecessary_nls_tags=true sp_cleanup.remove_unused_imports=true @@ -114,14 +163,43 @@ sp_cleanup.remove_unused_private_fields=true sp_cleanup.remove_unused_private_members=false sp_cleanup.remove_unused_private_methods=true sp_cleanup.remove_unused_private_types=true +sp_cleanup.return_expression=false +sp_cleanup.simplify_lambda_expression_and_method_ref=false +sp_cleanup.single_used_field=false sp_cleanup.sort_members=false sp_cleanup.sort_members_all=false +sp_cleanup.standard_comparison=false +sp_cleanup.static_inner_class=false +sp_cleanup.strictly_equal_or_different=false +sp_cleanup.stringbuffer_to_stringbuilder=false +sp_cleanup.stringbuilder=false +sp_cleanup.stringbuilder_for_local_vars=false +sp_cleanup.substring=false +sp_cleanup.switch=false +sp_cleanup.system_property=false +sp_cleanup.system_property_boolean=false +sp_cleanup.system_property_file_encoding=false +sp_cleanup.system_property_file_separator=false +sp_cleanup.system_property_line_separator=false +sp_cleanup.system_property_path_separator=false +sp_cleanup.ternary_operator=false +sp_cleanup.try_with_resource=false +sp_cleanup.unlooped_while=false +sp_cleanup.unreachable_block=false sp_cleanup.use_anonymous_class_creation=false +sp_cleanup.use_autoboxing=false sp_cleanup.use_blocks=true sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_directly_map_method=false sp_cleanup.use_lambda=true sp_cleanup.use_parentheses_in_expressions=true +sp_cleanup.use_string_is_blank=false sp_cleanup.use_this_for_non_static_field_access=true sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=false sp_cleanup.use_this_for_non_static_method_access=false sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true +sp_cleanup.use_unboxing=false +sp_cleanup.use_var=false +sp_cleanup.useless_continue=false +sp_cleanup.useless_return=false +sp_cleanup.valueof_rather_than_instantiation=false diff --git a/README.md b/README.md index bd3966d..1277ff0 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,18 @@ Since JProfiler uses a forward TCP connection you can only profile one UDF insta * The UDF execution will wait until you connect the profiler * Ensure that the port is reachable from your system (for AWS instances you can use an SSH tunnel from inside JProfiler) +### UDF Logs + +System property: `test.udf-logs` + +This module redirects the STDOUT from UDFs to files on the test host. + +You can find the logs in `target/udf-logs/`. For each incoming stream (UDF instance) this module creates one file and logs its name: + +``` +Created log file for UDF output: target/udf-logs/udf-log-16150321841745991713.txt +``` + ## Additional Information * [Changelog](doc/changes/changelog.md) diff --git a/dependencies.md b/dependencies.md index a01d149..53fc062 100644 --- a/dependencies.md +++ b/dependencies.md @@ -22,9 +22,10 @@ | [JUnit Jupiter Engine][19] | [Eclipse Public License v2.0][20] | | [JUnit Jupiter Params][19] | [Eclipse Public License v2.0][20] | | [mockito-core][23] | [The MIT License][24] | -| [Hamcrest All][25] | [New BSD License][26] | -| [Test containers for Exasol on Docker][27] | [MIT][4] | -| [Testcontainers :: JUnit Jupiter Extension][29] | [MIT][30] | +| [mockito-junit-jupiter][23] | [The MIT License][24] | +| [Hamcrest All][27] | [New BSD License][28] | +| [Test containers for Exasol on Docker][29] | [MIT][4] | +| [Testcontainers :: JUnit Jupiter Extension][31] | [MIT][32] | ## Runtime Dependencies @@ -36,71 +37,71 @@ | Dependency | License | | ------------------------------------------------------- | ---------------------------------------------- | -| [Maven Surefire Plugin][34] | [Apache License, Version 2.0][12] | -| [Maven Failsafe Plugin][36] | [Apache License, Version 2.0][12] | -| [JaCoCo :: Maven Plugin][38] | [Eclipse Public License 2.0][6] | -| [Apache Maven Compiler Plugin][40] | [Apache License, Version 2.0][12] | -| [Maven Dependency Plugin][42] | [The Apache Software License, Version 2.0][43] | -| [Versions Maven Plugin][44] | [Apache License, Version 2.0][12] | -| [Apache Maven Source Plugin][46] | [Apache License, Version 2.0][12] | -| [Apache Maven Javadoc Plugin][48] | [Apache License, Version 2.0][12] | -| [Apache Maven GPG Plugin][50] | [Apache License, Version 2.0][43] | -| [org.sonatype.ossindex.maven:ossindex-maven-plugin][52] | [ASL2][43] | -| [Apache Maven Enforcer Plugin][54] | [Apache License, Version 2.0][12] | -| [Project keeper maven plugin][56] | [MIT][4] | -| [Maven Deploy Plugin][58] | [The Apache Software License, Version 2.0][43] | -| [Nexus Staging Maven Plugin][60] | [Eclipse Public License][61] | -| [error-code-crawler-maven-plugin][62] | [MIT][4] | -| [Reproducible Build Maven Plugin][64] | [Apache 2.0][43] | -| [Maven Clean Plugin][66] | [The Apache Software License, Version 2.0][43] | -| [Maven Resources Plugin][68] | [The Apache Software License, Version 2.0][43] | -| [Maven JAR Plugin][70] | [The Apache Software License, Version 2.0][43] | -| [Maven Install Plugin][72] | [The Apache Software License, Version 2.0][43] | -| [Maven Site Plugin 3][74] | [The Apache Software License, Version 2.0][43] | +| [Maven Surefire Plugin][36] | [Apache License, Version 2.0][12] | +| [Maven Failsafe Plugin][38] | [Apache License, Version 2.0][12] | +| [JaCoCo :: Maven Plugin][40] | [Eclipse Public License 2.0][6] | +| [Apache Maven Compiler Plugin][42] | [Apache License, Version 2.0][12] | +| [Maven Dependency Plugin][44] | [The Apache Software License, Version 2.0][45] | +| [Versions Maven Plugin][46] | [Apache License, Version 2.0][12] | +| [Apache Maven Source Plugin][48] | [Apache License, Version 2.0][12] | +| [Apache Maven Javadoc Plugin][50] | [Apache License, Version 2.0][12] | +| [Apache Maven GPG Plugin][52] | [Apache License, Version 2.0][45] | +| [org.sonatype.ossindex.maven:ossindex-maven-plugin][54] | [ASL2][45] | +| [Apache Maven Enforcer Plugin][56] | [Apache License, Version 2.0][12] | +| [Project keeper maven plugin][58] | [MIT][4] | +| [Maven Deploy Plugin][60] | [The Apache Software License, Version 2.0][45] | +| [Nexus Staging Maven Plugin][62] | [Eclipse Public License][63] | +| [error-code-crawler-maven-plugin][64] | [MIT][4] | +| [Reproducible Build Maven Plugin][66] | [Apache 2.0][45] | +| [Maven Clean Plugin][68] | [The Apache Software License, Version 2.0][45] | +| [Maven Resources Plugin][70] | [The Apache Software License, Version 2.0][45] | +| [Maven JAR Plugin][72] | [The Apache Software License, Version 2.0][45] | +| [Maven Install Plugin][74] | [The Apache Software License, Version 2.0][45] | +| [Maven Site Plugin 3][76] | [The Apache Software License, Version 2.0][45] | [5]: https://www.eclemma.org/jacoco/index.html -[56]: https://github.com/exasol/project-keeper-maven-plugin +[58]: https://github.com/exasol/project-keeper-maven-plugin [7]: https://github.com/exasol/bucketfs-java [3]: https://github.com/exasol/error-reporting-java -[43]: http://www.apache.org/licenses/LICENSE-2.0.txt -[34]: https://maven.apache.org/surefire/maven-surefire-plugin/ -[60]: http://www.sonatype.com/public-parent/nexus-maven-plugins/nexus-staging/nexus-staging-maven-plugin/ -[66]: http://maven.apache.org/plugins/maven-clean-plugin/ +[45]: http://www.apache.org/licenses/LICENSE-2.0.txt +[36]: https://maven.apache.org/surefire/maven-surefire-plugin/ +[62]: http://www.sonatype.com/public-parent/nexus-maven-plugins/nexus-staging/nexus-staging-maven-plugin/ +[68]: http://maven.apache.org/plugins/maven-clean-plugin/ [4]: https://opensource.org/licenses/MIT [23]: https://github.com/mockito/mockito -[36]: https://maven.apache.org/surefire/maven-failsafe-plugin/ +[38]: https://maven.apache.org/surefire/maven-failsafe-plugin/ [13]: https://github.com/exasol/test-db-builder-java [11]: https://commons.apache.org/proper/commons-compress/ -[42]: http://maven.apache.org/plugins/maven-dependency-plugin/ -[44]: http://www.mojohaus.org/versions-maven-plugin/ -[40]: https://maven.apache.org/plugins/maven-compiler-plugin/ -[30]: http://opensource.org/licenses/MIT -[50]: http://maven.apache.org/plugins/maven-gpg-plugin/ +[44]: http://maven.apache.org/plugins/maven-dependency-plugin/ +[46]: http://www.mojohaus.org/versions-maven-plugin/ +[42]: https://maven.apache.org/plugins/maven-compiler-plugin/ +[32]: http://opensource.org/licenses/MIT +[52]: http://maven.apache.org/plugins/maven-gpg-plugin/ [6]: https://www.eclipse.org/legal/epl-2.0/ -[61]: http://www.eclipse.org/legal/epl-v10.html -[27]: https://github.com/exasol/exasol-testcontainers -[38]: https://www.jacoco.org/jacoco/trunk/doc/maven.html +[63]: http://www.eclipse.org/legal/epl-v10.html +[29]: https://github.com/exasol/exasol-testcontainers +[40]: https://www.jacoco.org/jacoco/trunk/doc/maven.html [24]: https://github.com/mockito/mockito/blob/main/LICENSE -[64]: http://zlika.github.io/reproducible-build-maven-plugin -[70]: http://maven.apache.org/plugins/maven-jar-plugin/ +[66]: http://zlika.github.io/reproducible-build-maven-plugin +[72]: http://maven.apache.org/plugins/maven-jar-plugin/ [1]: https://projects.eclipse.org/license/epl-2.0 [16]: http://www.opensource.org/licenses/mit-license.php [12]: https://www.apache.org/licenses/LICENSE-2.0.txt -[54]: https://maven.apache.org/enforcer/maven-enforcer-plugin/ +[56]: https://maven.apache.org/enforcer/maven-enforcer-plugin/ [20]: https://www.eclipse.org/legal/epl-v20.html -[26]: http://www.opensource.org/licenses/bsd-license.php -[72]: http://maven.apache.org/plugins/maven-install-plugin/ +[28]: http://www.opensource.org/licenses/bsd-license.php +[74]: http://maven.apache.org/plugins/maven-install-plugin/ [19]: https://junit.org/junit5/ -[52]: https://sonatype.github.io/ossindex-maven/maven-plugin/ -[25]: https://github.com/hamcrest/JavaHamcrest/ -[29]: https://testcontainers.org +[54]: https://sonatype.github.io/ossindex-maven/maven-plugin/ +[27]: https://github.com/hamcrest/JavaHamcrest/ +[31]: https://testcontainers.org [0]: https://github.com/eclipse-ee4j/jsonp -[46]: https://maven.apache.org/plugins/maven-source-plugin/ +[48]: https://maven.apache.org/plugins/maven-source-plugin/ [2]: https://projects.eclipse.org/license/secondary-gpl-2.0-cp [15]: http://www.slf4j.org -[58]: http://maven.apache.org/plugins/maven-deploy-plugin/ -[74]: http://maven.apache.org/plugins/maven-site-plugin/ -[68]: http://maven.apache.org/plugins/maven-resources-plugin/ -[48]: https://maven.apache.org/plugins/maven-javadoc-plugin/ -[62]: https://github.com/exasol/error-code-crawler-maven-plugin +[60]: http://maven.apache.org/plugins/maven-deploy-plugin/ +[76]: http://maven.apache.org/plugins/maven-site-plugin/ +[70]: http://maven.apache.org/plugins/maven-resources-plugin/ +[50]: https://maven.apache.org/plugins/maven-javadoc-plugin/ +[64]: https://github.com/exasol/error-code-crawler-maven-plugin [9]: https://github.com/exasol/exasol-test-setup-abstraction-java diff --git a/doc/changes/changelog.md b/doc/changes/changelog.md index 79dd0c1..1b5cd4f 100644 --- a/doc/changes/changelog.md +++ b/doc/changes/changelog.md @@ -1,5 +1,6 @@ # Changes +* [0.5.0](changes_0.5.0.md) * [0.4.1](changes_0.4.1.md) * [0.4.0](changes_0.4.0.md) * [0.3.0](changes_0.3.0.md) diff --git a/doc/changes/changes_0.5.0.md b/doc/changes/changes_0.5.0.md new file mode 100644 index 0000000..cb0ae6d --- /dev/null +++ b/doc/changes/changes_0.5.0.md @@ -0,0 +1,29 @@ +# udf-debugging-java 0.5.0, released 2022-01-12 + +Code name: Logs from UDFs + +## Features + +* #31: Added module for capturing logs from UDFs + +## Dependency Updates + +### Compile Dependency Updates + +* Updated `com.exasol:error-reporting-java:0.4.0` to `0.4.1` +* Updated `com.exasol:exasol-test-setup-abstraction-java:0.2.0` to `0.2.1` + +### Test Dependency Updates + +* Updated `com.exasol:exasol-testcontainers:5.1.0` to `5.1.1` +* Updated `org.junit.jupiter:junit-jupiter-engine:5.8.1` to `5.8.2` +* Updated `org.junit.jupiter:junit-jupiter-params:5.8.1` to `5.8.2` +* Updated `org.mockito:mockito-core:3.12.4` to `4.2.0` +* Added `org.mockito:mockito-junit-jupiter:4.2.0` +* Updated `org.testcontainers:junit-jupiter:1.16.0` to `1.16.2` + +### Plugin Dependency Updates + +* Updated `com.exasol:error-code-crawler-maven-plugin:0.6.0` to `0.7.1` +* Updated `com.exasol:project-keeper-maven-plugin:1.2.0` to `1.3.4` +* Updated `org.apache.maven.plugins:maven-javadoc-plugin:3.2.0` to `3.3.1` diff --git a/pom.xml b/pom.xml index 4aa9d79..a5692a4 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.exasol udf-debugging-java - 0.4.1 + 0.5.0 udf-debugging-java Utilities for debugging, profiling and code coverage measure for UDFs. https://github.com/exasol/udf-debugging-java @@ -12,12 +12,12 @@ UTF-8 UTF-8 11 - 5.8.1 + 5.8.2 1.7.1 11.0.0 true 0.8.7 - 1.16.0 + 1.16.2 3.0.0-M4 @@ -65,7 +65,7 @@ com.exasol error-reporting-java - 0.4.0 + 0.4.1 org.jacoco @@ -87,7 +87,7 @@ com.exasol exasol-test-setup-abstraction-java - 0.2.0 + 0.2.1 org.apache.commons @@ -110,7 +110,13 @@ org.mockito mockito-core - 3.12.4 + 4.2.0 + test + + + org.mockito + mockito-junit-jupiter + 4.2.0 test @@ -123,7 +129,7 @@ com.exasol exasol-testcontainers - 5.1.0 + 5.1.1 test @@ -152,7 +158,7 @@ ${surefire.and.failsafe.plugin.version} + have a chance to reach branches in the logging lambdas too. --> -Djava.util.logging.config.file=src/test/resources/logging.properties ${argLine} **IT.java @@ -165,7 +171,7 @@ ${surefire.and.failsafe.plugin.version} + in the logging lambdas too. --> -Djava.util.logging.config.file=src/test/resources/logging.properties ${argLine} **IT.java @@ -287,7 +293,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.2.0 + 3.3.1 attach-javadocs @@ -350,7 +356,7 @@ - 3.3.9 + 3.6.3 @@ -360,7 +366,7 @@ com.exasol project-keeper-maven-plugin - 1.2.0 + 1.3.4 @@ -407,7 +413,7 @@ com.exasol error-code-crawler-maven-plugin - 0.6.0 + 0.7.1 diff --git a/src/main/java/com/exasol/udfdebugging/Module.java b/src/main/java/com/exasol/udfdebugging/Module.java index 52331f3..b0dc9c5 100644 --- a/src/main/java/com/exasol/udfdebugging/Module.java +++ b/src/main/java/com/exasol/udfdebugging/Module.java @@ -1,11 +1,12 @@ package com.exasol.udfdebugging; +import java.io.Closeable; import java.util.stream.Stream; /** * Modules define a specific functionality that users can enable using system properties. */ -public interface Module { +public interface Module extends Closeable { /** * Get JVM options required by this module. diff --git a/src/main/java/com/exasol/udfdebugging/ModuleFactory.java b/src/main/java/com/exasol/udfdebugging/ModuleFactory.java index 33c21ef..a85c270 100644 --- a/src/main/java/com/exasol/udfdebugging/ModuleFactory.java +++ b/src/main/java/com/exasol/udfdebugging/ModuleFactory.java @@ -1,7 +1,12 @@ package com.exasol.udfdebugging; +import java.sql.Connection; + import com.exasol.bucketfs.Bucket; +/** + * Interface for factories for {@link Module}. + */ public interface ModuleFactory { /** @@ -23,7 +28,9 @@ public interface ModuleFactory { * * @param localServiceExposer Proxy factory that makes ports of the test host available in the container * @param bucket BucketFS bucket to upload resource to + * @param exasolConnection connection to the Exasol database * @return built {@link Module} */ - public Module buildModule(final LocalServiceExposer localServiceExposer, Bucket bucket); + public Module buildModule(final LocalServiceExposer localServiceExposer, Bucket bucket, + final Connection exasolConnection); } diff --git a/src/main/java/com/exasol/udfdebugging/PushDownTesting.java b/src/main/java/com/exasol/udfdebugging/PushDownTesting.java index 8aa4eb0..2ac6488 100644 --- a/src/main/java/com/exasol/udfdebugging/PushDownTesting.java +++ b/src/main/java/com/exasol/udfdebugging/PushDownTesting.java @@ -5,7 +5,19 @@ import jakarta.json.*; +/** + * This class contains helper functions for testing virtual schema push down queries. + */ public class PushDownTesting { + + /** + * Get the push-down SQL query generated by a Virtual Schema adapter call. + * + * @param statement SQL statement + * @param query query to a Virtual Schema table + * @return generated push down query + * @throws SQLException if execution fails + */ public static String getPushDownSql(final Statement statement, final String query) throws SQLException { try (final ResultSet pushDownSqlResult = statement .executeQuery("SELECT PUSHDOWN_SQL FROM (EXPLAIN VIRTUAL " + query + ");")) { @@ -14,6 +26,14 @@ public static String getPushDownSql(final Statement statement, final String quer } } + /** + * Get the selection (where clause) that the Exasol database passed to the Virtual Schema adapter. + * + * @param statement SQL statement + * @param query query to a Virtual Schema table + * @return selection (where clause) + * @throws SQLException if SQL statement fails + */ public static String getSelectionThatIsSentToTheAdapter(final Statement statement, final String query) throws SQLException { try (final ResultSet pushDownSqlResult = statement diff --git a/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java b/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java index e12d17c..b0f5f48 100644 --- a/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java +++ b/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java @@ -1,5 +1,6 @@ package com.exasol.udfdebugging; +import java.sql.Connection; import java.util.List; import java.util.stream.Collectors; @@ -12,13 +13,14 @@ import com.exasol.udfdebugging.modules.coverage.CoverageModuleFactory; import com.exasol.udfdebugging.modules.debugging.DebuggingModuleFactory; import com.exasol.udfdebugging.modules.jprofiler.JProfilerModuleFactory; +import com.exasol.udfdebugging.modules.udflogs.UdfLogsModuleFactory; /** * Test setup for testing UDFs in the database. */ -public class UdfTestSetup { +public class UdfTestSetup implements AutoCloseable { private static final List AVAILABLE_MODULES = List.of(new DebuggingModuleFactory(), - new CoverageModuleFactory(), new JProfilerModuleFactory()); + new CoverageModuleFactory(), new JProfilerModuleFactory(), new UdfLogsModuleFactory()); private static final Logger LOGGER = LoggerFactory.getLogger(UdfTestSetup.class); private final List enabledModules; @@ -27,9 +29,10 @@ public class UdfTestSetup { * * @param testHostIpAddress IP address of the host running this UDF Test Setup under which UDFs can reach it * @param bucket BucketFS bucket to upload resource to + * @param exasolConnection connection to the Exasol database. Make sure that your tests use the same connection */ - public UdfTestSetup(final String testHostIpAddress, final Bucket bucket) { - this(port -> new ServiceAddress(testHostIpAddress, port), bucket); + public UdfTestSetup(final String testHostIpAddress, final Bucket bucket, final Connection exasolConnection) { + this(port -> new ServiceAddress(testHostIpAddress, port), bucket, exasolConnection); } /** @@ -37,10 +40,12 @@ public UdfTestSetup(final String testHostIpAddress, final Bucket bucket) { * * @param localServiceExposer Proxy factory that makes ports of the test host available in the container * @param bucket BucketFS bucket to upload resource to + * @param exasolConnection connection to the Exasol database. Make sure that your tests use the same connection */ - private UdfTestSetup(final LocalServiceExposer localServiceExposer, final Bucket bucket) { + private UdfTestSetup(final LocalServiceExposer localServiceExposer, final Bucket bucket, + final Connection exasolConnection) { this.enabledModules = AVAILABLE_MODULES.stream().filter(ModuleFactory::isEnabled) - .map(moduleFactory -> moduleFactory.buildModule(localServiceExposer, bucket)) + .map(moduleFactory -> moduleFactory.buildModule(localServiceExposer, bucket, exasolConnection)) .collect(Collectors.toList()); printInfoMessage(); } @@ -48,10 +53,11 @@ private UdfTestSetup(final LocalServiceExposer localServiceExposer, final Bucket /** * Create a new instance of {@link UdfTestSetup}. * - * @param testSetup Exasol test setup + * @param testSetup Exasol test setup + * @param exasolConnection connection to the Exasol database. Make sure that your tests use the same connection */ - public UdfTestSetup(final ExasolTestSetup testSetup) { - this(testSetup::makeLocalTcpServiceAccessibleFromDatabase, testSetup.getDefaultBucket()); + public UdfTestSetup(final ExasolTestSetup testSetup, final Connection exasolConnection) { + this(testSetup::makeLocalTcpServiceAccessibleFromDatabase, testSetup.getDefaultBucket(), exasolConnection); } /** @@ -79,4 +85,15 @@ private String getInfoMessage() { }); return messageBuilder.toString(); } + + @Override + public void close() { + for (final Module enabledModule : this.enabledModules) { + try { + enabledModule.close(); + } catch (final Exception exception) { + // at least we tried + } + } + } } diff --git a/src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModule.java b/src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModule.java index d8272f9..567a8d1 100644 --- a/src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModule.java +++ b/src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModule.java @@ -1,6 +1,7 @@ package com.exasol.udfdebugging.modules.coverage; import java.io.FileNotFoundException; +import java.io.IOException; import java.nio.file.Path; import java.util.concurrent.TimeoutException; import java.util.stream.Stream; @@ -60,4 +61,9 @@ private void uploadAgentToBucketFs(final Bucket bucket) { exception); } } + + @Override + public void close() throws IOException { + // nothing to close + } } diff --git a/src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleFactory.java b/src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleFactory.java index c889ba6..7db5a28 100644 --- a/src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleFactory.java +++ b/src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleFactory.java @@ -1,10 +1,15 @@ package com.exasol.udfdebugging.modules.coverage; +import java.sql.Connection; + import com.exasol.bucketfs.Bucket; import com.exasol.udfdebugging.LocalServiceExposer; import com.exasol.udfdebugging.Module; import com.exasol.udfdebugging.modules.AbstractModuleFactory; +/** + * Factory for {@link CoverageModule}. + */ public class CoverageModuleFactory extends AbstractModuleFactory { /** @@ -15,7 +20,8 @@ public CoverageModuleFactory() { } @Override - public Module buildModule(final LocalServiceExposer localServiceExposer, final Bucket bucket) { + public Module buildModule(final LocalServiceExposer localServiceExposer, final Bucket bucket, + final Connection exasolConnection) { return new CoverageModule(localServiceExposer, bucket); } } diff --git a/src/main/java/com/exasol/udfdebugging/modules/debugging/DebuggingModule.java b/src/main/java/com/exasol/udfdebugging/modules/debugging/DebuggingModule.java index 7d8b975..3d09544 100644 --- a/src/main/java/com/exasol/udfdebugging/modules/debugging/DebuggingModule.java +++ b/src/main/java/com/exasol/udfdebugging/modules/debugging/DebuggingModule.java @@ -6,7 +6,11 @@ import com.exasol.udfdebugging.LocalServiceExposer; import com.exasol.udfdebugging.Module; +/** + * This module configures a Java-UDF execution so that it connects to a remote debugger. + */ public class DebuggingModule implements Module { + /** Port the remote-debugger listens on */ public static final int DEBUGGING_PORT = 8000; private final LocalServiceExposer localServiceExposer; @@ -25,4 +29,9 @@ public Stream getJvmOptions() { return Stream.of("-agentlib:jdwp=transport=dt_socket,server=n,address=" + proxyForHostPort.getHostName() + ":" + proxyForHostPort.getPort() + ",suspend=y"); } + + @Override + public void close() { + // nothing to close + } } diff --git a/src/main/java/com/exasol/udfdebugging/modules/debugging/DebuggingModuleFactory.java b/src/main/java/com/exasol/udfdebugging/modules/debugging/DebuggingModuleFactory.java index 3a97a19..a6a8e2a 100644 --- a/src/main/java/com/exasol/udfdebugging/modules/debugging/DebuggingModuleFactory.java +++ b/src/main/java/com/exasol/udfdebugging/modules/debugging/DebuggingModuleFactory.java @@ -1,10 +1,15 @@ package com.exasol.udfdebugging.modules.debugging; +import java.sql.Connection; + import com.exasol.bucketfs.Bucket; import com.exasol.udfdebugging.LocalServiceExposer; import com.exasol.udfdebugging.Module; import com.exasol.udfdebugging.modules.AbstractModuleFactory; +/** + * Factory for {@link DebuggingModule}. + */ public class DebuggingModuleFactory extends AbstractModuleFactory { /** * Create a new instance of {@link DebuggingModuleFactory}. @@ -14,7 +19,8 @@ public DebuggingModuleFactory() { } @Override - public Module buildModule(final LocalServiceExposer localServiceExposer, final Bucket bucket) { + public Module buildModule(final LocalServiceExposer localServiceExposer, final Bucket bucket, + final Connection exasolConnection) { return new DebuggingModule(localServiceExposer); } } diff --git a/src/main/java/com/exasol/udfdebugging/modules/jprofiler/JProfilerModule.java b/src/main/java/com/exasol/udfdebugging/modules/jprofiler/JProfilerModule.java index 8ffbb4c..e6c80d5 100644 --- a/src/main/java/com/exasol/udfdebugging/modules/jprofiler/JProfilerModule.java +++ b/src/main/java/com/exasol/udfdebugging/modules/jprofiler/JProfilerModule.java @@ -67,4 +67,9 @@ private Path getJProfilerArchive() { public Stream getJvmOptions() { return Stream.of(this.jvmOption); } + + @Override + public void close() { + // nothing to close + } } diff --git a/src/main/java/com/exasol/udfdebugging/modules/jprofiler/JProfilerModuleFactory.java b/src/main/java/com/exasol/udfdebugging/modules/jprofiler/JProfilerModuleFactory.java index 35016a5..1a4c81a 100644 --- a/src/main/java/com/exasol/udfdebugging/modules/jprofiler/JProfilerModuleFactory.java +++ b/src/main/java/com/exasol/udfdebugging/modules/jprofiler/JProfilerModuleFactory.java @@ -1,5 +1,7 @@ package com.exasol.udfdebugging.modules.jprofiler; +import java.sql.Connection; + import com.exasol.bucketfs.Bucket; import com.exasol.udfdebugging.*; import com.exasol.udfdebugging.Module; @@ -18,7 +20,8 @@ public JProfilerModuleFactory() { } @Override - public Module buildModule(final LocalServiceExposer localServiceExposer, final Bucket bucket) { + public Module buildModule(final LocalServiceExposer localServiceExposer, final Bucket bucket, + final Connection exasolConnection) { return new JProfilerModule(bucket); } } diff --git a/src/main/java/com/exasol/udfdebugging/modules/udflogs/LogRecorder.java b/src/main/java/com/exasol/udfdebugging/modules/udflogs/LogRecorder.java new file mode 100644 index 0000000..06548fa --- /dev/null +++ b/src/main/java/com/exasol/udfdebugging/modules/udflogs/LogRecorder.java @@ -0,0 +1,115 @@ +package com.exasol.udfdebugging.modules.udflogs; + +import java.io.*; +import java.net.ServerSocket; +import java.net.Socket; +import java.nio.file.*; +import java.util.function.Consumer; + +import com.exasol.errorreporting.ExaError; + +/** + * This class opens a TCP socket and dumps everything to {@code STDOUT}. It is used for printing logs from the UDF. + */ +public final class LogRecorder implements AutoCloseable { + private static final Path LOG_DIRECTORY = Path.of("target/udf-logs"); + private final Server server; + + /** + * Create a new instance of {@link LogRecorder}. + * + * @param logFileHandler callback to notify when a new log file is created + */ + public LogRecorder(final Consumer logFileHandler) { + try { + if (!Files.exists(LOG_DIRECTORY)) { + Files.createDirectory(LOG_DIRECTORY); + } + this.server = new Server(logFileHandler); + new Thread(this.server).start(); + } catch (final IOException exception) { + throw new UncheckedIOException( + ExaError.messageBuilder("E-UDJ-18") + .message("Failed to start server for retrieving UDF logs.", exception).toString(), + exception); + } + } + + @Override + public void close() throws Exception { + this.server.close(); + } + + /** + * Get the port the log recorder listens on. + * + * @return port number + */ + public int getPort() { + return this.server.getPort(); + } + + private static class Server implements Runnable, Closeable { + private final ServerSocket serverSocket; + private final Consumer logFileHandler; + private boolean running = true; + + public Server(final Consumer logFileHandler) throws IOException { + this.logFileHandler = logFileHandler; + this.serverSocket = new ServerSocket(0); + } + + int getPort() { + return this.serverSocket.getLocalPort(); + } + + @Override + public void run() { + try { + while (this.running) { + final Socket client = this.serverSocket.accept(); + new Thread(new Logger(client, this.logFileHandler)).start(); + } + } catch (final IOException exception) { + // ignore + } + } + + @Override + public void close() throws IOException { + this.serverSocket.close(); + this.running = false; + } + } + + private static class Logger implements Runnable { + private final Socket socket; + private final Consumer logFileHandler; + + private Logger(final Socket socket, final Consumer logFileHandler) { + this.socket = socket; + this.logFileHandler = logFileHandler; + } + + @Override + public void run() { + try { + final Path logFile = Files.createTempFile(LOG_DIRECTORY, "udf-log-", ".txt"); + this.logFileHandler.accept(logFile); + Files.copy(this.socket.getInputStream(), logFile, StandardCopyOption.REPLACE_EXISTING); + } catch (final IOException exception) { + throw new UncheckedIOException( + ExaError.messageBuilder("E-UDJ-17").message("Failed to read from log stream.").toString(), + exception); + } finally { + try { + if (!this.socket.isClosed()) { + this.socket.close(); + } + } catch (final IOException e) { + // ignore + } + } + } + } +} diff --git a/src/main/java/com/exasol/udfdebugging/modules/udflogs/UdfLogsModule.java b/src/main/java/com/exasol/udfdebugging/modules/udflogs/UdfLogsModule.java new file mode 100644 index 0000000..b27329d --- /dev/null +++ b/src/main/java/com/exasol/udfdebugging/modules/udflogs/UdfLogsModule.java @@ -0,0 +1,83 @@ +package com.exasol.udfdebugging.modules.udflogs; + +import java.nio.file.Path; +import java.sql.*; +import java.util.ArrayList; +import java.util.List; +import java.util.function.Consumer; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.stream.Stream; + +import com.exasol.errorreporting.ExaError; +import com.exasol.exasoltestsetup.ServiceAddress; +import com.exasol.udfdebugging.LocalServiceExposer; +import com.exasol.udfdebugging.Module; + +/** + * This module redirects the STDOUT of UDFs to files on the test host. + *

+ * For that it uses the {@code ALTER SESSION SET SCRIPT_OUTPUT_ADDRESS} command of the Exasol database. + *

+ */ +public class UdfLogsModule implements Module { + private static final Logger LOGGER = Logger.getLogger(UdfLogsModule.class.getName()); + private final LogRecorder logRecorder; + private final List capturedLogFiles = new ArrayList<>(); + + /** + * Create a new instance of {@link UdfLogsModule}. + * + * @param localServiceExposer proxy factory that makes ports of the test host available in the container + * @param exasolConnection connection to the exasol database + */ + public UdfLogsModule(final LocalServiceExposer localServiceExposer, final Connection exasolConnection) { + final Consumer logFileHandler = file -> { + this.capturedLogFiles.add(file); + LOGGER.log(Level.INFO, "Created log file for UDF output: {0}", file); + }; + this.logRecorder = new LogRecorder(logFileHandler); + final ServiceAddress inDbAddress = localServiceExposer.exposeLocalServiceToDatabase(this.logRecorder.getPort()); + redirectLogging(exasolConnection, inDbAddress); + } + + @Override + public Stream getJvmOptions() { + return Stream.empty(); + } + + /** + * Get all log files that were captured. + * + * @return list of captured log files. + */ + public List getCapturedLogFiles() { + return this.capturedLogFiles; + } + + private void redirectLogging(final Connection exasolConnection, final ServiceAddress logServerAddress) { + try (final Statement statement = exasolConnection.createStatement()) { + final String logServerAddressString = logServerAddress.toString(); + if (logServerAddressString.contains("'")) { + throw new IllegalArgumentException(ExaError.messageBuilder("F-UDJ-19") + .message("Invalid address {{address}}. The address must not contain a quotes.", + logServerAddressString) + .toString()); + } + statement.executeUpdate("ALTER SESSION SET SCRIPT_OUTPUT_ADDRESS = '" + logServerAddressString + "';"); + } catch (final SQLException exception) { + throw new IllegalStateException( + ExaError.messageBuilder("E-UDJ-16").message("Failed to set script output address.").toString(), + exception); + } + } + + @Override + public void close() { + try { + this.logRecorder.close(); + } catch (final Exception exception) { + // at least we tried + } + } +} diff --git a/src/main/java/com/exasol/udfdebugging/modules/udflogs/UdfLogsModuleFactory.java b/src/main/java/com/exasol/udfdebugging/modules/udflogs/UdfLogsModuleFactory.java new file mode 100644 index 0000000..4a4b6d9 --- /dev/null +++ b/src/main/java/com/exasol/udfdebugging/modules/udflogs/UdfLogsModuleFactory.java @@ -0,0 +1,26 @@ +package com.exasol.udfdebugging.modules.udflogs; + +import java.sql.Connection; + +import com.exasol.bucketfs.Bucket; +import com.exasol.udfdebugging.LocalServiceExposer; +import com.exasol.udfdebugging.Module; +import com.exasol.udfdebugging.modules.AbstractModuleFactory; + +/** + * Factory for {@link UdfLogsModule}. + */ +public class UdfLogsModuleFactory extends AbstractModuleFactory { + /** + * Create a new instance of {@link UdfLogsModuleFactory}. + */ + public UdfLogsModuleFactory() { + super("udf-logs"); + } + + @Override + public Module buildModule(final LocalServiceExposer localServiceExposer, final Bucket bucket, + final Connection exasolConnection) { + return new UdfLogsModule(localServiceExposer, exasolConnection); + } +} diff --git a/src/test/java/com/exasol/udfdebugging/UdfTestSetupTest.java b/src/test/java/com/exasol/udfdebugging/UdfTestSetupTest.java index 73e03db..7033660 100644 --- a/src/test/java/com/exasol/udfdebugging/UdfTestSetupTest.java +++ b/src/test/java/com/exasol/udfdebugging/UdfTestSetupTest.java @@ -2,56 +2,85 @@ import static org.hamcrest.CoreMatchers.*; import static org.hamcrest.MatcherAssert.assertThat; -import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.*; +import java.sql.*; import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.ArgumentMatchers; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; import com.exasol.bucketfs.Bucket; +@ExtendWith(MockitoExtension.class) class UdfTestSetupTest { public static final String COVERAGE_PROPERTY = "test.coverage"; public static final String DEBUG_PROPERTY = "test.debug"; + public static final String UDF_LOGS_PROPERTY = "test.udf-logs"; private static final String EXPECTED_DEBUG_JVM_OPTION = "-agentlib:jdwp=transport=dt_socket,server=n,address=1.2.3.4:8000,suspend=y"; + @Mock + private Connection connection; @BeforeEach - void before() { + void before() throws SQLException { System.clearProperty(DEBUG_PROPERTY); System.clearProperty(COVERAGE_PROPERTY); + System.clearProperty(UDF_LOGS_PROPERTY); } @Test void testDebuggingEnabled() { System.setProperty(DEBUG_PROPERTY, "true"); - final UdfTestSetup udfTestSetup = new UdfTestSetup("1.2.3.4", mock(Bucket.class)); - final List jvmOptions = Arrays.asList(udfTestSetup.getJvmOptions()); - assertThat(jvmOptions, hasItem(EXPECTED_DEBUG_JVM_OPTION)); + try (final UdfTestSetup udfTestSetup = getUdfTestSetup()) { + final List jvmOptions = Arrays.asList(udfTestSetup.getJvmOptions()); + assertThat(jvmOptions, hasItem(EXPECTED_DEBUG_JVM_OPTION)); + } + } + + private UdfTestSetup getUdfTestSetup() { + return new UdfTestSetup("1.2.3.4", mock(Bucket.class), this.connection); } @Test void testCoverageEnabled() { System.setProperty(COVERAGE_PROPERTY, "true"); - final UdfTestSetup udfTestSetup = new UdfTestSetup("1.2.3.4", mock(Bucket.class)); - final List jvmOptions = Arrays.asList(udfTestSetup.getJvmOptions()); - assertThat(jvmOptions, hasItem( - "-javaagent:/buckets/null/null/org.jacoco.agent-runtime.jar=output=tcpclient,address=1.2.3.4,port=3002")); + try (final UdfTestSetup udfTestSetup = getUdfTestSetup()) { + final List jvmOptions = Arrays.asList(udfTestSetup.getJvmOptions()); + assertThat(jvmOptions, hasItem( + "-javaagent:/buckets/null/null/org.jacoco.agent-runtime.jar=output=tcpclient,address=1.2.3.4,port=3002")); + } + } + + @Test + void testUdfLogsEnabled() throws SQLException { + final Statement statement = mock(Statement.class); + when(this.connection.createStatement()).thenReturn(statement); + System.setProperty(UDF_LOGS_PROPERTY, "true"); + try (final UdfTestSetup udfTestSetup = getUdfTestSetup()) { + verify(statement) + .executeUpdate(ArgumentMatchers.startsWith("ALTER SESSION SET SCRIPT_OUTPUT_ADDRESS = '1.2.3.4")); + } } @Test void testAllModulesAreDisabledByDefault() { - final UdfTestSetup udfTestSetup = new UdfTestSetup("1.2.3.4", mock(Bucket.class)); - final List jvmOptions = Arrays.asList(udfTestSetup.getJvmOptions()); - assertThat(jvmOptions.isEmpty(), equalTo(true)); + try (final UdfTestSetup udfTestSetup = getUdfTestSetup()) { + final List jvmOptions = Arrays.asList(udfTestSetup.getJvmOptions()); + assertThat(jvmOptions.isEmpty(), equalTo(true)); + } } @Test void testDebuggingDisabled() { System.setProperty(DEBUG_PROPERTY, "false"); - final UdfTestSetup udfTestSetup = new UdfTestSetup("1.2.3.4", mock(Bucket.class)); - final List jvmOptions = Arrays.asList(udfTestSetup.getJvmOptions()); - assertThat(jvmOptions, not(hasItem(EXPECTED_DEBUG_JVM_OPTION))); + try (final UdfTestSetup udfTestSetup = getUdfTestSetup()) { + final List jvmOptions = Arrays.asList(udfTestSetup.getJvmOptions()); + assertThat(jvmOptions, not(hasItem(EXPECTED_DEBUG_JVM_OPTION))); + } } } \ No newline at end of file diff --git a/src/test/java/com/exasol/udfdebugging/modules/TestSetup.java b/src/test/java/com/exasol/udfdebugging/modules/TestSetup.java index e92d43b..b82ca1b 100644 --- a/src/test/java/com/exasol/udfdebugging/modules/TestSetup.java +++ b/src/test/java/com/exasol/udfdebugging/modules/TestSetup.java @@ -19,9 +19,11 @@ public class TestSetup implements Closeable, AutoCloseable { private static final String UDF_NAME = "HELLO_WORLD"; private final ExasolContainer> exasol = new ExasolContainer<>().withReuse(true); + private final Connection connection; - public TestSetup() { + public TestSetup() throws SQLException { this.exasol.start(); + this.connection = this.exasol.createConnection(); } public LocalServiceExposer getHostPortProxy() { @@ -36,16 +38,20 @@ public ExasolContainer> getExasolContainer() { return this.exasol; } - public void runJavaUdf(final Stream jvmOptions) throws SQLException { - try (final Connection connection = this.exasol.createConnection(); - final Statement statement = connection.createStatement()) { - final ExasolObjectFactory exasolObjectFactory = new ExasolObjectFactory(connection, + public Connection getConnection() { + return this.connection; + } + + public void runJavaUdf(final Stream jvmOptions, final String lineToRun) throws SQLException { + try (final Statement statement = this.connection.createStatement()) { + final ExasolObjectFactory exasolObjectFactory = new ExasolObjectFactory(this.connection, ExasolObjectConfiguration.builder().withJvmOptions(jvmOptions.toArray(String[]::new)).build()); final ExasolSchema schema = exasolObjectFactory.createSchema(SCHEMA_NAME); schema.createUdfBuilder(UDF_NAME).inputType(UdfScript.InputType.SCALAR).language(UdfScript.Language.JAVA) .content("class HELLO_WORLD {\n" - + " static String run(ExaMetadata exa, ExaIterator ctx) throws Exception {\n" - + " \treturn \"\";\n" + " }\n" + "}") + + " static String run(ExaMetadata exa, ExaIterator ctx) throws Exception {\n" + // + lineToRun + "\n" + // + " \treturn \"\";\n" + " }\n" + "}") .returns("VARCHAR(2000)").build(); statement.executeQuery("SELECT " + SCHEMA_NAME + "." + UDF_NAME + "()").close(); } @@ -53,6 +59,11 @@ public void runJavaUdf(final Stream jvmOptions) throws SQLException { @Override public void close() { + try { + this.connection.close(); + } catch (final SQLException exception) { + // at least we tried + } this.exasol.stop(); } } diff --git a/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleIT.java b/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleIT.java index 28356a4..9fd2698 100644 --- a/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleIT.java +++ b/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleIT.java @@ -19,10 +19,11 @@ class CoverageModuleIT { void testCoverageReportIsWritten() throws SQLException, IOException { deleteExecutionFile(); final TestSetup udfSetup = new TestSetup(); - final CoverageModule coverageModule = new CoverageModule(udfSetup.getHostPortProxy(), - udfSetup.getDefaultBucket()); - udfSetup.runJavaUdf(coverageModule.getJvmOptions()); - assertThat(countReportedJacocoSessions(), equalTo(1)); + try (final CoverageModule coverageModule = new CoverageModule(udfSetup.getHostPortProxy(), + udfSetup.getDefaultBucket())) { + udfSetup.runJavaUdf(coverageModule.getJvmOptions(), ""); + assertThat(countReportedJacocoSessions(), equalTo(1)); + } } private int countReportedJacocoSessions() throws IOException { diff --git a/src/test/java/com/exasol/udfdebugging/modules/jprofiler/JProfilerModuleTest.java b/src/test/java/com/exasol/udfdebugging/modules/jprofiler/JProfilerModuleTest.java index ff5741c..261838c 100644 --- a/src/test/java/com/exasol/udfdebugging/modules/jprofiler/JProfilerModuleTest.java +++ b/src/test/java/com/exasol/udfdebugging/modules/jprofiler/JProfilerModuleTest.java @@ -26,8 +26,9 @@ static void beforeAll() { @Test void testUpload() throws BucketAccessException, TimeoutException, FileNotFoundException { final Bucket bucket = mock(Bucket.class); - new JProfilerModule(bucket); - verify(bucket).uploadFile(MOCK_AGENT_ARCHIVE, "jprofiler.tar.gz"); + try (final JProfilerModule jProfilerModule = new JProfilerModule(bucket)) { + verify(bucket).uploadFile(MOCK_AGENT_ARCHIVE, "jprofiler.tar.gz"); + } } @Test @@ -35,9 +36,11 @@ void testGetJvmOptions() { final Bucket bucket = mock(Bucket.class); when(bucket.getBucketFsName()).thenReturn("my_bucketfs"); when(bucket.getBucketName()).thenReturn("my_bucket"); - final JProfilerModule coverageModule = new JProfilerModule(bucket); - assertThat(coverageModule.getJvmOptions().collect(Collectors.toList()), - contains("-agentpath:/buckets/my_bucketfs/my_bucket/jprofiler/subfolderA/linux-x64/libjprofilerti.so" - + "=port=11002")); + try (final JProfilerModule jProfilerModule = new JProfilerModule(bucket)) { + assertThat(jProfilerModule.getJvmOptions().collect(Collectors.toList()), + contains( + "-agentpath:/buckets/my_bucketfs/my_bucket/jprofiler/subfolderA/linux-x64/libjprofilerti.so" + + "=port=11002")); + } } } \ No newline at end of file diff --git a/src/test/java/com/exasol/udfdebugging/modules/udflogs/LogRecorderTest.java b/src/test/java/com/exasol/udfdebugging/modules/udflogs/LogRecorderTest.java new file mode 100644 index 0000000..f759e6e --- /dev/null +++ b/src/test/java/com/exasol/udfdebugging/modules/udflogs/LogRecorderTest.java @@ -0,0 +1,71 @@ +package com.exasol.udfdebugging.modules.udflogs; + +import static org.hamcrest.MatcherAssert.assertThat; + +import java.io.*; +import java.net.Socket; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; + +import org.hamcrest.Matchers; +import org.junit.jupiter.api.Test; + +class LogRecorderTest { + + @Test + void testLogsAreWrittenAsFile() throws Exception { + final List logFiles = new ArrayList<>(); + final LogRecorder logRecorder = new LogRecorder(logFiles::add); + final StreamToLogger connection = new StreamToLogger(logRecorder.getPort()); + connection.write("test"); + assertThat(logFiles, Matchers.hasSize(1)); + assertThat(Files.readString(logFiles.get(0)), Matchers.equalTo("test")); + connection.close(); + logRecorder.close(); + } + + @Test + void testParallelStreams() throws Exception { + final List logFiles = new ArrayList<>(); + final LogRecorder logRecorder = new LogRecorder(logFiles::add); + final StreamToLogger connection1 = new StreamToLogger(logRecorder.getPort()); + connection1.write("test"); + assertThat(logFiles, Matchers.hasSize(1)); + assertThat(Files.readString(logFiles.get(0)), Matchers.equalTo("test")); + final StreamToLogger connection2 = new StreamToLogger(logRecorder.getPort()); + connection2.write("other"); + assertThat(logFiles, Matchers.hasSize(2)); + assertThat(Files.readString(logFiles.get(1)), Matchers.equalTo("other")); + connection1.close(); + connection2.close(); + logRecorder.close(); + } + + private static class StreamToLogger implements Closeable { + private final Socket socket; + private final OutputStream outputStream; + private final PrintWriter writer; + + public StreamToLogger(final int port) throws IOException { + this.socket = new Socket("localhost", port); + this.outputStream = this.socket.getOutputStream(); + this.writer = new PrintWriter(this.outputStream); + } + + @SuppressWarnings("java:S2925") // sleep is required + public void write(final String message) throws InterruptedException { + this.writer.write(message); + this.writer.flush(); + Thread.sleep(100); + } + + @Override + public void close() throws IOException { + this.writer.close(); + this.outputStream.close(); + this.socket.close(); + } + } +} \ No newline at end of file diff --git a/src/test/java/com/exasol/udfdebugging/modules/udflogs/UdfLogsModuleIT.java b/src/test/java/com/exasol/udfdebugging/modules/udflogs/UdfLogsModuleIT.java new file mode 100644 index 0000000..8b23977 --- /dev/null +++ b/src/test/java/com/exasol/udfdebugging/modules/udflogs/UdfLogsModuleIT.java @@ -0,0 +1,26 @@ +package com.exasol.udfdebugging.modules.udflogs; + +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.MatcherAssert.assertThat; + +import java.io.IOException; +import java.nio.file.Files; +import java.sql.SQLException; + +import org.junit.jupiter.api.Test; + +import com.exasol.udfdebugging.modules.TestSetup; + +class UdfLogsModuleIT { + + @Test + void testGetLog() throws SQLException, IOException { + try (final TestSetup testSetup = new TestSetup(); + final UdfLogsModule logsModule = new UdfLogsModule(testSetup.getHostPortProxy(), + testSetup.getConnection());) { + testSetup.runJavaUdf(logsModule.getJvmOptions(), "System.out.println(\"hello from udf\");"); + final String log = Files.readString(logsModule.getCapturedLogFiles().get(0)); + assertThat(log, containsString("hello from udf")); + } + } +} \ No newline at end of file diff --git a/src/test/java/com/exasol/udfdebugging/modules/udflogs/UdfLogsModuleTest.java b/src/test/java/com/exasol/udfdebugging/modules/udflogs/UdfLogsModuleTest.java new file mode 100644 index 0000000..7a4193d --- /dev/null +++ b/src/test/java/com/exasol/udfdebugging/modules/udflogs/UdfLogsModuleTest.java @@ -0,0 +1,54 @@ +package com.exasol.udfdebugging.modules.udflogs; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.equalTo; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.mockito.ArgumentMatchers.anyInt; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.when; + +import java.sql.*; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + +import com.exasol.exasoltestsetup.ServiceAddress; +import com.exasol.udfdebugging.LocalServiceExposer; + +@ExtendWith(MockitoExtension.class) +class UdfLogsModuleTest { + @Mock + private LocalServiceExposer localServiceExposer; + @Mock + private Connection connection; + @Mock + private Statement statement; + + @BeforeEach + void setUp() throws SQLException { + when(this.connection.createStatement()).thenReturn(this.statement); + } + + @Test + void testSQlException() throws SQLException { + when(this.localServiceExposer.exposeLocalServiceToDatabase(anyInt())) + .thenReturn(new ServiceAddress("my-host", 1234)); + when(this.statement.executeUpdate(anyString())).thenThrow(new SQLException("mock exception")); + final IllegalStateException exception = assertThrows(IllegalStateException.class, + () -> new UdfLogsModule(this.localServiceExposer, this.connection)); + assertThat(exception.getMessage(), equalTo("E-UDJ-16: Failed to set script output address.")); + } + + @Test + void testSqlInjection() { + when(this.localServiceExposer.exposeLocalServiceToDatabase(anyInt())) + .thenReturn(new ServiceAddress("my-ho' + 'st", 1234)); + final IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, + () -> new UdfLogsModule(this.localServiceExposer, this.connection)); + assertThat(exception.getMessage(), + equalTo("F-UDJ-19: Invalid address 'my-ho' + 'st:1234'. The address must not contain a quotes.")); + } +} \ No newline at end of file From 854e8b562e775bb3185af05f98f1875e060e9ef6 Mon Sep 17 00:00:00 2001 From: jakobbraun Date: Mon, 21 Feb 2022 09:17:35 +0100 Subject: [PATCH 13/37] feature/13: Made info message single line (#33) --- dependencies.md | 123 +++++++++--------- doc/changes/changelog.md | 1 + doc/changes/changes_0.6.0.md | 24 ++++ pom.xml | 23 ++-- .../com/exasol/udfdebugging/UdfTestSetup.java | 11 +- .../exasol/udfdebugging/UdfTestSetupTest.java | 4 +- 6 files changed, 108 insertions(+), 78 deletions(-) create mode 100644 doc/changes/changes_0.6.0.md diff --git a/dependencies.md b/dependencies.md index 53fc062..3accac4 100644 --- a/dependencies.md +++ b/dependencies.md @@ -13,19 +13,20 @@ | [Apache Commons Compress][11] | [Apache License, Version 2.0][12] | | [Test Database Builder for Java][13] | [MIT][4] | | [SLF4J API Module][15] | [MIT License][16] | +| [JUnit5 System Extensions][17] | [Eclipse Public License v2.0][18] | ## Test Dependencies | Dependency | License | | ----------------------------------------------- | --------------------------------- | | [JaCoCo :: Agent][5] | [Eclipse Public License 2.0][6] | -| [JUnit Jupiter Engine][19] | [Eclipse Public License v2.0][20] | -| [JUnit Jupiter Params][19] | [Eclipse Public License v2.0][20] | -| [mockito-core][23] | [The MIT License][24] | -| [mockito-junit-jupiter][23] | [The MIT License][24] | -| [Hamcrest All][27] | [New BSD License][28] | -| [Test containers for Exasol on Docker][29] | [MIT][4] | -| [Testcontainers :: JUnit Jupiter Extension][31] | [MIT][32] | +| [JUnit Jupiter Engine][21] | [Eclipse Public License v2.0][22] | +| [JUnit Jupiter Params][21] | [Eclipse Public License v2.0][22] | +| [mockito-core][25] | [The MIT License][26] | +| [mockito-junit-jupiter][25] | [The MIT License][26] | +| [Hamcrest All][29] | [New BSD License][30] | +| [Test containers for Exasol on Docker][31] | [MIT][4] | +| [Testcontainers :: JUnit Jupiter Extension][33] | [MIT][34] | ## Runtime Dependencies @@ -37,71 +38,73 @@ | Dependency | License | | ------------------------------------------------------- | ---------------------------------------------- | -| [Maven Surefire Plugin][36] | [Apache License, Version 2.0][12] | -| [Maven Failsafe Plugin][38] | [Apache License, Version 2.0][12] | -| [JaCoCo :: Maven Plugin][40] | [Eclipse Public License 2.0][6] | -| [Apache Maven Compiler Plugin][42] | [Apache License, Version 2.0][12] | -| [Maven Dependency Plugin][44] | [The Apache Software License, Version 2.0][45] | -| [Versions Maven Plugin][46] | [Apache License, Version 2.0][12] | -| [Apache Maven Source Plugin][48] | [Apache License, Version 2.0][12] | -| [Apache Maven Javadoc Plugin][50] | [Apache License, Version 2.0][12] | -| [Apache Maven GPG Plugin][52] | [Apache License, Version 2.0][45] | -| [org.sonatype.ossindex.maven:ossindex-maven-plugin][54] | [ASL2][45] | -| [Apache Maven Enforcer Plugin][56] | [Apache License, Version 2.0][12] | -| [Project keeper maven plugin][58] | [MIT][4] | -| [Maven Deploy Plugin][60] | [The Apache Software License, Version 2.0][45] | -| [Nexus Staging Maven Plugin][62] | [Eclipse Public License][63] | -| [error-code-crawler-maven-plugin][64] | [MIT][4] | -| [Reproducible Build Maven Plugin][66] | [Apache 2.0][45] | -| [Maven Clean Plugin][68] | [The Apache Software License, Version 2.0][45] | -| [Maven Resources Plugin][70] | [The Apache Software License, Version 2.0][45] | -| [Maven JAR Plugin][72] | [The Apache Software License, Version 2.0][45] | -| [Maven Install Plugin][74] | [The Apache Software License, Version 2.0][45] | -| [Maven Site Plugin 3][76] | [The Apache Software License, Version 2.0][45] | +| [Maven Surefire Plugin][38] | [Apache License, Version 2.0][12] | +| [Maven Failsafe Plugin][40] | [Apache License, Version 2.0][12] | +| [JaCoCo :: Maven Plugin][42] | [Eclipse Public License 2.0][6] | +| [Apache Maven Compiler Plugin][44] | [Apache License, Version 2.0][12] | +| [Maven Dependency Plugin][46] | [The Apache Software License, Version 2.0][47] | +| [Versions Maven Plugin][48] | [Apache License, Version 2.0][12] | +| [Apache Maven Source Plugin][50] | [Apache License, Version 2.0][12] | +| [Apache Maven Javadoc Plugin][52] | [Apache License, Version 2.0][12] | +| [Apache Maven GPG Plugin][54] | [Apache License, Version 2.0][47] | +| [org.sonatype.ossindex.maven:ossindex-maven-plugin][56] | [ASL2][47] | +| [Apache Maven Enforcer Plugin][58] | [Apache License, Version 2.0][12] | +| [Project keeper maven plugin][60] | [MIT][4] | +| [Maven Deploy Plugin][62] | [The Apache Software License, Version 2.0][47] | +| [Nexus Staging Maven Plugin][64] | [Eclipse Public License][65] | +| [error-code-crawler-maven-plugin][66] | [MIT][4] | +| [Reproducible Build Maven Plugin][68] | [Apache 2.0][47] | +| [Maven Clean Plugin][70] | [The Apache Software License, Version 2.0][47] | +| [Maven Resources Plugin][72] | [The Apache Software License, Version 2.0][47] | +| [Maven JAR Plugin][74] | [The Apache Software License, Version 2.0][47] | +| [Maven Install Plugin][76] | [The Apache Software License, Version 2.0][47] | +| [Maven Site Plugin 3][78] | [The Apache Software License, Version 2.0][47] | [5]: https://www.eclemma.org/jacoco/index.html -[58]: https://github.com/exasol/project-keeper-maven-plugin +[60]: https://github.com/exasol/project-keeper-maven-plugin [7]: https://github.com/exasol/bucketfs-java [3]: https://github.com/exasol/error-reporting-java -[45]: http://www.apache.org/licenses/LICENSE-2.0.txt -[36]: https://maven.apache.org/surefire/maven-surefire-plugin/ -[62]: http://www.sonatype.com/public-parent/nexus-maven-plugins/nexus-staging/nexus-staging-maven-plugin/ -[68]: http://maven.apache.org/plugins/maven-clean-plugin/ +[18]: http://www.eclipse.org/legal/epl-v20.html +[47]: http://www.apache.org/licenses/LICENSE-2.0.txt +[38]: https://maven.apache.org/surefire/maven-surefire-plugin/ +[64]: http://www.sonatype.com/public-parent/nexus-maven-plugins/nexus-staging/nexus-staging-maven-plugin/ +[70]: http://maven.apache.org/plugins/maven-clean-plugin/ [4]: https://opensource.org/licenses/MIT -[23]: https://github.com/mockito/mockito -[38]: https://maven.apache.org/surefire/maven-failsafe-plugin/ +[25]: https://github.com/mockito/mockito +[40]: https://maven.apache.org/surefire/maven-failsafe-plugin/ [13]: https://github.com/exasol/test-db-builder-java [11]: https://commons.apache.org/proper/commons-compress/ -[44]: http://maven.apache.org/plugins/maven-dependency-plugin/ -[46]: http://www.mojohaus.org/versions-maven-plugin/ -[42]: https://maven.apache.org/plugins/maven-compiler-plugin/ -[32]: http://opensource.org/licenses/MIT -[52]: http://maven.apache.org/plugins/maven-gpg-plugin/ +[46]: http://maven.apache.org/plugins/maven-dependency-plugin/ +[48]: http://www.mojohaus.org/versions-maven-plugin/ +[44]: https://maven.apache.org/plugins/maven-compiler-plugin/ +[34]: http://opensource.org/licenses/MIT +[54]: http://maven.apache.org/plugins/maven-gpg-plugin/ [6]: https://www.eclipse.org/legal/epl-2.0/ -[63]: http://www.eclipse.org/legal/epl-v10.html -[29]: https://github.com/exasol/exasol-testcontainers -[40]: https://www.jacoco.org/jacoco/trunk/doc/maven.html -[24]: https://github.com/mockito/mockito/blob/main/LICENSE -[66]: http://zlika.github.io/reproducible-build-maven-plugin -[72]: http://maven.apache.org/plugins/maven-jar-plugin/ +[65]: http://www.eclipse.org/legal/epl-v10.html +[31]: https://github.com/exasol/exasol-testcontainers +[42]: https://www.jacoco.org/jacoco/trunk/doc/maven.html +[26]: https://github.com/mockito/mockito/blob/main/LICENSE +[68]: http://zlika.github.io/reproducible-build-maven-plugin +[74]: http://maven.apache.org/plugins/maven-jar-plugin/ [1]: https://projects.eclipse.org/license/epl-2.0 [16]: http://www.opensource.org/licenses/mit-license.php [12]: https://www.apache.org/licenses/LICENSE-2.0.txt -[56]: https://maven.apache.org/enforcer/maven-enforcer-plugin/ -[20]: https://www.eclipse.org/legal/epl-v20.html -[28]: http://www.opensource.org/licenses/bsd-license.php -[74]: http://maven.apache.org/plugins/maven-install-plugin/ -[19]: https://junit.org/junit5/ -[54]: https://sonatype.github.io/ossindex-maven/maven-plugin/ -[27]: https://github.com/hamcrest/JavaHamcrest/ -[31]: https://testcontainers.org +[58]: https://maven.apache.org/enforcer/maven-enforcer-plugin/ +[22]: https://www.eclipse.org/legal/epl-v20.html +[30]: http://www.opensource.org/licenses/bsd-license.php +[76]: http://maven.apache.org/plugins/maven-install-plugin/ +[21]: https://junit.org/junit5/ +[56]: https://sonatype.github.io/ossindex-maven/maven-plugin/ +[29]: https://github.com/hamcrest/JavaHamcrest/ +[33]: https://testcontainers.org [0]: https://github.com/eclipse-ee4j/jsonp -[48]: https://maven.apache.org/plugins/maven-source-plugin/ +[17]: https://github.com/itsallcode/junit5-system-extensions +[50]: https://maven.apache.org/plugins/maven-source-plugin/ [2]: https://projects.eclipse.org/license/secondary-gpl-2.0-cp [15]: http://www.slf4j.org -[60]: http://maven.apache.org/plugins/maven-deploy-plugin/ -[76]: http://maven.apache.org/plugins/maven-site-plugin/ -[70]: http://maven.apache.org/plugins/maven-resources-plugin/ -[50]: https://maven.apache.org/plugins/maven-javadoc-plugin/ -[64]: https://github.com/exasol/error-code-crawler-maven-plugin +[62]: http://maven.apache.org/plugins/maven-deploy-plugin/ +[78]: http://maven.apache.org/plugins/maven-site-plugin/ +[72]: http://maven.apache.org/plugins/maven-resources-plugin/ +[52]: https://maven.apache.org/plugins/maven-javadoc-plugin/ +[66]: https://github.com/exasol/error-code-crawler-maven-plugin [9]: https://github.com/exasol/exasol-test-setup-abstraction-java diff --git a/doc/changes/changelog.md b/doc/changes/changelog.md index 1b5cd4f..18f6610 100644 --- a/doc/changes/changelog.md +++ b/doc/changes/changelog.md @@ -1,5 +1,6 @@ # Changes +* [0.6.0](changes_0.6.0.md) * [0.5.0](changes_0.5.0.md) * [0.4.1](changes_0.4.1.md) * [0.4.0](changes_0.4.0.md) diff --git a/doc/changes/changes_0.6.0.md b/doc/changes/changes_0.6.0.md new file mode 100644 index 0000000..238c0f2 --- /dev/null +++ b/doc/changes/changes_0.6.0.md @@ -0,0 +1,24 @@ +# udf-debugging-java 0.6.0, released 2022-02-21 + +Code name: Single line info message + +## Features + +* #13: Made info message single line + +## Dependency Updates + +### Compile Dependency Updates + +* Updated `com.exasol:bucketfs-java:2.2.0` to `2.3.0` +* Updated `com.exasol:exasol-test-setup-abstraction-java:0.2.1` to `0.2.2` +* Updated `com.exasol:test-db-builder-java:3.2.1` to `3.2.2` +* Added `org.itsallcode:junit5-system-extensions:1.2.0` +* Updated `org.slf4j:slf4j-api:1.7.32` to `1.7.36` + +### Test Dependency Updates + +* Updated `com.exasol:exasol-testcontainers:5.1.1` to `6.0.0` +* Updated `org.mockito:mockito-core:4.2.0` to `4.3.1` +* Updated `org.mockito:mockito-junit-jupiter:4.2.0` to `4.3.1` +* Updated `org.testcontainers:junit-jupiter:1.16.2` to `1.16.3` diff --git a/pom.xml b/pom.xml index a5692a4..d7b213e 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.exasol udf-debugging-java - 0.5.0 + 0.6.0 udf-debugging-java Utilities for debugging, profiling and code coverage measure for UDFs. https://github.com/exasol/udf-debugging-java @@ -17,7 +17,7 @@ 11.0.0 true 0.8.7 - 1.16.2 + 1.16.3 3.0.0-M4 @@ -82,12 +82,12 @@ com.exasol bucketfs-java - 2.2.0 + 2.3.0 com.exasol exasol-test-setup-abstraction-java - 0.2.1 + 0.2.2 org.apache.commons @@ -110,13 +110,13 @@ org.mockito mockito-core - 4.2.0 + 4.3.1 test org.mockito mockito-junit-jupiter - 4.2.0 + 4.3.1 test @@ -129,7 +129,7 @@ com.exasol exasol-testcontainers - 5.1.1 + 6.0.0 test @@ -141,14 +141,19 @@ com.exasol test-db-builder-java - 3.2.1 + 3.2.2 org.slf4j slf4j-api - 1.7.32 + 1.7.36 compile + + org.itsallcode + junit5-system-extensions + 1.2.0 + diff --git a/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java b/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java index b0f5f48..3747717 100644 --- a/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java +++ b/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java @@ -76,14 +76,9 @@ private void printInfoMessage() { } private String getInfoMessage() { - final StringBuilder messageBuilder = new StringBuilder("Udf Test Setup Configuration:\n"); - AVAILABLE_MODULES.forEach(module -> { - messageBuilder.append(module.getModulePropertyName()); - messageBuilder.append(":\t"); - messageBuilder.append(module.isEnabled() ? "enabled" : "disabled"); - messageBuilder.append("\n"); - }); - return messageBuilder.toString(); + return AVAILABLE_MODULES.stream() + .map(module -> module.getModulePropertyName() + ": " + (module.isEnabled() ? "✓" : "✗")) + .collect(Collectors.joining("; ")) + "\n"; } @Override diff --git a/src/test/java/com/exasol/udfdebugging/UdfTestSetupTest.java b/src/test/java/com/exasol/udfdebugging/UdfTestSetupTest.java index 7033660..2cf1c97 100644 --- a/src/test/java/com/exasol/udfdebugging/UdfTestSetupTest.java +++ b/src/test/java/com/exasol/udfdebugging/UdfTestSetupTest.java @@ -8,6 +8,7 @@ import java.util.Arrays; import java.util.List; +import org.itsallcode.junit.sysextensions.SystemOutGuard; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -18,6 +19,7 @@ import com.exasol.bucketfs.Bucket; @ExtendWith(MockitoExtension.class) +@ExtendWith(SystemOutGuard.class) class UdfTestSetupTest { public static final String COVERAGE_PROPERTY = "test.coverage"; public static final String DEBUG_PROPERTY = "test.debug"; @@ -27,7 +29,7 @@ class UdfTestSetupTest { private Connection connection; @BeforeEach - void before() throws SQLException { + void before() { System.clearProperty(DEBUG_PROPERTY); System.clearProperty(COVERAGE_PROPERTY); System.clearProperty(UDF_LOGS_PROPERTY); From 473bcb3fbcc860b4e4f3a658b0eb7a4e4a6490d7 Mon Sep 17 00:00:00 2001 From: jakobbraun Date: Wed, 23 Feb 2022 09:13:30 +0100 Subject: [PATCH 14/37] Prepared release 0.6.0 (#34) --- doc/changes/changes_0.6.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changes/changes_0.6.0.md b/doc/changes/changes_0.6.0.md index 238c0f2..22f5cb0 100644 --- a/doc/changes/changes_0.6.0.md +++ b/doc/changes/changes_0.6.0.md @@ -1,4 +1,4 @@ -# udf-debugging-java 0.6.0, released 2022-02-21 +# udf-debugging-java 0.6.0, released 2022-02-23 Code name: Single line info message From 5a6e22219c10f30b6bc35015635573e58b438a8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ch=CF=80?= Date: Tue, 10 May 2022 13:28:08 +0200 Subject: [PATCH 15/37] Upgrade dependencies (#35) * Upgrade dependencies Co-authored-by: Jakob Braun --- .github/workflows/broken_links_checker.yml | 7 +- .github/workflows/ci-build-next-java.yml | 16 +- .github/workflows/ci-build.yml | 47 ++- .github/workflows/dependencies_check.yml | 14 +- ...elease_droid_prepare_original_checksum.yml | 16 +- .../release_droid_print_quick_checksum.yml | 12 +- ...release_droid_release_on_maven_central.yml | 20 +- ...ase_droid_upload_github_release_assets.yml | 12 +- .gitignore | 3 +- .project-keeper.yml | 6 + README.md | 2 +- dependencies.md | 144 ++++---- doc/changes/changelog.md | 1 + doc/changes/changes_0.6.1.md | 43 +++ error_code_config.yml | 3 +- pk_generated_parent.pom | 311 +++++++++++++++++ pom.xml | 312 ++++-------------- release_config.yml | 3 + 18 files changed, 574 insertions(+), 398 deletions(-) create mode 100644 .project-keeper.yml create mode 100644 doc/changes/changes_0.6.1.md create mode 100644 pk_generated_parent.pom create mode 100644 release_config.yml diff --git a/.github/workflows/broken_links_checker.yml b/.github/workflows/broken_links_checker.yml index c268e21..8ad6578 100644 --- a/.github/workflows/broken_links_checker.yml +++ b/.github/workflows/broken_links_checker.yml @@ -11,13 +11,16 @@ on: jobs: linkChecker: runs-on: ubuntu-latest + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Configure broken links checker run: | mkdir -p ./target echo '{ "aliveStatusCodes": [429, 200] }' > ./target/broken_links_checker.json - - uses: gaurav-nelson/github-action-markdown-link-check@v1 + - uses: gaurav-nelson/github-action-markdown-link-check@1.0.13 with: use-quiet-mode: 'yes' use-verbose-mode: 'yes' diff --git a/.github/workflows/ci-build-next-java.yml b/.github/workflows/ci-build-next-java.yml index 2abe7cb..6a1006c 100644 --- a/.github/workflows/ci-build-next-java.yml +++ b/.github/workflows/ci-build-next-java.yml @@ -9,23 +9,20 @@ on: jobs: java-17-compatibility: runs-on: ubuntu-latest + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true steps: - name: Checkout the repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Set up JDK 17 - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: 'temurin' java-version: 17 - - name: Cache local Maven repository - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- + cache: 'maven' - name: Run tests and build with Maven run: | mvn --batch-mode --update-snapshots clean package -DtrimStackTrace=false \ @@ -35,3 +32,4 @@ jobs: if: ${{ always() && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' }} with: github_token: ${{ secrets.GITHUB_TOKEN }} + fail_if_no_tests: false diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 94c3309..e520870 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -1,30 +1,55 @@ name: CI Build on: - - push + push: + branches: + - main + pull_request: jobs: build: runs-on: ubuntu-latest + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true steps: - name: Checkout the repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Set up JDK 11 - uses: actions/setup-java@v1 + uses: actions/setup-java@v3 with: + distribution: 'temurin' java-version: 11 - - name: Cache local Maven repository - uses: actions/cache@v2 + cache: 'maven' + - name: Cache SonarCloud packages + uses: actions/cache@v3 with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Enable testcontainer reuse + run: echo 'testcontainers.reuse.enable=true' > "$HOME/.testcontainers.properties" - name: Run tests and build with Maven - run: mvn -B clean verify sonar:sonar --file pom.xml -Dsonar.organization=exasol -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONAR_TOKEN + run: | + mvn --batch-mode clean verify \ + -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ + -DtrimStackTrace=false + - name: Publish Test Report + uses: scacap/action-surefire-report@v1 + if: ${{ always() && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' }} + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + - name: Sonar analysis + if: ${{ env.SONAR_TOKEN != null }} + run: | + mvn --batch-mode org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \ + -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ + -DtrimStackTrace=false \ + -Dsonar.organization=exasol \ + -Dsonar.host.url=https://sonarcloud.io \ + -Dsonar.login=$SONAR_TOKEN env: - GITHUB_OAUTH: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/dependencies_check.yml b/.github/workflows/dependencies_check.yml index d28c0b4..b2ab231 100644 --- a/.github/workflows/dependencies_check.yml +++ b/.github/workflows/dependencies_check.yml @@ -9,18 +9,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up JDK 11 - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: 'temurin' java-version: 11 - - name: Cache local Maven repository - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- + cache: 'maven' - name: Checking dependencies for vulnerabilities - run: mvn org.sonatype.ossindex.maven:ossindex-maven-plugin:audit -f pom.xml \ No newline at end of file + run: mvn --batch-mode org.sonatype.ossindex.maven:ossindex-maven-plugin:audit -f pom.xml \ No newline at end of file diff --git a/.github/workflows/release_droid_prepare_original_checksum.yml b/.github/workflows/release_droid_prepare_original_checksum.yml index 650b120..4a980f8 100644 --- a/.github/workflows/release_droid_prepare_original_checksum.yml +++ b/.github/workflows/release_droid_prepare_original_checksum.yml @@ -8,27 +8,23 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout the repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Set up JDK 11 - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: 'temurin' java-version: 11 - - name: Cache local Maven repository - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- + cache: 'maven' + - name: Enable testcontainer reuse + run: echo 'testcontainers.reuse.enable=true' > "$HOME/.testcontainers.properties" - name: Run tests and build with Maven run: mvn --batch-mode clean verify --file pom.xml - name: Prepare checksum run: find target -maxdepth 1 -name *.jar -exec sha256sum "{}" + > original_checksum - name: Upload checksum to the artifactory - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: original_checksum retention-days: 5 diff --git a/.github/workflows/release_droid_print_quick_checksum.yml b/.github/workflows/release_droid_print_quick_checksum.yml index 746fc43..8add957 100644 --- a/.github/workflows/release_droid_print_quick_checksum.yml +++ b/.github/workflows/release_droid_print_quick_checksum.yml @@ -8,21 +8,15 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout the repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Set up JDK 11 - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: 'temurin' java-version: 11 - - name: Cache local Maven repository - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- + cache: 'maven' - name: Build with Maven skipping tests run: mvn --batch-mode clean verify -DskipTests - name: Print checksum diff --git a/.github/workflows/release_droid_release_on_maven_central.yml b/.github/workflows/release_droid_release_on_maven_central.yml index 5758ecf..b467607 100644 --- a/.github/workflows/release_droid_release_on_maven_central.yml +++ b/.github/workflows/release_droid_release_on_maven_central.yml @@ -8,29 +8,23 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout the repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Set up Maven Central Repository - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: 'temurin' java-version: 11 + cache: 'maven' server-id: ossrh server-username: MAVEN_USERNAME server-password: MAVEN_PASSWORD - - name: Import GPG Key - run: - gpg --import --batch <(echo "${{ secrets.OSSRH_GPG_SECRET_KEY }}") - - name: Cache local Maven repository - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- + gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }} + gpg-passphrase: MAVEN_GPG_PASSPHRASE - name: Publish to Central Repository + run: mvn --batch-mode -Dgpg.skip=false -DskipTests clean deploy env: MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} - run: mvn clean -Dgpg.skip=false -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} -DskipTests deploy \ No newline at end of file + MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} \ No newline at end of file diff --git a/.github/workflows/release_droid_upload_github_release_assets.yml b/.github/workflows/release_droid_upload_github_release_assets.yml index e2c761b..1fd0b60 100644 --- a/.github/workflows/release_droid_upload_github_release_assets.yml +++ b/.github/workflows/release_droid_upload_github_release_assets.yml @@ -12,21 +12,15 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout the repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Set up JDK 11 - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: 'temurin' java-version: 11 - - name: Cache local Maven repository - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- + cache: 'maven' - name: Build with Maven skipping tests run: mvn --batch-mode clean verify -DskipTests - name: Generate sha256sum files diff --git a/.gitignore b/.gitignore index 3f3c805..131ad3b 100644 --- a/.gitignore +++ b/.gitignore @@ -30,4 +30,5 @@ venv/ *.bak *.orig *.old -*.md.html \ No newline at end of file +*.md.html +*.flattened-pom.xml \ No newline at end of file diff --git a/.project-keeper.yml b/.project-keeper.yml new file mode 100644 index 0000000..779672c --- /dev/null +++ b/.project-keeper.yml @@ -0,0 +1,6 @@ +sources: + - type: maven + path: pom.xml + modules: + - maven_central + - integration_tests \ No newline at end of file diff --git a/README.md b/README.md index 1277ff0..50779b5 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # UDF Debugging Tools for Java [![Build Status](https://github.com/exasol/udf-debugging-java/actions/workflows/ci-build.yml/badge.svg)](https://github.com/exasol/udf-debugging-java/actions/workflows/ci-build.yml) -[![Maven Central](https://img.shields.io/maven-central/v/com.exasol/udf-debugging-java)](https://search.maven.org/artifact/com.exasol/udf-debugging-java) +[![Maven Central – udf-debugging-java](https://img.shields.io/maven-central/v/com.exasol/udf-debugging-java)](https://search.maven.org/artifact/com.exasol/udf-debugging-java) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Audf-debugging-java&metric=alert_status)](https://sonarcloud.io/dashboard?id=com.exasol%3Audf-debugging-java) diff --git a/dependencies.md b/dependencies.md index 3accac4..9c94600 100644 --- a/dependencies.md +++ b/dependencies.md @@ -11,22 +11,21 @@ | [BucketFS Java][7] | [MIT][4] | | [exasol-test-setup-abstraction-java][9] | [MIT][4] | | [Apache Commons Compress][11] | [Apache License, Version 2.0][12] | -| [Test Database Builder for Java][13] | [MIT][4] | -| [SLF4J API Module][15] | [MIT License][16] | -| [JUnit5 System Extensions][17] | [Eclipse Public License v2.0][18] | +| [SLF4J API Module][13] | [MIT License][14] | ## Test Dependencies | Dependency | License | | ----------------------------------------------- | --------------------------------- | | [JaCoCo :: Agent][5] | [Eclipse Public License 2.0][6] | -| [JUnit Jupiter Engine][21] | [Eclipse Public License v2.0][22] | -| [JUnit Jupiter Params][21] | [Eclipse Public License v2.0][22] | -| [mockito-core][25] | [The MIT License][26] | -| [mockito-junit-jupiter][25] | [The MIT License][26] | -| [Hamcrest All][29] | [New BSD License][30] | -| [Test containers for Exasol on Docker][31] | [MIT][4] | -| [Testcontainers :: JUnit Jupiter Extension][33] | [MIT][34] | +| [JUnit Jupiter Engine][17] | [Eclipse Public License v2.0][18] | +| [JUnit Jupiter Params][17] | [Eclipse Public License v2.0][18] | +| [mockito-junit-jupiter][21] | [The MIT License][22] | +| [Hamcrest All][23] | [New BSD License][24] | +| [Test containers for Exasol on Docker][25] | [MIT][4] | +| [Testcontainers :: JUnit Jupiter Extension][27] | [MIT][28] | +| [Test Database Builder for Java][29] | [MIT License][30] | +| [JUnit5 System Extensions][31] | [Eclipse Public License v2.0][32] | ## Runtime Dependencies @@ -38,73 +37,80 @@ | Dependency | License | | ------------------------------------------------------- | ---------------------------------------------- | -| [Maven Surefire Plugin][38] | [Apache License, Version 2.0][12] | -| [Maven Failsafe Plugin][40] | [Apache License, Version 2.0][12] | -| [JaCoCo :: Maven Plugin][42] | [Eclipse Public License 2.0][6] | -| [Apache Maven Compiler Plugin][44] | [Apache License, Version 2.0][12] | -| [Maven Dependency Plugin][46] | [The Apache Software License, Version 2.0][47] | -| [Versions Maven Plugin][48] | [Apache License, Version 2.0][12] | -| [Apache Maven Source Plugin][50] | [Apache License, Version 2.0][12] | -| [Apache Maven Javadoc Plugin][52] | [Apache License, Version 2.0][12] | -| [Apache Maven GPG Plugin][54] | [Apache License, Version 2.0][47] | -| [org.sonatype.ossindex.maven:ossindex-maven-plugin][56] | [ASL2][47] | -| [Apache Maven Enforcer Plugin][58] | [Apache License, Version 2.0][12] | -| [Project keeper maven plugin][60] | [MIT][4] | -| [Maven Deploy Plugin][62] | [The Apache Software License, Version 2.0][47] | +| [SonarQube Scanner for Maven][36] | [GNU LGPL 3][37] | +| [Apache Maven Compiler Plugin][38] | [Apache License, Version 2.0][12] | +| [Apache Maven Enforcer Plugin][40] | [Apache License, Version 2.0][12] | +| [Maven Flatten Plugin][42] | [Apache Software Licenese][43] | +| [org.sonatype.ossindex.maven:ossindex-maven-plugin][44] | [ASL2][43] | +| [Reproducible Build Maven Plugin][46] | [Apache 2.0][43] | +| [Maven Dependency Plugin][48] | [The Apache Software License, Version 2.0][43] | +| [Project keeper maven plugin][50] | [The MIT License][51] | +| [Maven Surefire Plugin][52] | [Apache License, Version 2.0][12] | +| [Versions Maven Plugin][54] | [Apache License, Version 2.0][12] | +| [Apache Maven Deploy Plugin][56] | [Apache License, Version 2.0][12] | +| [Apache Maven GPG Plugin][58] | [Apache License, Version 2.0][12] | +| [Apache Maven Source Plugin][60] | [Apache License, Version 2.0][12] | +| [Apache Maven Javadoc Plugin][62] | [Apache License, Version 2.0][12] | | [Nexus Staging Maven Plugin][64] | [Eclipse Public License][65] | -| [error-code-crawler-maven-plugin][66] | [MIT][4] | -| [Reproducible Build Maven Plugin][68] | [Apache 2.0][47] | -| [Maven Clean Plugin][70] | [The Apache Software License, Version 2.0][47] | -| [Maven Resources Plugin][72] | [The Apache Software License, Version 2.0][47] | -| [Maven JAR Plugin][74] | [The Apache Software License, Version 2.0][47] | -| [Maven Install Plugin][76] | [The Apache Software License, Version 2.0][47] | -| [Maven Site Plugin 3][78] | [The Apache Software License, Version 2.0][47] | +| [Maven Failsafe Plugin][66] | [Apache License, Version 2.0][12] | +| [JaCoCo :: Maven Plugin][68] | [Eclipse Public License 2.0][6] | +| [error-code-crawler-maven-plugin][70] | [MIT][4] | +| [Maven Clean Plugin][72] | [The Apache Software License, Version 2.0][43] | +| [Maven Resources Plugin][74] | [The Apache Software License, Version 2.0][43] | +| [Maven JAR Plugin][76] | [The Apache Software License, Version 2.0][43] | +| [Maven Install Plugin][78] | [The Apache Software License, Version 2.0][43] | +| [Maven Site Plugin 3][80] | [The Apache Software License, Version 2.0][43] | [5]: https://www.eclemma.org/jacoco/index.html -[60]: https://github.com/exasol/project-keeper-maven-plugin [7]: https://github.com/exasol/bucketfs-java [3]: https://github.com/exasol/error-reporting-java -[18]: http://www.eclipse.org/legal/epl-v20.html -[47]: http://www.apache.org/licenses/LICENSE-2.0.txt -[38]: https://maven.apache.org/surefire/maven-surefire-plugin/ -[64]: http://www.sonatype.com/public-parent/nexus-maven-plugins/nexus-staging/nexus-staging-maven-plugin/ -[70]: http://maven.apache.org/plugins/maven-clean-plugin/ +[32]: http://www.eclipse.org/legal/epl-v20.html +[43]: http://www.apache.org/licenses/LICENSE-2.0.txt +[52]: https://maven.apache.org/surefire/maven-surefire-plugin/ +[72]: http://maven.apache.org/plugins/maven-clean-plugin/ [4]: https://opensource.org/licenses/MIT -[25]: https://github.com/mockito/mockito -[40]: https://maven.apache.org/surefire/maven-failsafe-plugin/ -[13]: https://github.com/exasol/test-db-builder-java +[21]: https://github.com/mockito/mockito [11]: https://commons.apache.org/proper/commons-compress/ -[46]: http://maven.apache.org/plugins/maven-dependency-plugin/ -[48]: http://www.mojohaus.org/versions-maven-plugin/ -[44]: https://maven.apache.org/plugins/maven-compiler-plugin/ -[34]: http://opensource.org/licenses/MIT -[54]: http://maven.apache.org/plugins/maven-gpg-plugin/ +[50]: https://github.com/exasol/project-keeper/ +[54]: http://www.mojohaus.org/versions-maven-plugin/ +[38]: https://maven.apache.org/plugins/maven-compiler-plugin/ +[30]: https://github.com/exasol/test-db-builder-java/blob/main/LICENSE [6]: https://www.eclipse.org/legal/epl-2.0/ -[65]: http://www.eclipse.org/legal/epl-v10.html -[31]: https://github.com/exasol/exasol-testcontainers -[42]: https://www.jacoco.org/jacoco/trunk/doc/maven.html -[26]: https://github.com/mockito/mockito/blob/main/LICENSE -[68]: http://zlika.github.io/reproducible-build-maven-plugin -[74]: http://maven.apache.org/plugins/maven-jar-plugin/ -[1]: https://projects.eclipse.org/license/epl-2.0 -[16]: http://www.opensource.org/licenses/mit-license.php -[12]: https://www.apache.org/licenses/LICENSE-2.0.txt -[58]: https://maven.apache.org/enforcer/maven-enforcer-plugin/ -[22]: https://www.eclipse.org/legal/epl-v20.html -[30]: http://www.opensource.org/licenses/bsd-license.php -[76]: http://maven.apache.org/plugins/maven-install-plugin/ -[21]: https://junit.org/junit5/ -[56]: https://sonatype.github.io/ossindex-maven/maven-plugin/ -[29]: https://github.com/hamcrest/JavaHamcrest/ -[33]: https://testcontainers.org +[56]: https://maven.apache.org/plugins/maven-deploy-plugin/ +[37]: http://www.gnu.org/licenses/lgpl.txt +[68]: https://www.jacoco.org/jacoco/trunk/doc/maven.html +[22]: https://github.com/mockito/mockito/blob/main/LICENSE +[46]: http://zlika.github.io/reproducible-build-maven-plugin +[14]: http://www.opensource.org/licenses/mit-license.php +[36]: http://sonarsource.github.io/sonar-scanner-maven/ +[17]: https://junit.org/junit5/ +[42]: https://www.mojohaus.org/flatten-maven-plugin/flatten-maven-plugin [0]: https://github.com/eclipse-ee4j/jsonp -[17]: https://github.com/itsallcode/junit5-system-extensions -[50]: https://maven.apache.org/plugins/maven-source-plugin/ +[60]: https://maven.apache.org/plugins/maven-source-plugin/ [2]: https://projects.eclipse.org/license/secondary-gpl-2.0-cp -[15]: http://www.slf4j.org -[62]: http://maven.apache.org/plugins/maven-deploy-plugin/ -[78]: http://maven.apache.org/plugins/maven-site-plugin/ -[72]: http://maven.apache.org/plugins/maven-resources-plugin/ -[52]: https://maven.apache.org/plugins/maven-javadoc-plugin/ -[66]: https://github.com/exasol/error-code-crawler-maven-plugin +[13]: http://www.slf4j.org +[74]: http://maven.apache.org/plugins/maven-resources-plugin/ [9]: https://github.com/exasol/exasol-test-setup-abstraction-java +[29]: https://github.com/exasol/test-db-builder-java/ +[64]: http://www.sonatype.com/public-parent/nexus-maven-plugins/nexus-staging/nexus-staging-maven-plugin/ +[66]: https://maven.apache.org/surefire/maven-failsafe-plugin/ +[48]: http://maven.apache.org/plugins/maven-dependency-plugin/ +[28]: http://opensource.org/licenses/MIT +[65]: http://www.eclipse.org/legal/epl-v10.html +[25]: https://github.com/exasol/exasol-testcontainers +[23]: https://github.com/hamcrest/JavaHamcrest/hamcrest-all +[51]: https://github.com/exasol/project-keeper/blob/main/LICENSE +[76]: http://maven.apache.org/plugins/maven-jar-plugin/ +[1]: https://projects.eclipse.org/license/epl-2.0 +[12]: https://www.apache.org/licenses/LICENSE-2.0.txt +[40]: https://maven.apache.org/enforcer/maven-enforcer-plugin/ +[18]: https://www.eclipse.org/legal/epl-v20.html +[24]: http://www.opensource.org/licenses/bsd-license.php +[78]: http://maven.apache.org/plugins/maven-install-plugin/ +[44]: https://sonatype.github.io/ossindex-maven/maven-plugin/ +[58]: https://maven.apache.org/plugins/maven-gpg-plugin/ +[27]: https://testcontainers.org +[31]: https://github.com/itsallcode/junit5-system-extensions +[80]: http://maven.apache.org/plugins/maven-site-plugin/ +[62]: https://maven.apache.org/plugins/maven-javadoc-plugin/ +[70]: https://github.com/exasol/error-code-crawler-maven-plugin diff --git a/doc/changes/changelog.md b/doc/changes/changelog.md index 18f6610..f0eeead 100644 --- a/doc/changes/changelog.md +++ b/doc/changes/changelog.md @@ -1,5 +1,6 @@ # Changes +* [0.6.1](changes_0.6.1.md) * [0.6.0](changes_0.6.0.md) * [0.5.0](changes_0.5.0.md) * [0.4.1](changes_0.4.1.md) diff --git a/doc/changes/changes_0.6.1.md b/doc/changes/changes_0.6.1.md new file mode 100644 index 0000000..dd937bc --- /dev/null +++ b/doc/changes/changes_0.6.1.md @@ -0,0 +1,43 @@ +# udf-debugging-java 0.6.1, released 2022-05-10 + +Code name: 0.6.1: Upgrade dependencies + +This release upgrades dependencies and reduces the number of runtime dependencies, fixing [CVE-2022-21724](https://ossindex.sonatype.org/vulnerability/0f319d1b-e964-4471-bded-db3aeb3c3a29?component-type=maven&component-name=org.postgresql.postgresql&utm_source=ossindex-client&utm_medium=integration&utm_content=1.1.1) in the PostgreSQL JDBC driver. + +## Features + +## Dependency Updates + +### Compile Dependency Updates + +* Removed `com.exasol:test-db-builder-java:3.2.2` +* Updated `jakarta.json:jakarta.json-api:2.0.1` to `2.1.0` +* Removed `org.itsallcode:junit5-system-extensions:1.2.0` +* Updated `org.jacoco:org.jacoco.core:0.8.7` to `0.8.8` + +### Test Dependency Updates + +* Updated `com.exasol:exasol-testcontainers:6.0.0` to `6.1.1` +* Added `com.exasol:test-db-builder-java:3.3.2` +* Added `org.itsallcode:junit5-system-extensions:1.2.0` +* Updated `org.jacoco:org.jacoco.agent:0.8.7` to `0.8.8` +* Removed `org.mockito:mockito-core:4.3.1` +* Updated `org.mockito:mockito-junit-jupiter:4.3.1` to `4.5.1` +* Updated `org.testcontainers:junit-jupiter:1.16.3` to `1.17.1` + +### Plugin Dependency Updates + +* Updated `com.exasol:error-code-crawler-maven-plugin:0.7.1` to `1.1.1` +* Updated `com.exasol:project-keeper-maven-plugin:1.3.4` to `2.3.2` +* Updated `io.github.zlika:reproducible-build-maven-plugin:0.13` to `0.15` +* Updated `org.apache.maven.plugins:maven-compiler-plugin:3.8.1` to `3.10.1` +* Updated `org.apache.maven.plugins:maven-deploy-plugin:2.7` to `3.0.0-M2` +* Updated `org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M3` to `3.0.0` +* Updated `org.apache.maven.plugins:maven-gpg-plugin:1.6` to `3.0.1` +* Updated `org.apache.maven.plugins:maven-javadoc-plugin:3.3.1` to `3.4.0` +* Added `org.codehaus.mojo:flatten-maven-plugin:1.2.7` +* Updated `org.codehaus.mojo:versions-maven-plugin:2.7` to `2.10.0` +* Updated `org.jacoco:jacoco-maven-plugin:0.8.7` to `0.8.8` +* Added `org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184` +* Updated `org.sonatype.ossindex.maven:ossindex-maven-plugin:3.1.0` to `3.2.0` +* Updated `org.sonatype.plugins:nexus-staging-maven-plugin:1.6.8` to `1.6.13` diff --git a/error_code_config.yml b/error_code_config.yml index 634fed3..de4c0d6 100644 --- a/error_code_config.yml +++ b/error_code_config.yml @@ -1,4 +1,5 @@ error-tags: UDJ: packages: - - com.exasol.udfdebugging \ No newline at end of file + - com.exasol.udfdebugging + highest-index: 19 \ No newline at end of file diff --git a/pk_generated_parent.pom b/pk_generated_parent.pom new file mode 100644 index 0000000..f2c574b --- /dev/null +++ b/pk_generated_parent.pom @@ -0,0 +1,311 @@ + + + 4.0.0 + com.exasol + udf-debugging-java-generated-parent + 0.6.1 + pom + + UTF-8 + UTF-8 + 11 + + true + + + + MIT License + https://github.com/exasol/udf-debugging-java/blob/main/LICENSE + repo + + + + + Exasol + opensource@exasol.com + Exasol AG + https://www.exasol.com/ + + + + scm:git:https://github.com/exasol/udf-debugging-java.git + scm:git:https://github.com/exasol/udf-debugging-java.git + https://github.com/exasol/udf-debugging-java/ + + + + + + org.sonarsource.scanner.maven + sonar-maven-plugin + 3.9.1.2184 + + + org.apache.maven.plugins + maven-compiler-plugin + 3.9.0 + + ${java.version} + ${java.version} + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.0.0 + + + enforce-maven + + enforce + + + + + 3.6.3 + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + 1.2.7 + + true + oss + + + + flatten + process-resources + + flatten + + + + flatten.clean + clean + + clean + + + + + + org.sonatype.ossindex.maven + ossindex-maven-plugin + 3.1.0 + + + audit + package + + audit + + + + + + io.github.zlika + reproducible-build-maven-plugin + 0.15 + + + strip-jar + package + + strip-jar + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.0.0-M5 + + + -Djava.util.logging.config.file=src/test/resources/logging.properties ${argLine} + ${test.excludeTags} + + + + org.codehaus.mojo + versions-maven-plugin + 2.8.1 + + + display-updates + package + + display-plugin-updates + display-dependency-updates + + + + + file:///${project.basedir}/versionsMavenPluginRules.xml + + + + org.apache.maven.plugins + maven-deploy-plugin + 3.0.0-M1 + + true + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + sign + + + + --pinentry-mode + loopback + + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.3.1 + + + attach-javadocs + + jar + + + + + UTF-8 + + true + true + true + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.8 + + true + ossrh + https://oss.sonatype.org/ + + + + default-deploy + deploy + + deploy + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + 3.0.0-M5 + + + -Djava.util.logging.config.file=src/test/resources/logging.properties ${argLine} + + ${test.excludeTags} + + + + verify + + integration-test + verify + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.7 + + + prepare-agent + + prepare-agent + + + + merge-results + verify + + merge + + + + + ${project.build.directory}/ + + jacoco*.exec + + + + ${project.build.directory}/aggregate.exec + + + + report + verify + + report + + + ${project.build.directory}/aggregate.exec + + + + + + com.exasol + error-code-crawler-maven-plugin + 1.1.0 + + + verify + + verify + + + + + + + diff --git a/pom.xml b/pom.xml index d7b213e..c98821c 100644 --- a/pom.xml +++ b/pom.xml @@ -4,20 +4,14 @@ 4.0.0 com.exasol udf-debugging-java - 0.6.0 + 0.6.1 udf-debugging-java Utilities for debugging, profiling and code coverage measure for UDFs. - https://github.com/exasol/udf-debugging-java + https://github.com/exasol/udf-debugging-java/ - UTF-8 - UTF-8 - 11 5.8.2 - 1.7.1 11.0.0 - true - 0.8.7 - 1.16.3 + 0.8.8 3.0.0-M4 @@ -54,7 +48,7 @@ jakarta.json jakarta.json-api - 2.0.1 + 2.1.0 org.glassfish @@ -94,6 +88,11 @@ commons-compress 1.21 + + org.slf4j + slf4j-api + 1.7.36 + org.junit.jupiter @@ -107,16 +106,10 @@ ${junit.version} test - - org.mockito - mockito-core - 4.3.1 - test - org.mockito mockito-junit-jupiter - 4.3.1 + 4.5.1 test @@ -129,124 +122,30 @@ com.exasol exasol-testcontainers - 6.0.0 + 6.1.1 test org.testcontainers junit-jupiter - ${org.testcontainers.version} + 1.17.1 test com.exasol test-db-builder-java - 3.2.2 - - - org.slf4j - slf4j-api - 1.7.36 - compile + 3.3.2 + test org.itsallcode junit5-system-extensions 1.2.0 + test - - org.apache.maven.plugins - maven-surefire-plugin - ${surefire.and.failsafe.plugin.version} - - - -Djava.util.logging.config.file=src/test/resources/logging.properties ${argLine} - - **IT.java - - - - - org.apache.maven.plugins - maven-failsafe-plugin - ${surefire.and.failsafe.plugin.version} - - - -Djava.util.logging.config.file=src/test/resources/logging.properties ${argLine} - - **IT.java - - - - - - integration-test - verify - - - - - - org.jacoco - jacoco-maven-plugin - ${jacoco.version} - - - prepare-agent - - prepare-agent - - - - prepare-agent-integration - - prepare-agent-integration - - - - merge-results - verify - - merge - - - - - ${project.build.directory}/ - - jacoco*.exec - - - - ${project.build.directory}/aggregate.exec - - - - report - verify - - report - - - ${project.build.directory}/aggregate.exec - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.1 - - ${java.version} - ${java.version} - - maven-dependency-plugin @@ -266,186 +165,93 @@ - org.codehaus.mojo - versions-maven-plugin - 2.7 + com.exasol + project-keeper-maven-plugin + 2.3.2 - package - display-plugin-updates - display-dependency-updates + verify - - file:///${project.basedir}/versionsMavenPluginRules.xml - + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.and.failsafe.plugin.version} + + + org.apache.maven.plugins + maven-failsafe-plugin + ${surefire.and.failsafe.plugin.version} + + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + + + org.apache.maven.plugins + maven-compiler-plugin + 3.10.1 + + + org.codehaus.mojo + versions-maven-plugin + 2.10.0 org.apache.maven.plugins maven-source-plugin 3.2.1 - - - attach-sources - - jar - - - org.apache.maven.plugins maven-javadoc-plugin - 3.3.1 - - - attach-javadocs - - jar - - - - - UTF-8 - - true - true - true - + 3.4.0 org.apache.maven.plugins maven-gpg-plugin - 1.6 - - - sign-artifacts - verify - - sign - - - - --pinentry-mode - loopback - - - - + 3.0.1 org.sonatype.ossindex.maven ossindex-maven-plugin - 3.1.0 - - - package - - audit - - - + 3.2.0 org.apache.maven.plugins maven-enforcer-plugin - 3.0.0-M3 - - - enforce-maven - - enforce - - - - - 3.6.3 - - - - - - - - com.exasol - project-keeper-maven-plugin - 1.3.4 - - - - verify - - - - - - maven_central - integration_tests - - - https://github.com/hamcrest/JavaHamcrest/hamcrest-all|https://github.com/hamcrest/JavaHamcrest/ - - + 3.0.0 org.apache.maven.plugins maven-deploy-plugin - - true - + 3.0.0-M2 org.sonatype.plugins nexus-staging-maven-plugin - 1.6.8 - - true - ossrh - https://oss.sonatype.org/ - - - - default-deploy - deploy - - deploy - - - + 1.6.13 com.exasol error-code-crawler-maven-plugin - 0.7.1 - - - - verify - - - + 1.1.1 io.github.zlika reproducible-build-maven-plugin - 0.13 - - - strip-jar - package - - strip-jar - - - + 0.15 - - - ${project.basedir}/src/test/resources - - - \ No newline at end of file + + udf-debugging-java-generated-parent + com.exasol + 0.6.1 + pk_generated_parent.pom + + diff --git a/release_config.yml b/release_config.yml new file mode 100644 index 0000000..44dac34 --- /dev/null +++ b/release_config.yml @@ -0,0 +1,3 @@ +release-platforms: + - GitHub + - Maven From f7807c70bdb644bd7753b7c55161ab0eab1e13fd Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Mon, 13 Jun 2022 09:52:16 +0200 Subject: [PATCH 16/37] fixed CVE issues reported by sonatype ossindex audit (#36) * fixed CVE issues * Apply suggestions from code review --- .github/workflows/broken_links_checker.yml | 6 +++--- .project-keeper.yml | 4 +++- dependencies.md | 9 +++++---- doc/changes/changelog.md | 1 + doc/changes/changes_0.6.1.md | 2 +- doc/changes/changes_0.6.2.md | 17 +++++++++++++++++ pk_generated_parent.pom | 16 ++++++++-------- pom.xml | 18 ++++++++++++------ 8 files changed, 50 insertions(+), 23 deletions(-) create mode 100644 doc/changes/changes_0.6.2.md diff --git a/.github/workflows/broken_links_checker.yml b/.github/workflows/broken_links_checker.yml index 8ad6578..29071df 100644 --- a/.github/workflows/broken_links_checker.yml +++ b/.github/workflows/broken_links_checker.yml @@ -2,7 +2,7 @@ name: Broken Links Checker on: schedule: - - cron: "0 5 * * *" + - cron: "0 5 * * 0" push: branches: - main @@ -19,8 +19,8 @@ jobs: - name: Configure broken links checker run: | mkdir -p ./target - echo '{ "aliveStatusCodes": [429, 200] }' > ./target/broken_links_checker.json - - uses: gaurav-nelson/github-action-markdown-link-check@1.0.13 + echo '{ "aliveStatusCodes": [429, 200], "ignorePatterns": [{"pattern": "^https?://(www.)?opensource.org"}] }' > ./target/broken_links_checker.json + - uses: gaurav-nelson/github-action-markdown-link-check@v1 with: use-quiet-mode: 'yes' use-verbose-mode: 'yes' diff --git a/.project-keeper.yml b/.project-keeper.yml index 779672c..28d3438 100644 --- a/.project-keeper.yml +++ b/.project-keeper.yml @@ -3,4 +3,6 @@ sources: path: pom.xml modules: - maven_central - - integration_tests \ No newline at end of file + - integration_tests +linkReplacements: + - "https://github.com/hamcrest/JavaHamcrest/hamcrest-all|https://github.com/hamcrest/JavaHamcrest" \ No newline at end of file diff --git a/dependencies.md b/dependencies.md index 9c94600..2f1dedd 100644 --- a/dependencies.md +++ b/dependencies.md @@ -9,7 +9,7 @@ | [error-reporting-java][3] | [MIT][4] | | [JaCoCo :: Core][5] | [Eclipse Public License 2.0][6] | | [BucketFS Java][7] | [MIT][4] | -| [exasol-test-setup-abstraction-java][9] | [MIT][4] | +| [exasol-test-setup-abstraction-java][9] | [MIT License][10] | | [Apache Commons Compress][11] | [Apache License, Version 2.0][12] | | [SLF4J API Module][13] | [MIT License][14] | @@ -65,32 +65,34 @@ [7]: https://github.com/exasol/bucketfs-java [3]: https://github.com/exasol/error-reporting-java [32]: http://www.eclipse.org/legal/epl-v20.html +[23]: https://github.com/hamcrest/JavaHamcrest [43]: http://www.apache.org/licenses/LICENSE-2.0.txt [52]: https://maven.apache.org/surefire/maven-surefire-plugin/ [72]: http://maven.apache.org/plugins/maven-clean-plugin/ [4]: https://opensource.org/licenses/MIT [21]: https://github.com/mockito/mockito +[42]: https://www.mojohaus.org/flatten-maven-plugin/ [11]: https://commons.apache.org/proper/commons-compress/ [50]: https://github.com/exasol/project-keeper/ [54]: http://www.mojohaus.org/versions-maven-plugin/ [38]: https://maven.apache.org/plugins/maven-compiler-plugin/ [30]: https://github.com/exasol/test-db-builder-java/blob/main/LICENSE [6]: https://www.eclipse.org/legal/epl-2.0/ +[9]: https://github.com/exasol/exasol-test-setup-abstraction-java/ [56]: https://maven.apache.org/plugins/maven-deploy-plugin/ [37]: http://www.gnu.org/licenses/lgpl.txt [68]: https://www.jacoco.org/jacoco/trunk/doc/maven.html [22]: https://github.com/mockito/mockito/blob/main/LICENSE [46]: http://zlika.github.io/reproducible-build-maven-plugin +[10]: https://github.com/exasol/exasol-test-setup-abstraction-java/blob/main/LICENSE [14]: http://www.opensource.org/licenses/mit-license.php [36]: http://sonarsource.github.io/sonar-scanner-maven/ [17]: https://junit.org/junit5/ -[42]: https://www.mojohaus.org/flatten-maven-plugin/flatten-maven-plugin [0]: https://github.com/eclipse-ee4j/jsonp [60]: https://maven.apache.org/plugins/maven-source-plugin/ [2]: https://projects.eclipse.org/license/secondary-gpl-2.0-cp [13]: http://www.slf4j.org [74]: http://maven.apache.org/plugins/maven-resources-plugin/ -[9]: https://github.com/exasol/exasol-test-setup-abstraction-java [29]: https://github.com/exasol/test-db-builder-java/ [64]: http://www.sonatype.com/public-parent/nexus-maven-plugins/nexus-staging/nexus-staging-maven-plugin/ [66]: https://maven.apache.org/surefire/maven-failsafe-plugin/ @@ -98,7 +100,6 @@ [28]: http://opensource.org/licenses/MIT [65]: http://www.eclipse.org/legal/epl-v10.html [25]: https://github.com/exasol/exasol-testcontainers -[23]: https://github.com/hamcrest/JavaHamcrest/hamcrest-all [51]: https://github.com/exasol/project-keeper/blob/main/LICENSE [76]: http://maven.apache.org/plugins/maven-jar-plugin/ [1]: https://projects.eclipse.org/license/epl-2.0 diff --git a/doc/changes/changelog.md b/doc/changes/changelog.md index f0eeead..9a27b3e 100644 --- a/doc/changes/changelog.md +++ b/doc/changes/changelog.md @@ -1,5 +1,6 @@ # Changes +* [0.6.2](changes_0.6.2.md) * [0.6.1](changes_0.6.1.md) * [0.6.0](changes_0.6.0.md) * [0.5.0](changes_0.5.0.md) diff --git a/doc/changes/changes_0.6.1.md b/doc/changes/changes_0.6.1.md index dd937bc..71e9a4a 100644 --- a/doc/changes/changes_0.6.1.md +++ b/doc/changes/changes_0.6.1.md @@ -2,7 +2,7 @@ Code name: 0.6.1: Upgrade dependencies -This release upgrades dependencies and reduces the number of runtime dependencies, fixing [CVE-2022-21724](https://ossindex.sonatype.org/vulnerability/0f319d1b-e964-4471-bded-db3aeb3c3a29?component-type=maven&component-name=org.postgresql.postgresql&utm_source=ossindex-client&utm_medium=integration&utm_content=1.1.1) in the PostgreSQL JDBC driver. +This release upgrades dependencies and reduces the number of runtime dependencies, fixing [CVE-2022-21724](https://ossindex.sonatype.org/) in the PostgreSQL JDBC driver. ## Features diff --git a/doc/changes/changes_0.6.2.md b/doc/changes/changes_0.6.2.md new file mode 100644 index 0000000..403685c --- /dev/null +++ b/doc/changes/changes_0.6.2.md @@ -0,0 +1,17 @@ +# udf-debugging-java 0.6.2, released 2022-06-13 + +Code name: Dependency updates / CVE fixes + +## Summary + +Dependency updates for test-setup-abstraction and project-keeper + +## Dependency Updates + +### Compile Dependency Updates + +* Updated `com.exasol:exasol-test-setup-abstraction-java:0.2.2` to `0.3.2` + +### Plugin Dependency Updates + +* Updated `com.exasol:project-keeper-maven-plugin:2.3.2` to `2.4.6` diff --git a/pk_generated_parent.pom b/pk_generated_parent.pom index f2c574b..615f462 100644 --- a/pk_generated_parent.pom +++ b/pk_generated_parent.pom @@ -3,7 +3,7 @@ 4.0.0 com.exasol udf-debugging-java-generated-parent - 0.6.1 + 0.6.2 pom UTF-8 @@ -43,7 +43,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.9.0 + 3.10.1 ${java.version} ${java.version} @@ -97,7 +97,7 @@ org.sonatype.ossindex.maven ossindex-maven-plugin - 3.1.0 + 3.2.0 audit @@ -136,7 +136,7 @@ org.codehaus.mojo versions-maven-plugin - 2.8.1 + 2.10.0 display-updates @@ -195,7 +195,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.3.1 + 3.4.0 attach-javadocs @@ -215,7 +215,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.8 + 1.6.13 true ossrh @@ -255,7 +255,7 @@ org.jacoco jacoco-maven-plugin - 0.8.7 + 0.8.8 prepare-agent @@ -296,7 +296,7 @@ com.exasol error-code-crawler-maven-plugin - 1.1.0 + 1.1.1 verify diff --git a/pom.xml b/pom.xml index c98821c..d694f98 100644 --- a/pom.xml +++ b/pom.xml @@ -1,10 +1,9 @@ - + 4.0.0 com.exasol udf-debugging-java - 0.6.1 + 0.6.2 udf-debugging-java Utilities for debugging, profiling and code coverage measure for UDFs. https://github.com/exasol/udf-debugging-java/ @@ -81,7 +80,7 @@ com.exasol exasol-test-setup-abstraction-java - 0.2.2 + 0.3.2 org.apache.commons @@ -167,7 +166,7 @@ com.exasol project-keeper-maven-plugin - 2.3.2 + 2.4.6 @@ -220,6 +219,13 @@ org.sonatype.ossindex.maven ossindex-maven-plugin 3.2.0 + + + + sonatype-2020-0026 + + org.apache.maven.plugins @@ -251,7 +257,7 @@ udf-debugging-java-generated-parent com.exasol - 0.6.1 + 0.6.2 pk_generated_parent.pom From a2fcc20bbc23459a99ea8546aa3344bc7878066b Mon Sep 17 00:00:00 2001 From: Pieterjan Spoelders Date: Tue, 14 Jun 2022 11:04:02 +0200 Subject: [PATCH 17/37] Update release date --- doc/changes/changes_0.6.2.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changes/changes_0.6.2.md b/doc/changes/changes_0.6.2.md index 403685c..ed980ed 100644 --- a/doc/changes/changes_0.6.2.md +++ b/doc/changes/changes_0.6.2.md @@ -1,4 +1,4 @@ -# udf-debugging-java 0.6.2, released 2022-06-13 +# udf-debugging-java 0.6.2, released 2022-06-14 Code name: Dependency updates / CVE fixes From 68e0705313c11bb6d58d99331db4838f932fc6cf Mon Sep 17 00:00:00 2001 From: jakobbraun Date: Fri, 24 Jun 2022 10:10:54 +0200 Subject: [PATCH 18/37] #38: Removed exasol-test-setup-abstraction as compile dependency (#39) * #38: Removed exasol-test-setup-abstraction as compile dependency --- doc/changes/changelog.md | 1 + doc/changes/changes_0.6.3.md | 24 ++++++++++++++++++++++++ pk_generated_parent.pom | 2 +- pom.xml | 13 +++++++------ 4 files changed, 33 insertions(+), 7 deletions(-) create mode 100644 doc/changes/changes_0.6.3.md diff --git a/doc/changes/changelog.md b/doc/changes/changelog.md index 9a27b3e..0683a5d 100644 --- a/doc/changes/changelog.md +++ b/doc/changes/changelog.md @@ -1,5 +1,6 @@ # Changes +* [0.6.3](changes_0.6.3.md) * [0.6.2](changes_0.6.2.md) * [0.6.1](changes_0.6.1.md) * [0.6.0](changes_0.6.0.md) diff --git a/doc/changes/changes_0.6.3.md b/doc/changes/changes_0.6.3.md new file mode 100644 index 0000000..a8205ed --- /dev/null +++ b/doc/changes/changes_0.6.3.md @@ -0,0 +1,24 @@ +# udf-debugging-java 0.6.3, released 2022-06-24 + +Code name: Removed ETSA dependency + +## Summary + +In this release we removed the exasol-test-setup-abstraction from the compile dependencies. Now it's declared as `provided`. By that, it's no longer pulled as transitive dependency into other projects. + +## Bug Fixes + +* #38: Removed exasol-test-setup-abstraction as compile dependency + +## Dependency Updates + +### Compile Dependency Updates + +* Removed `com.exasol:exasol-test-setup-abstraction-java:0.3.2` + +### Test Dependency Updates + +* Updated `com.exasol:exasol-testcontainers:6.1.1` to `6.1.2` +* Updated `com.exasol:test-db-builder-java:3.3.2` to `3.3.3` +* Updated `org.mockito:mockito-junit-jupiter:4.5.1` to `4.6.1` +* Updated `org.testcontainers:junit-jupiter:1.17.1` to `1.17.2` diff --git a/pk_generated_parent.pom b/pk_generated_parent.pom index 615f462..4cb2ab8 100644 --- a/pk_generated_parent.pom +++ b/pk_generated_parent.pom @@ -3,7 +3,7 @@ 4.0.0 com.exasol udf-debugging-java-generated-parent - 0.6.2 + 0.6.3 pom UTF-8 diff --git a/pom.xml b/pom.xml index d694f98..db5fe53 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.exasol udf-debugging-java - 0.6.2 + 0.6.3 udf-debugging-java Utilities for debugging, profiling and code coverage measure for UDFs. https://github.com/exasol/udf-debugging-java/ @@ -81,6 +81,7 @@ com.exasol exasol-test-setup-abstraction-java 0.3.2 + provided org.apache.commons @@ -108,7 +109,7 @@ org.mockito mockito-junit-jupiter - 4.5.1 + 4.6.1 test @@ -121,19 +122,19 @@ com.exasol exasol-testcontainers - 6.1.1 + 6.1.2 test org.testcontainers junit-jupiter - 1.17.1 + 1.17.2 test com.exasol test-db-builder-java - 3.3.2 + 3.3.3 test @@ -257,7 +258,7 @@ udf-debugging-java-generated-parent com.exasol - 0.6.2 + 0.6.3 pk_generated_parent.pom From 2ceae8c32deb01ae43d9384e1da1871fb576173f Mon Sep 17 00:00:00 2001 From: jakobbraun Date: Mon, 27 Jun 2022 10:37:46 +0200 Subject: [PATCH 19/37] Bug/40 No class def found error (#41) * #40: NoClassDefFoundError when used without exasol-test-setup-abstraction-java --- doc/changes/changelog.md | 1 + doc/changes/changes_0.6.4.md | 11 ++++++++ pk_generated_parent.pom | 2 +- pom.xml | 9 ++++--- .../udfdebugging/LocalServiceExposer.java | 4 +-- .../com/exasol/udfdebugging/UdfTestSetup.java | 8 ++++-- .../modules/coverage/CoverageModule.java | 4 +-- .../modules/debugging/DebuggingModule.java | 5 ++-- .../modules/udflogs/UdfLogsModule.java | 9 ++++--- .../exasol/udfdebugging/UdfTestSetupTest.java | 26 +++++++++++++++---- .../udfdebugging/modules/TestSetup.java | 4 +-- .../modules/coverage/CoverageModuleTest.java | 7 ++--- .../modules/udflogs/UdfLogsModuleTest.java | 6 ++--- 13 files changed, 67 insertions(+), 29 deletions(-) create mode 100644 doc/changes/changes_0.6.4.md diff --git a/doc/changes/changelog.md b/doc/changes/changelog.md index 0683a5d..24f9537 100644 --- a/doc/changes/changelog.md +++ b/doc/changes/changelog.md @@ -1,5 +1,6 @@ # Changes +* [0.6.4](changes_0.6.4.md) * [0.6.3](changes_0.6.3.md) * [0.6.2](changes_0.6.2.md) * [0.6.1](changes_0.6.1.md) diff --git a/doc/changes/changes_0.6.4.md b/doc/changes/changes_0.6.4.md new file mode 100644 index 0000000..9df8762 --- /dev/null +++ b/doc/changes/changes_0.6.4.md @@ -0,0 +1,11 @@ +# udf-debugging-java 0.6.4, released 2022-06-27 + +Code name: Fixed NoClassDefFoundError + +## Summary + +## Bug Fixes + +* #40: Fixed NoClassDefFoundError when used without exasol-test-setup-abstraction-java + +## Dependency Updates diff --git a/pk_generated_parent.pom b/pk_generated_parent.pom index 4cb2ab8..6dd9e11 100644 --- a/pk_generated_parent.pom +++ b/pk_generated_parent.pom @@ -3,7 +3,7 @@ 4.0.0 com.exasol udf-debugging-java-generated-parent - 0.6.3 + 0.6.4 pom UTF-8 diff --git a/pom.xml b/pom.xml index db5fe53..e659f29 100644 --- a/pom.xml +++ b/pom.xml @@ -1,9 +1,10 @@ - + 4.0.0 com.exasol udf-debugging-java - 0.6.3 + 0.6.4 udf-debugging-java Utilities for debugging, profiling and code coverage measure for UDFs. https://github.com/exasol/udf-debugging-java/ @@ -81,6 +82,8 @@ com.exasol exasol-test-setup-abstraction-java 0.3.2 + provided @@ -258,7 +261,7 @@ udf-debugging-java-generated-parent com.exasol - 0.6.3 + 0.6.4 pk_generated_parent.pom diff --git a/src/main/java/com/exasol/udfdebugging/LocalServiceExposer.java b/src/main/java/com/exasol/udfdebugging/LocalServiceExposer.java index 19535b0..02f376b 100644 --- a/src/main/java/com/exasol/udfdebugging/LocalServiceExposer.java +++ b/src/main/java/com/exasol/udfdebugging/LocalServiceExposer.java @@ -1,6 +1,6 @@ package com.exasol.udfdebugging; -import com.exasol.exasoltestsetup.ServiceAddress; +import java.net.InetSocketAddress; /** * Implementors of this interface exposes a local service (socket) into the Exasol database. @@ -14,5 +14,5 @@ public interface LocalServiceExposer { * @param port port number * @return proxy */ - ServiceAddress exposeLocalServiceToDatabase(int port); + InetSocketAddress exposeLocalServiceToDatabase(int port); } diff --git a/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java b/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java index 3747717..194b351 100644 --- a/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java +++ b/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java @@ -1,5 +1,6 @@ package com.exasol.udfdebugging; +import java.net.InetSocketAddress; import java.sql.Connection; import java.util.List; import java.util.stream.Collectors; @@ -32,7 +33,7 @@ public class UdfTestSetup implements AutoCloseable { * @param exasolConnection connection to the Exasol database. Make sure that your tests use the same connection */ public UdfTestSetup(final String testHostIpAddress, final Bucket bucket, final Connection exasolConnection) { - this(port -> new ServiceAddress(testHostIpAddress, port), bucket, exasolConnection); + this(port -> new InetSocketAddress(testHostIpAddress, port), bucket, exasolConnection); } /** @@ -57,7 +58,10 @@ private UdfTestSetup(final LocalServiceExposer localServiceExposer, final Bucket * @param exasolConnection connection to the Exasol database. Make sure that your tests use the same connection */ public UdfTestSetup(final ExasolTestSetup testSetup, final Connection exasolConnection) { - this(testSetup::makeLocalTcpServiceAccessibleFromDatabase, testSetup.getDefaultBucket(), exasolConnection); + this(port -> { + final ServiceAddress serviceAddress = testSetup.makeLocalTcpServiceAccessibleFromDatabase(port); + return new InetSocketAddress(serviceAddress.getHostName(), serviceAddress.getPort()); + }, testSetup.getDefaultBucket(), exasolConnection); } /** diff --git a/src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModule.java b/src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModule.java index 567a8d1..2f3672c 100644 --- a/src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModule.java +++ b/src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModule.java @@ -2,6 +2,7 @@ import java.io.FileNotFoundException; import java.io.IOException; +import java.net.InetSocketAddress; import java.nio.file.Path; import java.util.concurrent.TimeoutException; import java.util.stream.Stream; @@ -9,7 +10,6 @@ import com.exasol.bucketfs.Bucket; import com.exasol.bucketfs.BucketAccessException; import com.exasol.errorreporting.ExaError; -import com.exasol.exasoltestsetup.ServiceAddress; import com.exasol.udfdebugging.LocalServiceExposer; import com.exasol.udfdebugging.Module; @@ -31,7 +31,7 @@ public CoverageModule(final LocalServiceExposer localServiceExposer, final Bucke assertJacocoAgentExists(); uploadAgentToBucketFs(bucket); JacocoServer.startIfNotRunning(); - final ServiceAddress proxyForHostPort = localServiceExposer.exposeLocalServiceToDatabase(JacocoServer.PORT); + final InetSocketAddress proxyForHostPort = localServiceExposer.exposeLocalServiceToDatabase(JacocoServer.PORT); this.jvmOption = "-javaagent:/buckets/" + bucket.getBucketFsName() + "/" + bucket.getBucketName() + "/" + JACOCO_AGENT_NAME + "=output=tcpclient,address=" + proxyForHostPort.getHostName() + ",port=" + proxyForHostPort.getPort(); diff --git a/src/main/java/com/exasol/udfdebugging/modules/debugging/DebuggingModule.java b/src/main/java/com/exasol/udfdebugging/modules/debugging/DebuggingModule.java index 3d09544..14f0010 100644 --- a/src/main/java/com/exasol/udfdebugging/modules/debugging/DebuggingModule.java +++ b/src/main/java/com/exasol/udfdebugging/modules/debugging/DebuggingModule.java @@ -1,8 +1,8 @@ package com.exasol.udfdebugging.modules.debugging; +import java.net.InetSocketAddress; import java.util.stream.Stream; -import com.exasol.exasoltestsetup.ServiceAddress; import com.exasol.udfdebugging.LocalServiceExposer; import com.exasol.udfdebugging.Module; @@ -25,7 +25,8 @@ public DebuggingModule(final LocalServiceExposer localServiceExposer) { @Override public Stream getJvmOptions() { - final ServiceAddress proxyForHostPort = this.localServiceExposer.exposeLocalServiceToDatabase(DEBUGGING_PORT); + final InetSocketAddress proxyForHostPort = this.localServiceExposer + .exposeLocalServiceToDatabase(DEBUGGING_PORT); return Stream.of("-agentlib:jdwp=transport=dt_socket,server=n,address=" + proxyForHostPort.getHostName() + ":" + proxyForHostPort.getPort() + ",suspend=y"); } diff --git a/src/main/java/com/exasol/udfdebugging/modules/udflogs/UdfLogsModule.java b/src/main/java/com/exasol/udfdebugging/modules/udflogs/UdfLogsModule.java index b27329d..a9ae696 100644 --- a/src/main/java/com/exasol/udfdebugging/modules/udflogs/UdfLogsModule.java +++ b/src/main/java/com/exasol/udfdebugging/modules/udflogs/UdfLogsModule.java @@ -1,5 +1,6 @@ package com.exasol.udfdebugging.modules.udflogs; +import java.net.InetSocketAddress; import java.nio.file.Path; import java.sql.*; import java.util.ArrayList; @@ -10,7 +11,6 @@ import java.util.stream.Stream; import com.exasol.errorreporting.ExaError; -import com.exasol.exasoltestsetup.ServiceAddress; import com.exasol.udfdebugging.LocalServiceExposer; import com.exasol.udfdebugging.Module; @@ -37,7 +37,8 @@ public UdfLogsModule(final LocalServiceExposer localServiceExposer, final Connec LOGGER.log(Level.INFO, "Created log file for UDF output: {0}", file); }; this.logRecorder = new LogRecorder(logFileHandler); - final ServiceAddress inDbAddress = localServiceExposer.exposeLocalServiceToDatabase(this.logRecorder.getPort()); + final InetSocketAddress inDbAddress = localServiceExposer + .exposeLocalServiceToDatabase(this.logRecorder.getPort()); redirectLogging(exasolConnection, inDbAddress); } @@ -55,9 +56,9 @@ public List getCapturedLogFiles() { return this.capturedLogFiles; } - private void redirectLogging(final Connection exasolConnection, final ServiceAddress logServerAddress) { + private void redirectLogging(final Connection exasolConnection, final InetSocketAddress logServerAddress) { try (final Statement statement = exasolConnection.createStatement()) { - final String logServerAddressString = logServerAddress.toString(); + final String logServerAddressString = logServerAddress.getHostString() + ":" + logServerAddress.getPort(); if (logServerAddressString.contains("'")) { throw new IllegalArgumentException(ExaError.messageBuilder("F-UDJ-19") .message("Invalid address {{address}}. The address must not contain a quotes.", diff --git a/src/test/java/com/exasol/udfdebugging/UdfTestSetupTest.java b/src/test/java/com/exasol/udfdebugging/UdfTestSetupTest.java index 2cf1c97..02d7081 100644 --- a/src/test/java/com/exasol/udfdebugging/UdfTestSetupTest.java +++ b/src/test/java/com/exasol/udfdebugging/UdfTestSetupTest.java @@ -5,7 +5,6 @@ import static org.mockito.Mockito.*; import java.sql.*; -import java.util.Arrays; import java.util.List; import org.itsallcode.junit.sysextensions.SystemOutGuard; @@ -17,6 +16,8 @@ import org.mockito.junit.jupiter.MockitoExtension; import com.exasol.bucketfs.Bucket; +import com.exasol.exasoltestsetup.ExasolTestSetup; +import com.exasol.exasoltestsetup.ServiceAddress; @ExtendWith(MockitoExtension.class) @ExtendWith(SystemOutGuard.class) @@ -39,7 +40,7 @@ void before() { void testDebuggingEnabled() { System.setProperty(DEBUG_PROPERTY, "true"); try (final UdfTestSetup udfTestSetup = getUdfTestSetup()) { - final List jvmOptions = Arrays.asList(udfTestSetup.getJvmOptions()); + final List jvmOptions = List.of(udfTestSetup.getJvmOptions()); assertThat(jvmOptions, hasItem(EXPECTED_DEBUG_JVM_OPTION)); } } @@ -48,11 +49,26 @@ private UdfTestSetup getUdfTestSetup() { return new UdfTestSetup("1.2.3.4", mock(Bucket.class), this.connection); } + @Test + void testGetTestSetupForETAJ() { + System.setProperty(COVERAGE_PROPERTY, "true"); + final ExasolTestSetup testSetup = mock(ExasolTestSetup.class); + final Bucket bucket = mock(Bucket.class); + when(testSetup.getDefaultBucket()).thenReturn(bucket); + when(testSetup.makeLocalTcpServiceAccessibleFromDatabase(anyInt())) + .thenReturn(new ServiceAddress("4.3.2.1", 123)); + try (final UdfTestSetup udfTestSetup = new UdfTestSetup(testSetup, this.connection)) { + final List jvmOptions = List.of(udfTestSetup.getJvmOptions()); + assertThat(jvmOptions, hasItem( + "-javaagent:/buckets/null/null/org.jacoco.agent-runtime.jar=output=tcpclient,address=4.3.2.1,port=123")); + } + } + @Test void testCoverageEnabled() { System.setProperty(COVERAGE_PROPERTY, "true"); try (final UdfTestSetup udfTestSetup = getUdfTestSetup()) { - final List jvmOptions = Arrays.asList(udfTestSetup.getJvmOptions()); + final List jvmOptions = List.of(udfTestSetup.getJvmOptions()); assertThat(jvmOptions, hasItem( "-javaagent:/buckets/null/null/org.jacoco.agent-runtime.jar=output=tcpclient,address=1.2.3.4,port=3002")); } @@ -72,7 +88,7 @@ void testUdfLogsEnabled() throws SQLException { @Test void testAllModulesAreDisabledByDefault() { try (final UdfTestSetup udfTestSetup = getUdfTestSetup()) { - final List jvmOptions = Arrays.asList(udfTestSetup.getJvmOptions()); + final List jvmOptions = List.of(udfTestSetup.getJvmOptions()); assertThat(jvmOptions.isEmpty(), equalTo(true)); } } @@ -81,7 +97,7 @@ void testAllModulesAreDisabledByDefault() { void testDebuggingDisabled() { System.setProperty(DEBUG_PROPERTY, "false"); try (final UdfTestSetup udfTestSetup = getUdfTestSetup()) { - final List jvmOptions = Arrays.asList(udfTestSetup.getJvmOptions()); + final List jvmOptions = List.of(udfTestSetup.getJvmOptions()); assertThat(jvmOptions, not(hasItem(EXPECTED_DEBUG_JVM_OPTION))); } } diff --git a/src/test/java/com/exasol/udfdebugging/modules/TestSetup.java b/src/test/java/com/exasol/udfdebugging/modules/TestSetup.java index b82ca1b..cacb62f 100644 --- a/src/test/java/com/exasol/udfdebugging/modules/TestSetup.java +++ b/src/test/java/com/exasol/udfdebugging/modules/TestSetup.java @@ -1,6 +1,7 @@ package com.exasol.udfdebugging.modules; import java.io.Closeable; +import java.net.InetSocketAddress; import java.sql.*; import java.util.stream.Stream; @@ -8,7 +9,6 @@ import com.exasol.containers.ExasolContainer; import com.exasol.dbbuilder.dialects.exasol.*; import com.exasol.dbbuilder.dialects.exasol.udf.UdfScript; -import com.exasol.exasoltestsetup.ServiceAddress; import com.exasol.udfdebugging.LocalServiceExposer; /** @@ -27,7 +27,7 @@ public TestSetup() throws SQLException { } public LocalServiceExposer getHostPortProxy() { - return port -> new ServiceAddress(this.exasol.getHostIp(), port); + return port -> new InetSocketAddress(this.exasol.getHostIp(), port); } public Bucket getDefaultBucket() { diff --git a/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleTest.java b/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleTest.java index 214bb26..40129a8 100644 --- a/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleTest.java +++ b/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleTest.java @@ -5,6 +5,7 @@ import static org.mockito.Mockito.*; import java.io.FileNotFoundException; +import java.net.InetSocketAddress; import java.nio.file.Path; import java.util.concurrent.TimeoutException; import java.util.stream.Collectors; @@ -13,14 +14,13 @@ import com.exasol.bucketfs.Bucket; import com.exasol.bucketfs.BucketAccessException; -import com.exasol.exasoltestsetup.ServiceAddress; class CoverageModuleTest { @Test void testUpload() throws BucketAccessException, TimeoutException, FileNotFoundException { final Bucket bucket = mock(Bucket.class); - new CoverageModule((port) -> new ServiceAddress("1.2.3.4", port), bucket); + new CoverageModule((port) -> new InetSocketAddress("1.2.3.4", port), bucket); verify(bucket).uploadFile(Path.of("target", "jacoco-agent", "org.jacoco.agent-runtime.jar"), "org.jacoco.agent-runtime.jar"); } @@ -30,7 +30,8 @@ void testGetJvmOptions() { final Bucket bucket = mock(Bucket.class); when(bucket.getBucketFsName()).thenReturn("my_bucketfs"); when(bucket.getBucketName()).thenReturn("my_bucket"); - final CoverageModule coverageModule = new CoverageModule((port) -> new ServiceAddress("1.2.3.4", port), bucket); + final CoverageModule coverageModule = new CoverageModule((port) -> new InetSocketAddress("1.2.3.4", port), + bucket); assertThat(coverageModule.getJvmOptions().collect(Collectors.toList()), contains( "-javaagent:/buckets/my_bucketfs/my_bucket/org.jacoco.agent-runtime.jar=output=tcpclient,address=1.2.3.4,port=3002")); } diff --git a/src/test/java/com/exasol/udfdebugging/modules/udflogs/UdfLogsModuleTest.java b/src/test/java/com/exasol/udfdebugging/modules/udflogs/UdfLogsModuleTest.java index 7a4193d..c519223 100644 --- a/src/test/java/com/exasol/udfdebugging/modules/udflogs/UdfLogsModuleTest.java +++ b/src/test/java/com/exasol/udfdebugging/modules/udflogs/UdfLogsModuleTest.java @@ -7,6 +7,7 @@ import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.when; +import java.net.InetSocketAddress; import java.sql.*; import org.junit.jupiter.api.BeforeEach; @@ -15,7 +16,6 @@ import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -import com.exasol.exasoltestsetup.ServiceAddress; import com.exasol.udfdebugging.LocalServiceExposer; @ExtendWith(MockitoExtension.class) @@ -35,7 +35,7 @@ void setUp() throws SQLException { @Test void testSQlException() throws SQLException { when(this.localServiceExposer.exposeLocalServiceToDatabase(anyInt())) - .thenReturn(new ServiceAddress("my-host", 1234)); + .thenReturn(new InetSocketAddress("my-host", 1234)); when(this.statement.executeUpdate(anyString())).thenThrow(new SQLException("mock exception")); final IllegalStateException exception = assertThrows(IllegalStateException.class, () -> new UdfLogsModule(this.localServiceExposer, this.connection)); @@ -45,7 +45,7 @@ void testSQlException() throws SQLException { @Test void testSqlInjection() { when(this.localServiceExposer.exposeLocalServiceToDatabase(anyInt())) - .thenReturn(new ServiceAddress("my-ho' + 'st", 1234)); + .thenReturn(new InetSocketAddress("my-ho' + 'st", 1234)); final IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> new UdfLogsModule(this.localServiceExposer, this.connection)); assertThat(exception.getMessage(), From 42a5440d4ff59636fcd3bf374f3061d50c10d621 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=A4r?= Date: Tue, 22 Nov 2022 13:33:21 +0100 Subject: [PATCH 20/37] #43: Update on top of 0.6.4 (#44) Co-authored-by: KK --- .gitattributes | 9 + ...ase_droid_upload_github_release_assets.yml | 6 +- .vscode/settings.json | 17 ++ dependencies.md | 167 +++++++++--------- doc/changes/changelog.md | 1 + doc/changes/changes_0.6.5.md | 47 +++++ pk_generated_parent.pom | 56 +++--- pom.xml | 106 +++-------- 8 files changed, 216 insertions(+), 193 deletions(-) create mode 100644 .gitattributes create mode 100644 .vscode/settings.json create mode 100644 doc/changes/changes_0.6.5.md diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..b93bb8d --- /dev/null +++ b/.gitattributes @@ -0,0 +1,9 @@ +dependencies.md linguist-generated=true +doc/changes/changelog.md linguist-generated=true +pk_generated_parent.pom linguist-generated=true +.github/workflows/broken_links_checker.yml linguist-generated=true +.github/workflows/ci-build-next-java.yml linguist-generated=true +.github/workflows/dependencies_check.yml linguist-generated=true +.github/workflows/release_droid_prepare_original_checksum.yml linguist-generated=true +.github/workflows/release_droid_print_quick_checksum.yml linguist-generated=true +.github/workflows/release_droid_release_on_maven_central.yml linguist-generated=true diff --git a/.github/workflows/release_droid_upload_github_release_assets.yml b/.github/workflows/release_droid_upload_github_release_assets.yml index 1fd0b60..7350faf 100644 --- a/.github/workflows/release_droid_upload_github_release_assets.yml +++ b/.github/workflows/release_droid_upload_github_release_assets.yml @@ -24,7 +24,9 @@ jobs: - name: Build with Maven skipping tests run: mvn --batch-mode clean verify -DskipTests - name: Generate sha256sum files - run: find target -maxdepth 1 -name *.jar -exec bash -c 'sha256sum {} > {}.sha256' \; + run: | + cd target + find . -maxdepth 1 -name \*.jar -exec bash -c 'sha256sum {} > {}.sha256' \; - name: Upload assets to the GitHub release draft uses: shogo82148/actions-upload-release-asset@v1 with: @@ -39,4 +41,4 @@ jobs: uses: shogo82148/actions-upload-release-asset@v1 with: upload_url: ${{ github.event.inputs.upload_url }} - asset_path: target/error_code_report.json \ No newline at end of file + asset_path: target/error_code_report.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..f938933 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,17 @@ +{ + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.organizeImports": true, + "source.generate.finalModifiers": true, + "source.fixAll": true + }, + "java.codeGeneration.useBlocks": true, + "java.saveActions.organizeImports": true, + "java.sources.organizeImports.starThreshold": 3, + "java.sources.organizeImports.staticStarThreshold": 3, + "java.test.config": { + "vmArgs": [ + "-Djava.util.logging.config.file=src/test/resources/logging.properties" + ] + } +} diff --git a/dependencies.md b/dependencies.md index 2f1dedd..d222285 100644 --- a/dependencies.md +++ b/dependencies.md @@ -6,9 +6,9 @@ | Dependency | License | | --------------------------------------- | ------------------------------------------------------------------------------------------------------------ | | [Jakarta JSON Processing API][0] | [Eclipse Public License 2.0][1]; [GNU General Public License, version 2 with the GNU Classpath Exception][2] | -| [error-reporting-java][3] | [MIT][4] | +| [error-reporting-java][3] | [MIT License][4] | | [JaCoCo :: Core][5] | [Eclipse Public License 2.0][6] | -| [BucketFS Java][7] | [MIT][4] | +| [BucketFS Java][7] | [MIT License][8] | | [exasol-test-setup-abstraction-java][9] | [MIT License][10] | | [Apache Commons Compress][11] | [Apache License, Version 2.0][12] | | [SLF4J API Module][13] | [MIT License][14] | @@ -18,14 +18,14 @@ | Dependency | License | | ----------------------------------------------- | --------------------------------- | | [JaCoCo :: Agent][5] | [Eclipse Public License 2.0][6] | -| [JUnit Jupiter Engine][17] | [Eclipse Public License v2.0][18] | -| [JUnit Jupiter Params][17] | [Eclipse Public License v2.0][18] | -| [mockito-junit-jupiter][21] | [The MIT License][22] | -| [Hamcrest All][23] | [New BSD License][24] | -| [Test containers for Exasol on Docker][25] | [MIT][4] | -| [Testcontainers :: JUnit Jupiter Extension][27] | [MIT][28] | -| [Test Database Builder for Java][29] | [MIT License][30] | -| [JUnit5 System Extensions][31] | [Eclipse Public License v2.0][32] | +| [JUnit Jupiter Engine][15] | [Eclipse Public License v2.0][16] | +| [JUnit Jupiter Params][15] | [Eclipse Public License v2.0][16] | +| [mockito-junit-jupiter][17] | [The MIT License][18] | +| [Hamcrest All][19] | [New BSD License][20] | +| [Test containers for Exasol on Docker][21] | [MIT License][22] | +| [Testcontainers :: JUnit Jupiter Extension][23] | [MIT][24] | +| [Test Database Builder for Java][25] | [MIT License][26] | +| [JUnit5 System Extensions][27] | [Eclipse Public License v2.0][28] | ## Runtime Dependencies @@ -37,81 +37,84 @@ | Dependency | License | | ------------------------------------------------------- | ---------------------------------------------- | -| [SonarQube Scanner for Maven][36] | [GNU LGPL 3][37] | -| [Apache Maven Compiler Plugin][38] | [Apache License, Version 2.0][12] | -| [Apache Maven Enforcer Plugin][40] | [Apache License, Version 2.0][12] | -| [Maven Flatten Plugin][42] | [Apache Software Licenese][43] | -| [org.sonatype.ossindex.maven:ossindex-maven-plugin][44] | [ASL2][43] | -| [Reproducible Build Maven Plugin][46] | [Apache 2.0][43] | -| [Maven Dependency Plugin][48] | [The Apache Software License, Version 2.0][43] | -| [Project keeper maven plugin][50] | [The MIT License][51] | -| [Maven Surefire Plugin][52] | [Apache License, Version 2.0][12] | -| [Versions Maven Plugin][54] | [Apache License, Version 2.0][12] | -| [Apache Maven Deploy Plugin][56] | [Apache License, Version 2.0][12] | -| [Apache Maven GPG Plugin][58] | [Apache License, Version 2.0][12] | -| [Apache Maven Source Plugin][60] | [Apache License, Version 2.0][12] | -| [Apache Maven Javadoc Plugin][62] | [Apache License, Version 2.0][12] | -| [Nexus Staging Maven Plugin][64] | [Eclipse Public License][65] | -| [Maven Failsafe Plugin][66] | [Apache License, Version 2.0][12] | -| [JaCoCo :: Maven Plugin][68] | [Eclipse Public License 2.0][6] | -| [error-code-crawler-maven-plugin][70] | [MIT][4] | -| [Maven Clean Plugin][72] | [The Apache Software License, Version 2.0][43] | -| [Maven Resources Plugin][74] | [The Apache Software License, Version 2.0][43] | -| [Maven JAR Plugin][76] | [The Apache Software License, Version 2.0][43] | -| [Maven Install Plugin][78] | [The Apache Software License, Version 2.0][43] | -| [Maven Site Plugin 3][80] | [The Apache Software License, Version 2.0][43] | +| [SonarQube Scanner for Maven][29] | [GNU LGPL 3][30] | +| [Apache Maven Compiler Plugin][31] | [Apache License, Version 2.0][12] | +| [Apache Maven Enforcer Plugin][32] | [Apache License, Version 2.0][12] | +| [Maven Flatten Plugin][33] | [Apache Software Licenese][12] | +| [Maven Dependency Plugin][34] | [The Apache Software License, Version 2.0][35] | +| [Project keeper maven plugin][36] | [The MIT License][37] | +| [org.sonatype.ossindex.maven:ossindex-maven-plugin][38] | [ASL2][35] | +| [Maven Surefire Plugin][39] | [Apache License, Version 2.0][12] | +| [Versions Maven Plugin][40] | [Apache License, Version 2.0][12] | +| [Apache Maven Deploy Plugin][41] | [Apache License, Version 2.0][12] | +| [Apache Maven GPG Plugin][42] | [Apache License, Version 2.0][12] | +| [Apache Maven Source Plugin][43] | [Apache License, Version 2.0][12] | +| [Apache Maven Javadoc Plugin][44] | [Apache License, Version 2.0][12] | +| [Nexus Staging Maven Plugin][45] | [Eclipse Public License][46] | +| [Maven Failsafe Plugin][47] | [Apache License, Version 2.0][12] | +| [JaCoCo :: Maven Plugin][48] | [Eclipse Public License 2.0][6] | +| [error-code-crawler-maven-plugin][49] | [MIT License][50] | +| [Reproducible Build Maven Plugin][51] | [Apache 2.0][35] | +| [Maven Clean Plugin][52] | [The Apache Software License, Version 2.0][35] | +| [Maven Resources Plugin][53] | [The Apache Software License, Version 2.0][35] | +| [Maven JAR Plugin][54] | [The Apache Software License, Version 2.0][35] | +| [Maven Install Plugin][55] | [The Apache Software License, Version 2.0][35] | +| [Maven Site Plugin 3][56] | [The Apache Software License, Version 2.0][35] | +[0]: https://github.com/eclipse-ee4j/jsonp +[1]: https://projects.eclipse.org/license/epl-2.0 +[2]: https://projects.eclipse.org/license/secondary-gpl-2.0-cp +[3]: https://github.com/exasol/error-reporting-java/ +[4]: https://github.com/exasol/error-reporting-java/blob/main/LICENSE [5]: https://www.eclemma.org/jacoco/index.html -[7]: https://github.com/exasol/bucketfs-java -[3]: https://github.com/exasol/error-reporting-java -[32]: http://www.eclipse.org/legal/epl-v20.html -[23]: https://github.com/hamcrest/JavaHamcrest -[43]: http://www.apache.org/licenses/LICENSE-2.0.txt -[52]: https://maven.apache.org/surefire/maven-surefire-plugin/ -[72]: http://maven.apache.org/plugins/maven-clean-plugin/ -[4]: https://opensource.org/licenses/MIT -[21]: https://github.com/mockito/mockito -[42]: https://www.mojohaus.org/flatten-maven-plugin/ -[11]: https://commons.apache.org/proper/commons-compress/ -[50]: https://github.com/exasol/project-keeper/ -[54]: http://www.mojohaus.org/versions-maven-plugin/ -[38]: https://maven.apache.org/plugins/maven-compiler-plugin/ -[30]: https://github.com/exasol/test-db-builder-java/blob/main/LICENSE [6]: https://www.eclipse.org/legal/epl-2.0/ +[7]: https://github.com/exasol/bucketfs-java/ +[8]: https://github.com/exasol/bucketfs-java/blob/main/LICENSE [9]: https://github.com/exasol/exasol-test-setup-abstraction-java/ -[56]: https://maven.apache.org/plugins/maven-deploy-plugin/ -[37]: http://www.gnu.org/licenses/lgpl.txt -[68]: https://www.jacoco.org/jacoco/trunk/doc/maven.html -[22]: https://github.com/mockito/mockito/blob/main/LICENSE -[46]: http://zlika.github.io/reproducible-build-maven-plugin [10]: https://github.com/exasol/exasol-test-setup-abstraction-java/blob/main/LICENSE -[14]: http://www.opensource.org/licenses/mit-license.php -[36]: http://sonarsource.github.io/sonar-scanner-maven/ -[17]: https://junit.org/junit5/ -[0]: https://github.com/eclipse-ee4j/jsonp -[60]: https://maven.apache.org/plugins/maven-source-plugin/ -[2]: https://projects.eclipse.org/license/secondary-gpl-2.0-cp -[13]: http://www.slf4j.org -[74]: http://maven.apache.org/plugins/maven-resources-plugin/ -[29]: https://github.com/exasol/test-db-builder-java/ -[64]: http://www.sonatype.com/public-parent/nexus-maven-plugins/nexus-staging/nexus-staging-maven-plugin/ -[66]: https://maven.apache.org/surefire/maven-failsafe-plugin/ -[48]: http://maven.apache.org/plugins/maven-dependency-plugin/ -[28]: http://opensource.org/licenses/MIT -[65]: http://www.eclipse.org/legal/epl-v10.html -[25]: https://github.com/exasol/exasol-testcontainers -[51]: https://github.com/exasol/project-keeper/blob/main/LICENSE -[76]: http://maven.apache.org/plugins/maven-jar-plugin/ -[1]: https://projects.eclipse.org/license/epl-2.0 +[11]: https://commons.apache.org/proper/commons-compress/ [12]: https://www.apache.org/licenses/LICENSE-2.0.txt -[40]: https://maven.apache.org/enforcer/maven-enforcer-plugin/ -[18]: https://www.eclipse.org/legal/epl-v20.html -[24]: http://www.opensource.org/licenses/bsd-license.php -[78]: http://maven.apache.org/plugins/maven-install-plugin/ -[44]: https://sonatype.github.io/ossindex-maven/maven-plugin/ -[58]: https://maven.apache.org/plugins/maven-gpg-plugin/ -[27]: https://testcontainers.org -[31]: https://github.com/itsallcode/junit5-system-extensions -[80]: http://maven.apache.org/plugins/maven-site-plugin/ -[62]: https://maven.apache.org/plugins/maven-javadoc-plugin/ -[70]: https://github.com/exasol/error-code-crawler-maven-plugin +[13]: http://www.slf4j.org +[14]: http://www.opensource.org/licenses/mit-license.php +[15]: https://junit.org/junit5/ +[16]: https://www.eclipse.org/legal/epl-v20.html +[17]: https://github.com/mockito/mockito +[18]: https://github.com/mockito/mockito/blob/main/LICENSE +[19]: https://github.com/hamcrest/JavaHamcrest +[20]: http://www.opensource.org/licenses/bsd-license.php +[21]: https://github.com/exasol/exasol-testcontainers/ +[22]: https://github.com/exasol/exasol-testcontainers/blob/main/LICENSE +[23]: https://testcontainers.org +[24]: http://opensource.org/licenses/MIT +[25]: https://github.com/exasol/test-db-builder-java/ +[26]: https://github.com/exasol/test-db-builder-java/blob/main/LICENSE +[27]: https://github.com/itsallcode/junit5-system-extensions +[28]: http://www.eclipse.org/legal/epl-v20.html +[29]: http://sonarsource.github.io/sonar-scanner-maven/ +[30]: http://www.gnu.org/licenses/lgpl.txt +[31]: https://maven.apache.org/plugins/maven-compiler-plugin/ +[32]: https://maven.apache.org/enforcer/maven-enforcer-plugin/ +[33]: https://www.mojohaus.org/flatten-maven-plugin/ +[34]: http://maven.apache.org/plugins/maven-dependency-plugin/ +[35]: http://www.apache.org/licenses/LICENSE-2.0.txt +[36]: https://github.com/exasol/project-keeper/ +[37]: https://github.com/exasol/project-keeper/blob/main/LICENSE +[38]: https://sonatype.github.io/ossindex-maven/maven-plugin/ +[39]: https://maven.apache.org/surefire/maven-surefire-plugin/ +[40]: https://www.mojohaus.org/versions-maven-plugin/ +[41]: https://maven.apache.org/plugins/maven-deploy-plugin/ +[42]: https://maven.apache.org/plugins/maven-gpg-plugin/ +[43]: https://maven.apache.org/plugins/maven-source-plugin/ +[44]: https://maven.apache.org/plugins/maven-javadoc-plugin/ +[45]: http://www.sonatype.com/public-parent/nexus-maven-plugins/nexus-staging/nexus-staging-maven-plugin/ +[46]: http://www.eclipse.org/legal/epl-v10.html +[47]: https://maven.apache.org/surefire/maven-failsafe-plugin/ +[48]: https://www.jacoco.org/jacoco/trunk/doc/maven.html +[49]: https://github.com/exasol/error-code-crawler-maven-plugin/ +[50]: https://github.com/exasol/error-code-crawler-maven-plugin/blob/main/LICENSE +[51]: http://zlika.github.io/reproducible-build-maven-plugin +[52]: http://maven.apache.org/plugins/maven-clean-plugin/ +[53]: http://maven.apache.org/plugins/maven-resources-plugin/ +[54]: http://maven.apache.org/plugins/maven-jar-plugin/ +[55]: http://maven.apache.org/plugins/maven-install-plugin/ +[56]: http://maven.apache.org/plugins/maven-site-plugin/ diff --git a/doc/changes/changelog.md b/doc/changes/changelog.md index 24f9537..61459de 100644 --- a/doc/changes/changelog.md +++ b/doc/changes/changelog.md @@ -1,5 +1,6 @@ # Changes +* [0.6.5](changes_0.6.5.md) * [0.6.4](changes_0.6.4.md) * [0.6.3](changes_0.6.3.md) * [0.6.2](changes_0.6.2.md) diff --git a/doc/changes/changes_0.6.5.md b/doc/changes/changes_0.6.5.md new file mode 100644 index 0000000..4b22577 --- /dev/null +++ b/doc/changes/changes_0.6.5.md @@ -0,0 +1,47 @@ +# udf-debugging-java 0.6.5, released 2022-11-22 + +Code name: Updated dependencies on top of 0.6.4 + +## Summary + +In this release we fixed a version collision between the BucketFS library used in this project and `exasol-test-setup-abstraction-java` that led to a class-not-found error in certain combinations. + +## Known Issues + +This project depends on an Amazon AWS SDK which in turn depends on the Netty HTTP server version 4.1.77. This versions has a vulnerability in certificate validation that can allow to man-in-the-middle attacks. Unfortunately, no update of the AWS SDK is available at the time of this release. + +## Bugfixes + +* #43: Fixed BucketFS library version collisions + +## Dependency Updates + +### Compile Dependency Updates + +* Updated `com.exasol:bucketfs-java:2.3.0` to `2.4.1` +* Updated `com.exasol:error-reporting-java:0.4.1` to `1.0.0` +* Updated `jakarta.json:jakarta.json-api:2.1.0` to `2.1.1` +* Updated `org.apache.commons:commons-compress:1.21` to `1.22` +* Updated `org.slf4j:slf4j-api:1.7.36` to `2.0.4` + +### Test Dependency Updates + +* Updated `com.exasol:exasol-testcontainers:6.1.2` to `6.3.1` +* Updated `com.exasol:test-db-builder-java:3.3.3` to `3.4.1` +* Updated `org.junit.jupiter:junit-jupiter-engine:5.8.2` to `5.9.1` +* Updated `org.junit.jupiter:junit-jupiter-params:5.8.2` to `5.9.1` +* Updated `org.mockito:mockito-junit-jupiter:4.6.1` to `4.9.0` +* Updated `org.testcontainers:junit-jupiter:1.17.2` to `1.17.6` + +### Plugin Dependency Updates + +* Updated `com.exasol:error-code-crawler-maven-plugin:1.1.1` to `1.2.1` +* Updated `com.exasol:project-keeper-maven-plugin:2.4.6` to `2.9.1` +* Updated `io.github.zlika:reproducible-build-maven-plugin:0.15` to `0.16` +* Updated `org.apache.maven.plugins:maven-deploy-plugin:3.0.0-M2` to `3.0.0` +* Updated `org.apache.maven.plugins:maven-enforcer-plugin:3.0.0` to `3.1.0` +* Updated `org.apache.maven.plugins:maven-failsafe-plugin:3.0.0-M4` to `3.0.0-M7` +* Updated `org.apache.maven.plugins:maven-javadoc-plugin:3.4.0` to `3.4.1` +* Updated `org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M4` to `3.0.0-M7` +* Updated `org.codehaus.mojo:flatten-maven-plugin:1.2.7` to `1.3.0` +* Updated `org.codehaus.mojo:versions-maven-plugin:2.10.0` to `2.13.0` diff --git a/pk_generated_parent.pom b/pk_generated_parent.pom index 6dd9e11..daaec1c 100644 --- a/pk_generated_parent.pom +++ b/pk_generated_parent.pom @@ -3,7 +3,7 @@ 4.0.0 com.exasol udf-debugging-java-generated-parent - 0.6.4 + 0.6.5 pom UTF-8 @@ -12,6 +12,16 @@ true + + + ossrh + https://oss.sonatype.org/content/repositories/snapshots + + + ossrh + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + MIT License @@ -52,7 +62,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.0.0 + 3.1.0 enforce-maven @@ -72,7 +82,7 @@ org.codehaus.mojo flatten-maven-plugin - 1.2.7 + 1.3.0 true oss @@ -108,24 +118,10 @@ - - io.github.zlika - reproducible-build-maven-plugin - 0.15 - - - strip-jar - package - - strip-jar - - - - org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M5 + 3.0.0-M7 @@ -136,7 +132,7 @@ org.codehaus.mojo versions-maven-plugin - 2.10.0 + 2.13.0 display-updates @@ -154,7 +150,7 @@ org.apache.maven.plugins maven-deploy-plugin - 3.0.0-M1 + 3.0.0 true @@ -195,7 +191,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.4.0 + 3.4.1 attach-javadocs @@ -234,7 +230,7 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.0.0-M5 + 3.0.0-M7 @@ -296,7 +292,7 @@ com.exasol error-code-crawler-maven-plugin - 1.1.1 + 1.2.1 verify @@ -306,6 +302,20 @@ + + io.github.zlika + reproducible-build-maven-plugin + 0.16 + + + strip-jar + package + + strip-jar + + + + diff --git a/pom.xml b/pom.xml index e659f29..3765317 100644 --- a/pom.xml +++ b/pom.xml @@ -1,15 +1,13 @@ - + 4.0.0 - com.exasol udf-debugging-java - 0.6.4 + 0.6.5 udf-debugging-java Utilities for debugging, profiling and code coverage measure for UDFs. https://github.com/exasol/udf-debugging-java/ - 5.8.2 + 5.9.1 11.0.0 0.8.8 3.0.0-M4 @@ -48,7 +46,7 @@ jakarta.json jakarta.json-api - 2.1.0 + 2.1.1 org.glassfish @@ -59,7 +57,7 @@ com.exasol error-reporting-java - 0.4.1 + 1.0.0 org.jacoco @@ -76,25 +74,26 @@ com.exasol bucketfs-java - 2.3.0 + 2.4.1 com.exasol exasol-test-setup-abstraction-java - 0.3.2 - + 1.0.0 + provided org.apache.commons commons-compress - 1.21 + 1.22 org.slf4j slf4j-api - 1.7.36 + 2.0.4 @@ -112,7 +111,7 @@ org.mockito mockito-junit-jupiter - 4.6.1 + 4.9.0 test @@ -125,19 +124,19 @@ com.exasol exasol-testcontainers - 6.1.2 + 6.3.1 test org.testcontainers junit-jupiter - 1.17.2 + 1.17.6 test com.exasol test-db-builder-java - 3.3.3 + 3.4.1 test @@ -170,7 +169,7 @@ com.exasol project-keeper-maven-plugin - 2.4.6 + 2.9.1 @@ -179,51 +178,11 @@ - - org.apache.maven.plugins - maven-surefire-plugin - ${surefire.and.failsafe.plugin.version} - - - org.apache.maven.plugins - maven-failsafe-plugin - ${surefire.and.failsafe.plugin.version} - - - org.jacoco - jacoco-maven-plugin - ${jacoco.version} - - - org.apache.maven.plugins - maven-compiler-plugin - 3.10.1 - - - org.codehaus.mojo - versions-maven-plugin - 2.10.0 - - - org.apache.maven.plugins - maven-source-plugin - 3.2.1 - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.4.0 - - - org.apache.maven.plugins - maven-gpg-plugin - 3.0.1 - org.sonatype.ossindex.maven ossindex-maven-plugin - 3.2.0 - @@ -231,37 +190,12 @@ - - org.apache.maven.plugins - maven-enforcer-plugin - 3.0.0 - - - org.apache.maven.plugins - maven-deploy-plugin - 3.0.0-M2 - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.13 - - - com.exasol - error-code-crawler-maven-plugin - 1.1.1 - - - io.github.zlika - reproducible-build-maven-plugin - 0.15 -
udf-debugging-java-generated-parent com.exasol - 0.6.4 + 0.6.5 pk_generated_parent.pom From e9f2cc16703fe6a053534c89c492133523435825 Mon Sep 17 00:00:00 2001 From: Christoph Kuhnke Date: Tue, 22 Nov 2022 15:16:00 +0100 Subject: [PATCH 21/37] Doc/42 jacoco failure windows (#45) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * #42: Documented known issue of JaCoCo failing on Windows. Co-authored-by: Sebastian Bär --- .gitignore | 4 +++- .settings/org.eclipse.core.resources.prefs | 5 +++++ .settings/org.eclipse.m2e.core.prefs | 4 ++++ README.md | 20 ++++++++++++++++++- doc/changes/changelog.md | 1 + doc/changes/changes_0.6.5.md | 4 ++-- doc/changes/changes_0.6.6.md | 12 +++++++++++ pk_generated_parent.pom | 2 +- pom.xml | 4 ++-- .../modules/coverage/JacocoServer.java | 3 +++ 10 files changed, 52 insertions(+), 7 deletions(-) create mode 100644 .settings/org.eclipse.core.resources.prefs create mode 100644 .settings/org.eclipse.m2e.core.prefs create mode 100644 doc/changes/changes_0.6.6.md diff --git a/.gitignore b/.gitignore index 131ad3b..88ee192 100644 --- a/.gitignore +++ b/.gitignore @@ -31,4 +31,6 @@ venv/ *.orig *.old *.md.html -*.flattened-pom.xml \ No newline at end of file +*.flattened-pom.xml +/.apt_generated/ +/.apt_generated_tests/ diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..cdfe4f1 --- /dev/null +++ b/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,5 @@ +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/test/java=UTF-8 +encoding//src/test/resources=UTF-8 +encoding/=UTF-8 diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..f897a7f --- /dev/null +++ b/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/README.md b/README.md index 50779b5..ba0ad23 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,9 @@ System property: `test.coverage` This module installs a jacoco agent to the UDF JVM and receives the execution data using a TCP socket. -This module requires additional maven configuration. Use the [project-keeper's](https://github.com/exasol/project-keeper-maven-plugin) `udf_coverage` module to verify it. +This module requires additional maven configuration. Use [project-keeper](https://github.com/exasol/project-keeper-maven-plugin) module `udf_coverage` to verify it. + +Please note that using a [JaCoCo agent](https://www.jacoco.org/jacoco/trunk/doc/agent.html) fails when running on Windows using a [Docker image](https://docs.docker.com/glossary/#container-image) in a Linux virtual machine, see known issue [Failing Integration Tests on Windows](#known-issue:-failing-integration-tests-on-windows). ### JProfiler @@ -85,6 +87,22 @@ You can find the logs in `target/udf-logs/`. For each incoming stream (UDF insta Created log file for UDF output: target/udf-logs/udf-log-16150321841745991713.txt ``` +## Known Issue: Failing Integration Tests on Windows + +Please note that integration tests fail when running on Windows using a Docker image in a Linux virtual machine due to JaCoCo agent obtaining the [Code Coverage](#code-coverage) in the UDF. + +Steps to reproduce + +* Use a virtual schema, e.g. https://github.com/exasol/mysql-virtual-schema +* with Maven command `mvn clean verify -Dtest=MySQLSqlDialectIT` + +Known workarounds + +* Either run integration tests from the Eclipse IDE +* or remove `.withJvmOptions(udfTestSetup.getJvmOptions())` from `ExasolObjectConfiguration.builder()` +* or run tests with JVM option `-Dtest.coverage="false"` +* or run integration tests inside the VM. + ## Additional Information * [Changelog](doc/changes/changelog.md) diff --git a/doc/changes/changelog.md b/doc/changes/changelog.md index 61459de..8872a21 100644 --- a/doc/changes/changelog.md +++ b/doc/changes/changelog.md @@ -1,5 +1,6 @@ # Changes +* [0.6.6](changes_0.6.6.md) * [0.6.5](changes_0.6.5.md) * [0.6.4](changes_0.6.4.md) * [0.6.3](changes_0.6.3.md) diff --git a/doc/changes/changes_0.6.5.md b/doc/changes/changes_0.6.5.md index 4b22577..7a03839 100644 --- a/doc/changes/changes_0.6.5.md +++ b/doc/changes/changes_0.6.5.md @@ -11,8 +11,8 @@ In this release we fixed a version collision between the BucketFS library used i This project depends on an Amazon AWS SDK which in turn depends on the Netty HTTP server version 4.1.77. This versions has a vulnerability in certificate validation that can allow to man-in-the-middle attacks. Unfortunately, no update of the AWS SDK is available at the time of this release. ## Bugfixes - -* #43: Fixed BucketFS library version collisions + +* #43: Fixed BucketFS library version collisions. ## Dependency Updates diff --git a/doc/changes/changes_0.6.6.md b/doc/changes/changes_0.6.6.md new file mode 100644 index 0000000..48640aa --- /dev/null +++ b/doc/changes/changes_0.6.6.md @@ -0,0 +1,12 @@ +# Udf Debugging Java 0.6.6, released 2022-??-?? + +Code name: Documentation update + +## Summary + +Updated documentation. + +## Features + +* #42: Documented known issue of JaCoCo failing on Windows. + diff --git a/pk_generated_parent.pom b/pk_generated_parent.pom index daaec1c..f851b3b 100644 --- a/pk_generated_parent.pom +++ b/pk_generated_parent.pom @@ -3,7 +3,7 @@ 4.0.0 com.exasol udf-debugging-java-generated-parent - 0.6.5 + 0.6.6 pom UTF-8 diff --git a/pom.xml b/pom.xml index 3765317..f669c12 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 udf-debugging-java - 0.6.5 + 0.6.6 udf-debugging-java Utilities for debugging, profiling and code coverage measure for UDFs. https://github.com/exasol/udf-debugging-java/ @@ -195,7 +195,7 @@ udf-debugging-java-generated-parent com.exasol - 0.6.5 + 0.6.6 pk_generated_parent.pom diff --git a/src/main/java/com/exasol/udfdebugging/modules/coverage/JacocoServer.java b/src/main/java/com/exasol/udfdebugging/modules/coverage/JacocoServer.java index f80f868..46a1b81 100644 --- a/src/main/java/com/exasol/udfdebugging/modules/coverage/JacocoServer.java +++ b/src/main/java/com/exasol/udfdebugging/modules/coverage/JacocoServer.java @@ -91,6 +91,7 @@ private static class Handler implements Runnable, ISessionInfoVisitor, IExecutio this.reader.setExecutionDataVisitor(this); } + @Override public void run() { try { while (this.reader.read()) { @@ -107,12 +108,14 @@ public void run() { } } + @Override public void visitSessionInfo(final SessionInfo info) { synchronized (this.fileWriter) { this.fileWriter.visitSessionInfo(info); } } + @Override public void visitClassExecution(final ExecutionData data) { synchronized (this.fileWriter) { this.fileWriter.visitClassExecution(data); From b8c2de78d5786a4d10fa348488f0f8f6d0ce2016 Mon Sep 17 00:00:00 2001 From: Christoph Kuhnke Date: Thu, 22 Dec 2022 10:02:08 +0100 Subject: [PATCH 22/37] Updated dependencies (#47) --- doc/changes/changelog.md | 1 + doc/changes/changes_0.6.7.md | 23 +++++++++++++++++++++++ pk_generated_parent.pom | 2 +- pom.xml | 19 +++++++++---------- release_config.yml | 1 + 5 files changed, 35 insertions(+), 11 deletions(-) create mode 100644 doc/changes/changes_0.6.7.md diff --git a/doc/changes/changelog.md b/doc/changes/changelog.md index 8872a21..1676ebf 100644 --- a/doc/changes/changelog.md +++ b/doc/changes/changelog.md @@ -1,5 +1,6 @@ # Changes +* [0.6.7](changes_0.6.7.md) * [0.6.6](changes_0.6.6.md) * [0.6.5](changes_0.6.5.md) * [0.6.4](changes_0.6.4.md) diff --git a/doc/changes/changes_0.6.7.md b/doc/changes/changes_0.6.7.md new file mode 100644 index 0000000..cf971c7 --- /dev/null +++ b/doc/changes/changes_0.6.7.md @@ -0,0 +1,23 @@ +# Udf Debugging Java 0.6.7, released 2022-12-22 + +Code name: Dependency Upgrade + +## Summary + +Updated dependencies after breaking changes in interface of bucketfs-java to re-enable compatibility with newer versions of bucketfs-java used by other libraries, e.g. exasol-testcontainers. + +## Changes + +* #46: Updated dependencies + +## Dependency Updates + +### Compile Dependency Updates + +* Updated `com.exasol:bucketfs-java:2.4.1` to `2.6.0` +* Updated `org.slf4j:slf4j-api:2.0.4` to `2.0.6` + +### Test Dependency Updates + +* Updated `com.exasol:exasol-testcontainers:6.3.1` to `6.4.1` +* Updated `org.mockito:mockito-junit-jupiter:4.9.0` to `4.10.0` diff --git a/pk_generated_parent.pom b/pk_generated_parent.pom index f851b3b..37b33db 100644 --- a/pk_generated_parent.pom +++ b/pk_generated_parent.pom @@ -3,7 +3,7 @@ 4.0.0 com.exasol udf-debugging-java-generated-parent - 0.6.6 + 0.6.7 pom UTF-8 diff --git a/pom.xml b/pom.xml index f669c12..e203443 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 udf-debugging-java - 0.6.6 + 0.6.7 udf-debugging-java Utilities for debugging, profiling and code coverage measure for UDFs. https://github.com/exasol/udf-debugging-java/ @@ -74,12 +74,12 @@ com.exasol bucketfs-java - 2.4.1 + 2.6.0 com.exasol exasol-test-setup-abstraction-java - 1.0.0 + 1.1.1 @@ -93,7 +93,7 @@ org.slf4j slf4j-api - 2.0.4 + 2.0.6 @@ -111,7 +111,7 @@ org.mockito mockito-junit-jupiter - 4.9.0 + 4.10.0 test @@ -124,7 +124,7 @@ com.exasol exasol-testcontainers - 6.3.1 + 6.4.1 test @@ -181,9 +181,8 @@ org.sonatype.ossindex.maven ossindex-maven-plugin - + sonatype-2020-0026 @@ -195,7 +194,7 @@ udf-debugging-java-generated-parent com.exasol - 0.6.6 + 0.6.7 pk_generated_parent.pom diff --git a/release_config.yml b/release_config.yml index 44dac34..473c219 100644 --- a/release_config.yml +++ b/release_config.yml @@ -1,3 +1,4 @@ release-platforms: - GitHub - Maven +language: Java From 7530c4502364f4e6d87adb0bc6ed109e1fa12b85 Mon Sep 17 00:00:00 2001 From: Christoph Kuhnke Date: Thu, 22 Dec 2022 10:52:24 +0100 Subject: [PATCH 23/37] Release/0.6.6 (#48) * Updated dependencies --- doc/changes/changes_0.6.6.md | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/doc/changes/changes_0.6.6.md b/doc/changes/changes_0.6.6.md index 48640aa..5a3c1d1 100644 --- a/doc/changes/changes_0.6.6.md +++ b/doc/changes/changes_0.6.6.md @@ -1,12 +1,24 @@ -# Udf Debugging Java 0.6.6, released 2022-??-?? +# Udf Debugging Java 0.6.7, released 2022-12-22 -Code name: Documentation update +Code name: Dependency Upgrade ## Summary -Updated documentation. +Updated dependencies after breaking changes in interface of bucketfs-java to re-enable compatibility with newer versions of bucketfs-java used by other libraries, e.g. exasol-testcontainers. -## Features +## Changes +* #46: Updated dependencies * #42: Documented known issue of JaCoCo failing on Windows. +## Dependency Updates + +### Compile Dependency Updates + +* Updated `com.exasol:bucketfs-java:2.4.1` to `2.6.0` +* Updated `org.slf4j:slf4j-api:2.0.4` to `2.0.6` + +### Test Dependency Updates + +* Updated `com.exasol:exasol-testcontainers:6.3.1` to `6.4.1` +* Updated `org.mockito:mockito-junit-jupiter:4.9.0` to `4.10.0` From 011a652c126962fd402672b1c08ab089c6ee9a9c Mon Sep 17 00:00:00 2001 From: Christoph Kuhnke Date: Thu, 22 Dec 2022 11:12:33 +0100 Subject: [PATCH 24/37] reset version to 0.6.6 (#49) --- doc/changes/changelog.md | 1 - doc/changes/changes_0.6.7.md | 23 ----------------------- pk_generated_parent.pom | 2 +- pom.xml | 4 ++-- 4 files changed, 3 insertions(+), 27 deletions(-) delete mode 100644 doc/changes/changes_0.6.7.md diff --git a/doc/changes/changelog.md b/doc/changes/changelog.md index 1676ebf..8872a21 100644 --- a/doc/changes/changelog.md +++ b/doc/changes/changelog.md @@ -1,6 +1,5 @@ # Changes -* [0.6.7](changes_0.6.7.md) * [0.6.6](changes_0.6.6.md) * [0.6.5](changes_0.6.5.md) * [0.6.4](changes_0.6.4.md) diff --git a/doc/changes/changes_0.6.7.md b/doc/changes/changes_0.6.7.md deleted file mode 100644 index cf971c7..0000000 --- a/doc/changes/changes_0.6.7.md +++ /dev/null @@ -1,23 +0,0 @@ -# Udf Debugging Java 0.6.7, released 2022-12-22 - -Code name: Dependency Upgrade - -## Summary - -Updated dependencies after breaking changes in interface of bucketfs-java to re-enable compatibility with newer versions of bucketfs-java used by other libraries, e.g. exasol-testcontainers. - -## Changes - -* #46: Updated dependencies - -## Dependency Updates - -### Compile Dependency Updates - -* Updated `com.exasol:bucketfs-java:2.4.1` to `2.6.0` -* Updated `org.slf4j:slf4j-api:2.0.4` to `2.0.6` - -### Test Dependency Updates - -* Updated `com.exasol:exasol-testcontainers:6.3.1` to `6.4.1` -* Updated `org.mockito:mockito-junit-jupiter:4.9.0` to `4.10.0` diff --git a/pk_generated_parent.pom b/pk_generated_parent.pom index 37b33db..f851b3b 100644 --- a/pk_generated_parent.pom +++ b/pk_generated_parent.pom @@ -3,7 +3,7 @@ 4.0.0 com.exasol udf-debugging-java-generated-parent - 0.6.7 + 0.6.6 pom UTF-8 diff --git a/pom.xml b/pom.xml index e203443..e3db353 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 udf-debugging-java - 0.6.7 + 0.6.6 udf-debugging-java Utilities for debugging, profiling and code coverage measure for UDFs. https://github.com/exasol/udf-debugging-java/ @@ -194,7 +194,7 @@ udf-debugging-java-generated-parent com.exasol - 0.6.7 + 0.6.6 pk_generated_parent.pom From 3d0c2c5efe2107e6718b35941b3c804b17adede7 Mon Sep 17 00:00:00 2001 From: Christoph Kuhnke Date: Thu, 22 Dec 2022 11:26:19 +0100 Subject: [PATCH 25/37] fixed version number on changes file (#50) --- doc/changes/changes_0.6.6.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changes/changes_0.6.6.md b/doc/changes/changes_0.6.6.md index 5a3c1d1..8c4274a 100644 --- a/doc/changes/changes_0.6.6.md +++ b/doc/changes/changes_0.6.6.md @@ -1,4 +1,4 @@ -# Udf Debugging Java 0.6.7, released 2022-12-22 +# Udf Debugging Java 0.6.6, released 2022-12-22 Code name: Dependency Upgrade From 134032af15cc978fa2512deb03bd86710e2a3b61 Mon Sep 17 00:00:00 2001 From: Christoph Pirkl Date: Fri, 20 Jan 2023 08:16:08 +0100 Subject: [PATCH 26/37] #51 Upgrade dependencies (#52) --- .gitignore | 1 + .vscode/settings.json | 4 ++ doc/changes/changelog.md | 1 + doc/changes/changes_0.6.7.md | 21 +++++++ pk_generated_parent.pom | 2 +- pom.xml | 61 ++++++++----------- .../com/exasol/udfdebugging/UdfTestSetup.java | 3 +- .../exasol/udfdebugging/UdfTestSetupTest.java | 5 +- .../modules/coverage/CoverageModuleIT.java | 6 +- .../modules/udflogs/UdfLogsModuleIT.java | 1 + 10 files changed, 63 insertions(+), 42 deletions(-) create mode 100644 doc/changes/changes_0.6.7.md diff --git a/.gitignore b/.gitignore index 88ee192..cbd2afe 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ pom.xml.versionsBackup # Eclipse and Maven .classpath .project +/.settings/org.eclipse.jdt.apt.core.prefs # .settings : we need Eclipse settings for code formatter and clean-up rules target .cache diff --git a/.vscode/settings.json b/.vscode/settings.json index f938933..f1a4c2c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -13,5 +13,9 @@ "vmArgs": [ "-Djava.util.logging.config.file=src/test/resources/logging.properties" ] + }, + "sonarlint.connectedMode.project": { + "connectionId": "exasol", + "projectKey": "com.exasol:udf-debugging-java" } } diff --git a/doc/changes/changelog.md b/doc/changes/changelog.md index 8872a21..1676ebf 100644 --- a/doc/changes/changelog.md +++ b/doc/changes/changelog.md @@ -1,5 +1,6 @@ # Changes +* [0.6.7](changes_0.6.7.md) * [0.6.6](changes_0.6.6.md) * [0.6.5](changes_0.6.5.md) * [0.6.4](changes_0.6.4.md) diff --git a/doc/changes/changes_0.6.7.md b/doc/changes/changes_0.6.7.md new file mode 100644 index 0000000..68e5b2a --- /dev/null +++ b/doc/changes/changes_0.6.7.md @@ -0,0 +1,21 @@ +# Udf Debugging Java 0.6.7, released 2023-01-20 + +Code name: Upgrade dependencies on top of 0.6.6 + +## Summary + +This release upgrades dependencies incl. exasol-test-setup-abstraction-java 2.0.0 to adapt to the updated API. + +## Features + +* #51: Updated to exasol-test-setup-abstraction-java 2.0.0 + +## Dependency Updates + +### Test Dependency Updates + +* Updated `com.exasol:exasol-testcontainers:6.4.1` to `6.5.0` +* Updated `com.exasol:test-db-builder-java:3.4.1` to `3.4.2` +* Updated `org.junit.jupiter:junit-jupiter-engine:5.9.1` to `5.9.2` +* Updated `org.junit.jupiter:junit-jupiter-params:5.9.1` to `5.9.2` +* Updated `org.mockito:mockito-junit-jupiter:4.10.0` to `5.0.0` diff --git a/pk_generated_parent.pom b/pk_generated_parent.pom index f851b3b..37b33db 100644 --- a/pk_generated_parent.pom +++ b/pk_generated_parent.pom @@ -3,7 +3,7 @@ 4.0.0 com.exasol udf-debugging-java-generated-parent - 0.6.6 + 0.6.7 pom UTF-8 diff --git a/pom.xml b/pom.xml index e3db353..1b52eec 100644 --- a/pom.xml +++ b/pom.xml @@ -1,32 +1,18 @@ - + 4.0.0 udf-debugging-java - 0.6.6 + 0.6.7 udf-debugging-java Utilities for debugging, profiling and code coverage measure for UDFs. https://github.com/exasol/udf-debugging-java/ - 5.9.1 + 5.9.2 11.0.0 0.8.8 - 3.0.0-M4 - - - MIT - https://opensource.org/licenses/MIT - repo - - - - - Exasol - opensource@exasol.com - Exasol AG - https://www.exasol.com/ - - ossrh @@ -37,11 +23,6 @@ https://oss.sonatype.org/service/local/staging/deploy/maven2/ - - scm:git:https://github.com/exasol/udf-debugging-java.git - scm:git:https://github.com/exasol/udf-debugging-java.git - https://github.com/exasol/udf-debugging-java/tree/master - jakarta.json @@ -79,10 +60,13 @@ com.exasol exasol-test-setup-abstraction-java - 1.1.1 - + 2.0.0 + provided @@ -111,7 +95,7 @@ org.mockito mockito-junit-jupiter - 4.10.0 + 5.0.0 test @@ -124,7 +108,7 @@ com.exasol exasol-testcontainers - 6.4.1 + 6.5.0 test @@ -136,7 +120,7 @@ com.exasol test-db-builder-java - 3.4.1 + 3.4.2 test @@ -181,11 +165,20 @@ org.sonatype.ossindex.maven ossindex-maven-plugin - + sonatype-2020-0026 + + CVE-2020-36641 @@ -194,7 +187,7 @@ udf-debugging-java-generated-parent com.exasol - 0.6.6 + 0.6.7 pk_generated_parent.pom diff --git a/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java b/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java index 194b351..14aacd1 100644 --- a/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java +++ b/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java @@ -10,7 +10,6 @@ import com.exasol.bucketfs.Bucket; import com.exasol.exasoltestsetup.ExasolTestSetup; -import com.exasol.exasoltestsetup.ServiceAddress; import com.exasol.udfdebugging.modules.coverage.CoverageModuleFactory; import com.exasol.udfdebugging.modules.debugging.DebuggingModuleFactory; import com.exasol.udfdebugging.modules.jprofiler.JProfilerModuleFactory; @@ -59,7 +58,7 @@ private UdfTestSetup(final LocalServiceExposer localServiceExposer, final Bucket */ public UdfTestSetup(final ExasolTestSetup testSetup, final Connection exasolConnection) { this(port -> { - final ServiceAddress serviceAddress = testSetup.makeLocalTcpServiceAccessibleFromDatabase(port); + final InetSocketAddress serviceAddress = testSetup.makeLocalTcpServiceAccessibleFromDatabase(port); return new InetSocketAddress(serviceAddress.getHostName(), serviceAddress.getPort()); }, testSetup.getDefaultBucket(), exasolConnection); } diff --git a/src/test/java/com/exasol/udfdebugging/UdfTestSetupTest.java b/src/test/java/com/exasol/udfdebugging/UdfTestSetupTest.java index 02d7081..ff22f50 100644 --- a/src/test/java/com/exasol/udfdebugging/UdfTestSetupTest.java +++ b/src/test/java/com/exasol/udfdebugging/UdfTestSetupTest.java @@ -2,8 +2,10 @@ import static org.hamcrest.CoreMatchers.*; import static org.hamcrest.MatcherAssert.assertThat; +import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.Mockito.*; +import java.net.InetSocketAddress; import java.sql.*; import java.util.List; @@ -17,7 +19,6 @@ import com.exasol.bucketfs.Bucket; import com.exasol.exasoltestsetup.ExasolTestSetup; -import com.exasol.exasoltestsetup.ServiceAddress; @ExtendWith(MockitoExtension.class) @ExtendWith(SystemOutGuard.class) @@ -56,7 +57,7 @@ void testGetTestSetupForETAJ() { final Bucket bucket = mock(Bucket.class); when(testSetup.getDefaultBucket()).thenReturn(bucket); when(testSetup.makeLocalTcpServiceAccessibleFromDatabase(anyInt())) - .thenReturn(new ServiceAddress("4.3.2.1", 123)); + .thenReturn(new InetSocketAddress("4.3.2.1", 123)); try (final UdfTestSetup udfTestSetup = new UdfTestSetup(testSetup, this.connection)) { final List jvmOptions = List.of(udfTestSetup.getJvmOptions()); assertThat(jvmOptions, hasItem( diff --git a/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleIT.java b/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleIT.java index 9fd2698..d3233e6 100644 --- a/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleIT.java +++ b/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleIT.java @@ -18,9 +18,9 @@ class CoverageModuleIT { @Test void testCoverageReportIsWritten() throws SQLException, IOException { deleteExecutionFile(); - final TestSetup udfSetup = new TestSetup(); - try (final CoverageModule coverageModule = new CoverageModule(udfSetup.getHostPortProxy(), - udfSetup.getDefaultBucket())) { + try (final TestSetup udfSetup = new TestSetup(); + final CoverageModule coverageModule = new CoverageModule(udfSetup.getHostPortProxy(), + udfSetup.getDefaultBucket())) { udfSetup.runJavaUdf(coverageModule.getJvmOptions(), ""); assertThat(countReportedJacocoSessions(), equalTo(1)); } diff --git a/src/test/java/com/exasol/udfdebugging/modules/udflogs/UdfLogsModuleIT.java b/src/test/java/com/exasol/udfdebugging/modules/udflogs/UdfLogsModuleIT.java index 8b23977..4cb0cc4 100644 --- a/src/test/java/com/exasol/udfdebugging/modules/udflogs/UdfLogsModuleIT.java +++ b/src/test/java/com/exasol/udfdebugging/modules/udflogs/UdfLogsModuleIT.java @@ -13,6 +13,7 @@ class UdfLogsModuleIT { + // This will fail when the test does not run on Docker host, e.g. on Windows or macOS. @Test void testGetLog() throws SQLException, IOException { try (final TestSetup testSetup = new TestSetup(); From 54fdbe81d9734c12f1b990814278cb1d5e837293 Mon Sep 17 00:00:00 2001 From: Christoph Kuhnke Date: Tue, 7 Feb 2023 15:40:37 +0100 Subject: [PATCH 27/37] Implemented #53 (#54) * Implemented #53 --- .github/workflows/broken_links_checker.yml | 7 +++-- .github/workflows/ci-build-next-java.yml | 2 +- dependencies.md | 2 +- doc/changes/changelog.md | 1 + doc/changes/changes_0.6.8.md | 30 +++++++++++++++++++ pk_generated_parent.pom | 12 ++++---- pom.xml | 16 +++++----- .../udfdebugging/LocalServiceExposer.java | 12 +++++++- .../com/exasol/udfdebugging/UdfTestSetup.java | 14 ++++----- .../udfdebugging/modules/TestSetup.java | 3 +- 10 files changed, 69 insertions(+), 30 deletions(-) create mode 100644 doc/changes/changes_0.6.8.md diff --git a/.github/workflows/broken_links_checker.yml b/.github/workflows/broken_links_checker.yml index 29071df..c4ff3be 100644 --- a/.github/workflows/broken_links_checker.yml +++ b/.github/workflows/broken_links_checker.yml @@ -19,9 +19,12 @@ jobs: - name: Configure broken links checker run: | mkdir -p ./target - echo '{ "aliveStatusCodes": [429, 200], "ignorePatterns": [{"pattern": "^https?://(www.)?opensource.org"}] }' > ./target/broken_links_checker.json + echo '{"aliveStatusCodes": [429, 200], "ignorePatterns": [' \ + '{"pattern": "^https?://(www|dev).mysql.com/"},' \ + '{"pattern": "^https?://(www.)?opensource.org"}' \ + ']}' > ./target/broken_links_checker.json - uses: gaurav-nelson/github-action-markdown-link-check@v1 with: use-quiet-mode: 'yes' use-verbose-mode: 'yes' - config-file: ./target/broken_links_checker.json \ No newline at end of file + config-file: ./target/broken_links_checker.json diff --git a/.github/workflows/ci-build-next-java.yml b/.github/workflows/ci-build-next-java.yml index 6a1006c..e0c15cf 100644 --- a/.github/workflows/ci-build-next-java.yml +++ b/.github/workflows/ci-build-next-java.yml @@ -25,7 +25,7 @@ jobs: cache: 'maven' - name: Run tests and build with Maven run: | - mvn --batch-mode --update-snapshots clean package -DtrimStackTrace=false \ + mvn --batch-mode --update-snapshots clean package -DtrimStackTrace=false \ -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn - name: Publish Test Report uses: scacap/action-surefire-report@v1 diff --git a/dependencies.md b/dependencies.md index d222285..880f428 100644 --- a/dependencies.md +++ b/dependencies.md @@ -101,7 +101,7 @@ [37]: https://github.com/exasol/project-keeper/blob/main/LICENSE [38]: https://sonatype.github.io/ossindex-maven/maven-plugin/ [39]: https://maven.apache.org/surefire/maven-surefire-plugin/ -[40]: https://www.mojohaus.org/versions-maven-plugin/ +[40]: https://www.mojohaus.org/versions/versions-maven-plugin/ [41]: https://maven.apache.org/plugins/maven-deploy-plugin/ [42]: https://maven.apache.org/plugins/maven-gpg-plugin/ [43]: https://maven.apache.org/plugins/maven-source-plugin/ diff --git a/doc/changes/changelog.md b/doc/changes/changelog.md index 1676ebf..14bcd2c 100644 --- a/doc/changes/changelog.md +++ b/doc/changes/changelog.md @@ -1,5 +1,6 @@ # Changes +* [0.6.8](changes_0.6.8.md) * [0.6.7](changes_0.6.7.md) * [0.6.6](changes_0.6.6.md) * [0.6.5](changes_0.6.5.md) diff --git a/doc/changes/changes_0.6.8.md b/doc/changes/changes_0.6.8.md new file mode 100644 index 0000000..be89a6e --- /dev/null +++ b/doc/changes/changes_0.6.8.md @@ -0,0 +1,30 @@ +# Udf Debugging Java 0.6.8, released 2023-02-07 + +Code name: Improved LocalServiceExposer + +## Summary + +Enhanced interface `LocalServiceExposer` and simplified usage. + +## Features + +* #53: Enhanced interface `LocalServiceExposer` and simplified usage. + +## Dependency Updates + +### Compile Dependency Updates + +* Updated `com.exasol:bucketfs-java:2.6.0` to `3.0.0` + +### Test Dependency Updates + +* Updated `com.exasol:exasol-testcontainers:6.5.0` to `6.5.1` +* Updated `org.mockito:mockito-junit-jupiter:5.0.0` to `5.1.1` + +### Plugin Dependency Updates + +* Updated `com.exasol:error-code-crawler-maven-plugin:1.2.1` to `1.2.2` +* Updated `com.exasol:project-keeper-maven-plugin:2.9.1` to `2.9.3` +* Updated `org.apache.maven.plugins:maven-failsafe-plugin:3.0.0-M7` to `3.0.0-M8` +* Updated `org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M7` to `3.0.0-M8` +* Updated `org.codehaus.mojo:versions-maven-plugin:2.13.0` to `2.14.2` diff --git a/pk_generated_parent.pom b/pk_generated_parent.pom index 37b33db..39d60f1 100644 --- a/pk_generated_parent.pom +++ b/pk_generated_parent.pom @@ -3,7 +3,7 @@ 4.0.0 com.exasol udf-debugging-java-generated-parent - 0.6.7 + 0.6.8 pom UTF-8 @@ -121,7 +121,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M7 + 3.0.0-M8 @@ -132,7 +132,7 @@ org.codehaus.mojo versions-maven-plugin - 2.13.0 + 2.14.2 display-updates @@ -216,6 +216,8 @@ true ossrh https://oss.sonatype.org/ + 15 + 30 @@ -230,7 +232,7 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.0.0-M7 + 3.0.0-M8 @@ -292,7 +294,7 @@ com.exasol error-code-crawler-maven-plugin - 1.2.1 + 1.2.2 verify diff --git a/pom.xml b/pom.xml index 1b52eec..ef012c1 100644 --- a/pom.xml +++ b/pom.xml @@ -1,10 +1,8 @@ - + 4.0.0 udf-debugging-java - 0.6.7 + 0.6.8 udf-debugging-java Utilities for debugging, profiling and code coverage measure for UDFs. https://github.com/exasol/udf-debugging-java/ @@ -55,7 +53,7 @@ com.exasol bucketfs-java - 2.6.0 + 3.0.0 com.exasol @@ -95,7 +93,7 @@ org.mockito mockito-junit-jupiter - 5.0.0 + 5.1.1 test @@ -108,7 +106,7 @@ com.exasol exasol-testcontainers - 6.5.0 + 6.5.1 test @@ -153,7 +151,7 @@ com.exasol project-keeper-maven-plugin - 2.9.1 + 2.9.3 @@ -187,7 +185,7 @@ udf-debugging-java-generated-parent com.exasol - 0.6.7 + 0.6.8 pk_generated_parent.pom diff --git a/src/main/java/com/exasol/udfdebugging/LocalServiceExposer.java b/src/main/java/com/exasol/udfdebugging/LocalServiceExposer.java index 02f376b..205d3b8 100644 --- a/src/main/java/com/exasol/udfdebugging/LocalServiceExposer.java +++ b/src/main/java/com/exasol/udfdebugging/LocalServiceExposer.java @@ -8,9 +8,19 @@ @FunctionalInterface public interface LocalServiceExposer { + /** + * Create an instance of {@code LocalServiceExposer} for a host that does not require port mapping. + * + * @param host host name or IP address of host (but without port) providing the service to expose + * @return new instance of {@code LocalServiceExposer} + */ + public static LocalServiceExposer forHost(final String host) { + return port -> new InetSocketAddress(host, port); + } + /** * Get the address for the network scope inside of the Exasol database for a given local service. - * + * * @param port port number * @return proxy */ diff --git a/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java b/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java index 14aacd1..1946e9c 100644 --- a/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java +++ b/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java @@ -1,6 +1,5 @@ package com.exasol.udfdebugging; -import java.net.InetSocketAddress; import java.sql.Connection; import java.util.List; import java.util.stream.Collectors; @@ -32,12 +31,12 @@ public class UdfTestSetup implements AutoCloseable { * @param exasolConnection connection to the Exasol database. Make sure that your tests use the same connection */ public UdfTestSetup(final String testHostIpAddress, final Bucket bucket, final Connection exasolConnection) { - this(port -> new InetSocketAddress(testHostIpAddress, port), bucket, exasolConnection); + this(LocalServiceExposer.forHost(testHostIpAddress), bucket, exasolConnection); } /** * Create a new instance of {@link UdfTestSetup}. - * + * * @param localServiceExposer Proxy factory that makes ports of the test host available in the container * @param bucket BucketFS bucket to upload resource to * @param exasolConnection connection to the Exasol database. Make sure that your tests use the same connection @@ -52,20 +51,17 @@ private UdfTestSetup(final LocalServiceExposer localServiceExposer, final Bucket /** * Create a new instance of {@link UdfTestSetup}. - * + * * @param testSetup Exasol test setup * @param exasolConnection connection to the Exasol database. Make sure that your tests use the same connection */ public UdfTestSetup(final ExasolTestSetup testSetup, final Connection exasolConnection) { - this(port -> { - final InetSocketAddress serviceAddress = testSetup.makeLocalTcpServiceAccessibleFromDatabase(port); - return new InetSocketAddress(serviceAddress.getHostName(), serviceAddress.getPort()); - }, testSetup.getDefaultBucket(), exasolConnection); + this(testSetup::makeLocalTcpServiceAccessibleFromDatabase, testSetup.getDefaultBucket(), exasolConnection); } /** * Get JVM options required for this setup. - * + * * @return array of JVM options */ public String[] getJvmOptions() { diff --git a/src/test/java/com/exasol/udfdebugging/modules/TestSetup.java b/src/test/java/com/exasol/udfdebugging/modules/TestSetup.java index cacb62f..21b976b 100644 --- a/src/test/java/com/exasol/udfdebugging/modules/TestSetup.java +++ b/src/test/java/com/exasol/udfdebugging/modules/TestSetup.java @@ -1,7 +1,6 @@ package com.exasol.udfdebugging.modules; import java.io.Closeable; -import java.net.InetSocketAddress; import java.sql.*; import java.util.stream.Stream; @@ -27,7 +26,7 @@ public TestSetup() throws SQLException { } public LocalServiceExposer getHostPortProxy() { - return port -> new InetSocketAddress(this.exasol.getHostIp(), port); + return LocalServiceExposer.forHost(this.exasol.getHostIp()); } public Bucket getDefaultBucket() { From 826d95a25306eff7b795dce2097cd430770d7eb3 Mon Sep 17 00:00:00 2001 From: Christoph Pirkl Date: Mon, 3 Jul 2023 14:10:21 +0200 Subject: [PATCH 28/37] #57: Updated dependencies (#58) --- README.md | 2 +- dependencies.md | 116 ++++++++++++++++++----------------- doc/changes/changelog.md | 1 + doc/changes/changes_0.6.9.md | 53 ++++++++++++++++ pk_generated_parent.pom | 50 +++++++++++---- pom.xml | 56 ++++++++--------- 6 files changed, 180 insertions(+), 98 deletions(-) create mode 100644 doc/changes/changes_0.6.9.md diff --git a/README.md b/README.md index ba0ad23..8229587 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # UDF Debugging Tools for Java [![Build Status](https://github.com/exasol/udf-debugging-java/actions/workflows/ci-build.yml/badge.svg)](https://github.com/exasol/udf-debugging-java/actions/workflows/ci-build.yml) -[![Maven Central – udf-debugging-java](https://img.shields.io/maven-central/v/com.exasol/udf-debugging-java)](https://search.maven.org/artifact/com.exasol/udf-debugging-java) +[![Maven Central – udf-debugging-java](https://img.shields.io/maven-central/v/com.exasol/udf-debugging-java)](https://search.maven.org/artifact/com.exasol/udf-debugging-java) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Audf-debugging-java&metric=alert_status)](https://sonarcloud.io/dashboard?id=com.exasol%3Audf-debugging-java) diff --git a/dependencies.md b/dependencies.md index 880f428..3b9c4a4 100644 --- a/dependencies.md +++ b/dependencies.md @@ -10,8 +10,8 @@ | [JaCoCo :: Core][5] | [Eclipse Public License 2.0][6] | | [BucketFS Java][7] | [MIT License][8] | | [exasol-test-setup-abstraction-java][9] | [MIT License][10] | -| [Apache Commons Compress][11] | [Apache License, Version 2.0][12] | -| [SLF4J API Module][13] | [MIT License][14] | +| [Apache Commons Compress][11] | [Apache-2.0][12] | +| [SLF4J JDK14 Binding][13] | [MIT License][14] | ## Test Dependencies @@ -29,37 +29,38 @@ ## Runtime Dependencies -| Dependency | License | -| ---------------------------- | ------------------------------------------------------------------------------------------------------------ | -| [JSON-P Default Provider][0] | [Eclipse Public License 2.0][1]; [GNU General Public License, version 2 with the GNU Classpath Exception][2] | +| Dependency | License | +| --------------------- | ------------------------------------------------------------------------------------------------------------ | +| [Eclipse Parsson][29] | [Eclipse Public License 2.0][1]; [GNU General Public License, version 2 with the GNU Classpath Exception][2] | ## Plugin Dependencies | Dependency | License | | ------------------------------------------------------- | ---------------------------------------------- | -| [SonarQube Scanner for Maven][29] | [GNU LGPL 3][30] | -| [Apache Maven Compiler Plugin][31] | [Apache License, Version 2.0][12] | -| [Apache Maven Enforcer Plugin][32] | [Apache License, Version 2.0][12] | -| [Maven Flatten Plugin][33] | [Apache Software Licenese][12] | -| [Maven Dependency Plugin][34] | [The Apache Software License, Version 2.0][35] | -| [Project keeper maven plugin][36] | [The MIT License][37] | -| [org.sonatype.ossindex.maven:ossindex-maven-plugin][38] | [ASL2][35] | -| [Maven Surefire Plugin][39] | [Apache License, Version 2.0][12] | -| [Versions Maven Plugin][40] | [Apache License, Version 2.0][12] | -| [Apache Maven Deploy Plugin][41] | [Apache License, Version 2.0][12] | -| [Apache Maven GPG Plugin][42] | [Apache License, Version 2.0][12] | -| [Apache Maven Source Plugin][43] | [Apache License, Version 2.0][12] | -| [Apache Maven Javadoc Plugin][44] | [Apache License, Version 2.0][12] | -| [Nexus Staging Maven Plugin][45] | [Eclipse Public License][46] | -| [Maven Failsafe Plugin][47] | [Apache License, Version 2.0][12] | -| [JaCoCo :: Maven Plugin][48] | [Eclipse Public License 2.0][6] | -| [error-code-crawler-maven-plugin][49] | [MIT License][50] | -| [Reproducible Build Maven Plugin][51] | [Apache 2.0][35] | -| [Maven Clean Plugin][52] | [The Apache Software License, Version 2.0][35] | -| [Maven Resources Plugin][53] | [The Apache Software License, Version 2.0][35] | -| [Maven JAR Plugin][54] | [The Apache Software License, Version 2.0][35] | -| [Maven Install Plugin][55] | [The Apache Software License, Version 2.0][35] | -| [Maven Site Plugin 3][56] | [The Apache Software License, Version 2.0][35] | +| [SonarQube Scanner for Maven][30] | [GNU LGPL 3][31] | +| [Apache Maven Compiler Plugin][32] | [Apache-2.0][12] | +| [Apache Maven Enforcer Plugin][33] | [Apache-2.0][12] | +| [Maven Flatten Plugin][34] | [Apache Software Licenese][12] | +| [Maven Dependency Plugin][35] | [The Apache Software License, Version 2.0][36] | +| [Project keeper maven plugin][37] | [The MIT License][38] | +| [org.sonatype.ossindex.maven:ossindex-maven-plugin][39] | [ASL2][36] | +| [Maven Surefire Plugin][40] | [Apache-2.0][12] | +| [Versions Maven Plugin][41] | [Apache License, Version 2.0][12] | +| [duplicate-finder-maven-plugin Maven Mojo][42] | [Apache License 2.0][43] | +| [Apache Maven Deploy Plugin][44] | [Apache-2.0][12] | +| [Apache Maven GPG Plugin][45] | [Apache License, Version 2.0][12] | +| [Apache Maven Source Plugin][46] | [Apache License, Version 2.0][12] | +| [Apache Maven Javadoc Plugin][47] | [Apache-2.0][12] | +| [Nexus Staging Maven Plugin][48] | [Eclipse Public License][49] | +| [Maven Failsafe Plugin][50] | [Apache-2.0][12] | +| [JaCoCo :: Maven Plugin][51] | [Eclipse Public License 2.0][6] | +| [error-code-crawler-maven-plugin][52] | [MIT License][53] | +| [Reproducible Build Maven Plugin][54] | [Apache 2.0][36] | +| [Maven Clean Plugin][55] | [The Apache Software License, Version 2.0][36] | +| [Maven Resources Plugin][56] | [The Apache Software License, Version 2.0][36] | +| [Maven JAR Plugin][57] | [The Apache Software License, Version 2.0][36] | +| [Maven Install Plugin][58] | [The Apache Software License, Version 2.0][36] | +| [Maven Site Plugin 3][59] | [The Apache Software License, Version 2.0][36] | [0]: https://github.com/eclipse-ee4j/jsonp [1]: https://projects.eclipse.org/license/epl-2.0 @@ -90,31 +91,34 @@ [26]: https://github.com/exasol/test-db-builder-java/blob/main/LICENSE [27]: https://github.com/itsallcode/junit5-system-extensions [28]: http://www.eclipse.org/legal/epl-v20.html -[29]: http://sonarsource.github.io/sonar-scanner-maven/ -[30]: http://www.gnu.org/licenses/lgpl.txt -[31]: https://maven.apache.org/plugins/maven-compiler-plugin/ -[32]: https://maven.apache.org/enforcer/maven-enforcer-plugin/ -[33]: https://www.mojohaus.org/flatten-maven-plugin/ -[34]: http://maven.apache.org/plugins/maven-dependency-plugin/ -[35]: http://www.apache.org/licenses/LICENSE-2.0.txt -[36]: https://github.com/exasol/project-keeper/ -[37]: https://github.com/exasol/project-keeper/blob/main/LICENSE -[38]: https://sonatype.github.io/ossindex-maven/maven-plugin/ -[39]: https://maven.apache.org/surefire/maven-surefire-plugin/ -[40]: https://www.mojohaus.org/versions/versions-maven-plugin/ -[41]: https://maven.apache.org/plugins/maven-deploy-plugin/ -[42]: https://maven.apache.org/plugins/maven-gpg-plugin/ -[43]: https://maven.apache.org/plugins/maven-source-plugin/ -[44]: https://maven.apache.org/plugins/maven-javadoc-plugin/ -[45]: http://www.sonatype.com/public-parent/nexus-maven-plugins/nexus-staging/nexus-staging-maven-plugin/ -[46]: http://www.eclipse.org/legal/epl-v10.html -[47]: https://maven.apache.org/surefire/maven-failsafe-plugin/ -[48]: https://www.jacoco.org/jacoco/trunk/doc/maven.html -[49]: https://github.com/exasol/error-code-crawler-maven-plugin/ -[50]: https://github.com/exasol/error-code-crawler-maven-plugin/blob/main/LICENSE -[51]: http://zlika.github.io/reproducible-build-maven-plugin -[52]: http://maven.apache.org/plugins/maven-clean-plugin/ -[53]: http://maven.apache.org/plugins/maven-resources-plugin/ -[54]: http://maven.apache.org/plugins/maven-jar-plugin/ -[55]: http://maven.apache.org/plugins/maven-install-plugin/ -[56]: http://maven.apache.org/plugins/maven-site-plugin/ +[29]: https://github.com/eclipse-ee4j/parsson +[30]: http://sonarsource.github.io/sonar-scanner-maven/ +[31]: http://www.gnu.org/licenses/lgpl.txt +[32]: https://maven.apache.org/plugins/maven-compiler-plugin/ +[33]: https://maven.apache.org/enforcer/maven-enforcer-plugin/ +[34]: https://www.mojohaus.org/flatten-maven-plugin/ +[35]: http://maven.apache.org/plugins/maven-dependency-plugin/ +[36]: http://www.apache.org/licenses/LICENSE-2.0.txt +[37]: https://github.com/exasol/project-keeper/ +[38]: https://github.com/exasol/project-keeper/blob/main/LICENSE +[39]: https://sonatype.github.io/ossindex-maven/maven-plugin/ +[40]: https://maven.apache.org/surefire/maven-surefire-plugin/ +[41]: https://www.mojohaus.org/versions/versions-maven-plugin/ +[42]: https://github.com/basepom/duplicate-finder-maven-plugin +[43]: http://www.apache.org/licenses/LICENSE-2.0.html +[44]: https://maven.apache.org/plugins/maven-deploy-plugin/ +[45]: https://maven.apache.org/plugins/maven-gpg-plugin/ +[46]: https://maven.apache.org/plugins/maven-source-plugin/ +[47]: https://maven.apache.org/plugins/maven-javadoc-plugin/ +[48]: http://www.sonatype.com/public-parent/nexus-maven-plugins/nexus-staging/nexus-staging-maven-plugin/ +[49]: http://www.eclipse.org/legal/epl-v10.html +[50]: https://maven.apache.org/surefire/maven-failsafe-plugin/ +[51]: https://www.jacoco.org/jacoco/trunk/doc/maven.html +[52]: https://github.com/exasol/error-code-crawler-maven-plugin/ +[53]: https://github.com/exasol/error-code-crawler-maven-plugin/blob/main/LICENSE +[54]: http://zlika.github.io/reproducible-build-maven-plugin +[55]: http://maven.apache.org/plugins/maven-clean-plugin/ +[56]: http://maven.apache.org/plugins/maven-resources-plugin/ +[57]: http://maven.apache.org/plugins/maven-jar-plugin/ +[58]: http://maven.apache.org/plugins/maven-install-plugin/ +[59]: http://maven.apache.org/plugins/maven-site-plugin/ diff --git a/doc/changes/changelog.md b/doc/changes/changelog.md index 14bcd2c..4796e0d 100644 --- a/doc/changes/changelog.md +++ b/doc/changes/changelog.md @@ -1,5 +1,6 @@ # Changes +* [0.6.9](changes_0.6.9.md) * [0.6.8](changes_0.6.8.md) * [0.6.7](changes_0.6.7.md) * [0.6.6](changes_0.6.6.md) diff --git a/doc/changes/changes_0.6.9.md b/doc/changes/changes_0.6.9.md new file mode 100644 index 0000000..850d3d9 --- /dev/null +++ b/doc/changes/changes_0.6.9.md @@ -0,0 +1,53 @@ +# Udf Debugging Java 0.6.9, released 2023-07-03 + +Code name: Upgrade dependencies on top of 0.6.8 + +## Summary + +This release fixes the following vulnerability in `provided` dependency `io.netty:netty-handler`: +* CVE-2023-34462, severity CWE-770: Allocation of Resources Without Limits or Throttling (6.5) + +## Security + +* #57: Upgraded dependencies + +## Dependency Updates + +### Compile Dependency Updates + +* Updated `com.exasol:bucketfs-java:3.0.0` to `3.1.0` +* Updated `com.exasol:error-reporting-java:1.0.0` to `1.0.1` +* Updated `jakarta.json:jakarta.json-api:2.1.1` to `2.1.2` +* Updated `org.apache.commons:commons-compress:1.22` to `1.23.0` +* Updated `org.jacoco:org.jacoco.core:0.8.8` to `0.8.10` +* Removed `org.slf4j:slf4j-api:2.0.6` +* Added `org.slf4j:slf4j-jdk14:2.0.7` + +### Runtime Dependency Updates + +* Added `org.eclipse.parsson:parsson:1.1.2` +* Removed `org.glassfish:jakarta.json:2.0.1` + +### Test Dependency Updates + +* Updated `com.exasol:exasol-testcontainers:6.5.1` to `6.6.0` +* Updated `org.jacoco:org.jacoco.agent:0.8.8` to `0.8.10` +* Updated `org.junit.jupiter:junit-jupiter-engine:5.9.2` to `5.9.3` +* Updated `org.junit.jupiter:junit-jupiter-params:5.9.2` to `5.9.3` +* Updated `org.mockito:mockito-junit-jupiter:5.1.1` to `5.4.0` +* Updated `org.testcontainers:junit-jupiter:1.17.6` to `1.18.3` + +### Plugin Dependency Updates + +* Updated `com.exasol:error-code-crawler-maven-plugin:1.2.2` to `1.2.3` +* Updated `com.exasol:project-keeper-maven-plugin:2.9.3` to `2.9.7` +* Updated `org.apache.maven.plugins:maven-compiler-plugin:3.10.1` to `3.11.0` +* Updated `org.apache.maven.plugins:maven-deploy-plugin:3.0.0` to `3.1.1` +* Updated `org.apache.maven.plugins:maven-enforcer-plugin:3.1.0` to `3.3.0` +* Updated `org.apache.maven.plugins:maven-failsafe-plugin:3.0.0-M8` to `3.0.0` +* Updated `org.apache.maven.plugins:maven-javadoc-plugin:3.4.1` to `3.5.0` +* Updated `org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M8` to `3.0.0` +* Added `org.basepom.maven:duplicate-finder-maven-plugin:1.5.1` +* Updated `org.codehaus.mojo:flatten-maven-plugin:1.3.0` to `1.4.1` +* Updated `org.codehaus.mojo:versions-maven-plugin:2.14.2` to `2.15.0` +* Updated `org.jacoco:jacoco-maven-plugin:0.8.8` to `0.8.9` diff --git a/pk_generated_parent.pom b/pk_generated_parent.pom index 39d60f1..3b5cb6c 100644 --- a/pk_generated_parent.pom +++ b/pk_generated_parent.pom @@ -3,7 +3,7 @@ 4.0.0 com.exasol udf-debugging-java-generated-parent - 0.6.8 + 0.6.9 pom UTF-8 @@ -53,7 +53,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.10.1 + 3.11.0 ${java.version} ${java.version} @@ -62,7 +62,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.1.0 + 3.3.0 enforce-maven @@ -72,7 +72,7 @@ - 3.6.3 + [3.8.7,3.9.0) @@ -82,7 +82,7 @@ org.codehaus.mojo flatten-maven-plugin - 1.3.0 + 1.4.1 true oss @@ -121,7 +121,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M8 + 3.0.0 @@ -132,7 +132,7 @@ org.codehaus.mojo versions-maven-plugin - 2.14.2 + 2.15.0 display-updates @@ -147,10 +147,36 @@ file:///${project.basedir}/versionsMavenPluginRules.xml + + org.basepom.maven + duplicate-finder-maven-plugin + 1.5.1 + + + default + verify + + check + + + + + true + true + true + true + true + true + false + true + true + false + + org.apache.maven.plugins maven-deploy-plugin - 3.0.0 + 3.1.1 true @@ -191,7 +217,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.4.1 + 3.5.0 attach-javadocs @@ -232,7 +258,7 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.0.0-M8 + 3.0.0 @@ -253,7 +279,7 @@ org.jacoco jacoco-maven-plugin - 0.8.8 + 0.8.9 prepare-agent @@ -294,7 +320,7 @@ com.exasol error-code-crawler-maven-plugin - 1.2.2 + 1.2.3 verify diff --git a/pom.xml b/pom.xml index ef012c1..ceb1ad2 100644 --- a/pom.xml +++ b/pom.xml @@ -1,15 +1,16 @@ - + 4.0.0 udf-debugging-java - 0.6.8 + 0.6.9 udf-debugging-java Utilities for debugging, profiling and code coverage measure for UDFs. https://github.com/exasol/udf-debugging-java/ - 5.9.2 - 11.0.0 - 0.8.8 + 5.9.3 + 0.8.10 @@ -25,18 +26,18 @@ jakarta.json jakarta.json-api - 2.1.1 + 2.1.2 - org.glassfish - jakarta.json - 2.0.1 + org.eclipse.parsson + parsson + 1.1.2 runtime com.exasol error-reporting-java - 1.0.0 + 1.0.1 org.jacoco @@ -53,12 +54,12 @@ com.exasol bucketfs-java - 3.0.0 + 3.1.0 com.exasol exasol-test-setup-abstraction-java - 2.0.0 + 2.0.2 @@ -93,7 +89,7 @@ org.mockito mockito-junit-jupiter - 5.1.1 + 5.4.0 test @@ -102,17 +98,18 @@ 1.3 test - + com.exasol exasol-testcontainers - 6.5.1 + 6.6.0 test org.testcontainers junit-jupiter - 1.17.6 + 1.18.3 test @@ -127,6 +124,12 @@ 1.2.0 test + + + org.slf4j + slf4j-jdk14 + 2.0.7 + @@ -151,7 +154,7 @@ com.exasol project-keeper-maven-plugin - 2.9.3 + 2.9.7 @@ -165,11 +168,6 @@ ossindex-maven-plugin - - sonatype-2020-0026 + com.exasol exasol-testcontainers @@ -183,7 +172,7 @@ udf-debugging-java-generated-parent com.exasol - 0.6.9 + 0.6.10 pk_generated_parent.pom diff --git a/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java b/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java index 1946e9c..9332b07 100644 --- a/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java +++ b/src/main/java/com/exasol/udfdebugging/UdfTestSetup.java @@ -2,11 +2,9 @@ import java.sql.Connection; import java.util.List; +import java.util.logging.Logger; import java.util.stream.Collectors; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import com.exasol.bucketfs.Bucket; import com.exasol.exasoltestsetup.ExasolTestSetup; import com.exasol.udfdebugging.modules.coverage.CoverageModuleFactory; @@ -20,7 +18,7 @@ public class UdfTestSetup implements AutoCloseable { private static final List AVAILABLE_MODULES = List.of(new DebuggingModuleFactory(), new CoverageModuleFactory(), new JProfilerModuleFactory(), new UdfLogsModuleFactory()); - private static final Logger LOGGER = LoggerFactory.getLogger(UdfTestSetup.class); + private static final Logger LOGGER = Logger.getLogger(UdfTestSetup.class.getName()); private final List enabledModules; /** @@ -69,15 +67,13 @@ public String[] getJvmOptions() { } private void printInfoMessage() { - if (LOGGER.isInfoEnabled()) { - LOGGER.info(getInfoMessage()); - } + LOGGER.info(this::getInfoMessage); } private String getInfoMessage() { - return AVAILABLE_MODULES.stream() + return "UDF debug config: " + AVAILABLE_MODULES.stream() .map(module -> module.getModulePropertyName() + ": " + (module.isEnabled() ? "✓" : "✗")) - .collect(Collectors.joining("; ")) + "\n"; + .collect(Collectors.joining("; ")); } @Override From f2e04a52e5f06a995558896346208ad2885c96ef Mon Sep 17 00:00:00 2001 From: Christoph Pirkl Date: Wed, 5 Jul 2023 17:04:44 +0200 Subject: [PATCH 30/37] #56 Use readable debug log files (#60) --- README.md | 2 +- doc/changes/changes_0.6.10.md | 8 ++++++-- .../exasol/udfdebugging/modules/udflogs/LogRecorder.java | 4 +++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8229587..1c88953 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ This module redirects the STDOUT from UDFs to files on the test host. You can find the logs in `target/udf-logs/`. For each incoming stream (UDF instance) this module creates one file and logs its name: ``` -Created log file for UDF output: target/udf-logs/udf-log-16150321841745991713.txt +Created log file for UDF output: target/udf-logs/udf-log-2023-07-05T10:49:09.316547Z-576983159368731727.log ``` ## Known Issue: Failing Integration Tests on Windows diff --git a/doc/changes/changes_0.6.10.md b/doc/changes/changes_0.6.10.md index a586b23..69b6b16 100644 --- a/doc/changes/changes_0.6.10.md +++ b/doc/changes/changes_0.6.10.md @@ -1,10 +1,14 @@ -# Udf Debugging Java 0.6.10, released 2023-??-?? +# Udf Debugging Java 0.6.10, released 2023-07-05 Code name: Reduce dependencies ## Summary -This release replaces code that causes an unnecessary dependency on slf4j-api. +This release uses readable and sortable names for UDF debug log files written to `target/udf-logs/`. The release also replaces code that causes an unnecessary dependency on `slf4j-api`. + +## Features + +* #56: Used readable and sortable names for UDF debug log files. ## Refactoring diff --git a/src/main/java/com/exasol/udfdebugging/modules/udflogs/LogRecorder.java b/src/main/java/com/exasol/udfdebugging/modules/udflogs/LogRecorder.java index 06548fa..d7d0363 100644 --- a/src/main/java/com/exasol/udfdebugging/modules/udflogs/LogRecorder.java +++ b/src/main/java/com/exasol/udfdebugging/modules/udflogs/LogRecorder.java @@ -4,6 +4,7 @@ import java.net.ServerSocket; import java.net.Socket; import java.nio.file.*; +import java.time.Instant; import java.util.function.Consumer; import com.exasol.errorreporting.ExaError; @@ -94,7 +95,8 @@ private Logger(final Socket socket, final Consumer logFileHandler) { @Override public void run() { try { - final Path logFile = Files.createTempFile(LOG_DIRECTORY, "udf-log-", ".txt"); + final Path logFile = Files.createTempFile(LOG_DIRECTORY, "udf-log-" + Instant.now().toString() + "-", + ".log"); this.logFileHandler.accept(logFile); Files.copy(this.socket.getInputStream(), logFile, StandardCopyOption.REPLACE_EXISTING); } catch (final IOException exception) { From 3665f1aad73776f4e03b2eb8c5bc20c70d703768 Mon Sep 17 00:00:00 2001 From: Christoph Pirkl Date: Tue, 26 Sep 2023 09:26:50 +0200 Subject: [PATCH 31/37] #61: Fix CVE-2023-42503 in `org.apache.commons:commons-compress` (#62) --- .gitattributes | 5 +- .github/workflows/broken_links_checker.yml | 8 ++-- .github/workflows/ci-build-next-java.yml | 6 +-- .github/workflows/ci-build.yml | 26 ++++++---- .github/workflows/dependencies_check.yml | 8 ++-- ...elease_droid_prepare_original_checksum.yml | 14 ++++-- .../release_droid_print_quick_checksum.yml | 7 ++- ...release_droid_release_on_maven_central.yml | 8 ++-- ...ase_droid_upload_github_release_assets.yml | 8 ++-- .gitignore | 2 + .project-keeper.yml | 5 +- .settings/org.eclipse.core.resources.prefs | 5 -- .settings/org.eclipse.jdt.core.prefs | 2 +- .settings/org.eclipse.m2e.core.prefs | 4 -- dependencies.md | 8 ++-- doc/changes/changelog.md | 1 + doc/changes/changes_0.6.11.md | 46 ++++++++++++++++++ pk_generated_parent.pom | 24 +++++----- pom.xml | 47 +++++++++---------- 19 files changed, 145 insertions(+), 89 deletions(-) delete mode 100644 .settings/org.eclipse.core.resources.prefs delete mode 100644 .settings/org.eclipse.m2e.core.prefs create mode 100644 doc/changes/changes_0.6.11.md diff --git a/.gitattributes b/.gitattributes index b93bb8d..9064858 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4,6 +4,9 @@ pk_generated_parent.pom linguist-genera .github/workflows/broken_links_checker.yml linguist-generated=true .github/workflows/ci-build-next-java.yml linguist-generated=true .github/workflows/dependencies_check.yml linguist-generated=true -.github/workflows/release_droid_prepare_original_checksum.yml linguist-generated=true .github/workflows/release_droid_print_quick_checksum.yml linguist-generated=true .github/workflows/release_droid_release_on_maven_central.yml linguist-generated=true +.github/workflows/release_droid_upload_github_release_assets.yml linguist-generated=true + +.settings/org.eclipse.jdt.core.prefs linguist-generated=true +.settings/org.eclipse.jdt.ui.prefs linguist-generated=true diff --git a/.github/workflows/broken_links_checker.yml b/.github/workflows/broken_links_checker.yml index c4ff3be..82ec1cd 100644 --- a/.github/workflows/broken_links_checker.yml +++ b/.github/workflows/broken_links_checker.yml @@ -15,16 +15,18 @@ jobs: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Configure broken links checker run: | mkdir -p ./target echo '{"aliveStatusCodes": [429, 200], "ignorePatterns": [' \ '{"pattern": "^https?://(www|dev).mysql.com/"},' \ '{"pattern": "^https?://(www.)?opensource.org"}' \ + '{"pattern": "^https?://(www.)?eclipse.org"}' \ + '{"pattern": "^https?://projects.eclipse.org"}' \ ']}' > ./target/broken_links_checker.json - uses: gaurav-nelson/github-action-markdown-link-check@v1 with: - use-quiet-mode: 'yes' - use-verbose-mode: 'yes' + use-quiet-mode: "yes" + use-verbose-mode: "yes" config-file: ./target/broken_links_checker.json diff --git a/.github/workflows/ci-build-next-java.yml b/.github/workflows/ci-build-next-java.yml index e0c15cf..7cbab08 100644 --- a/.github/workflows/ci-build-next-java.yml +++ b/.github/workflows/ci-build-next-java.yml @@ -14,15 +14,15 @@ jobs: cancel-in-progress: true steps: - name: Checkout the repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up JDK 17 uses: actions/setup-java@v3 with: - distribution: 'temurin' + distribution: "temurin" java-version: 17 - cache: 'maven' + cache: "maven" - name: Run tests and build with Maven run: | mvn --batch-mode --update-snapshots clean package -DtrimStackTrace=false \ diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index e520870..4d3ebab 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -8,21 +8,27 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 # UDFs fail with "VM error: Internal error: VM crashed" on ubuntu-latest concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true steps: + - name: Free Disk Space + run: | + sudo rm -rf /usr/local/lib/android + sudo rm -rf /usr/share/dotnet - name: Checkout the repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up JDK 11 + - name: Set up JDK 11 & 17 uses: actions/setup-java@v3 with: - distribution: 'temurin' - java-version: 11 - cache: 'maven' + distribution: "temurin" + java-version: | + 17 + 11 + cache: "maven" - name: Cache SonarCloud packages uses: actions/cache@v3 with: @@ -33,7 +39,7 @@ jobs: run: echo 'testcontainers.reuse.enable=true' > "$HOME/.testcontainers.properties" - name: Run tests and build with Maven run: | - mvn --batch-mode clean verify \ + JAVA_HOME=$JAVA_HOME_11_X64 mvn --batch-mode clean verify \ -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ -DtrimStackTrace=false - name: Publish Test Report @@ -44,12 +50,12 @@ jobs: - name: Sonar analysis if: ${{ env.SONAR_TOKEN != null }} run: | - mvn --batch-mode org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \ + JAVA_HOME=$JAVA_HOME_17_X64 mvn --batch-mode org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \ -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ -DtrimStackTrace=false \ -Dsonar.organization=exasol \ -Dsonar.host.url=https://sonarcloud.io \ - -Dsonar.login=$SONAR_TOKEN + -Dsonar.token=$SONAR_TOKEN env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} \ No newline at end of file + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.github/workflows/dependencies_check.yml b/.github/workflows/dependencies_check.yml index b2ab231..3059964 100644 --- a/.github/workflows/dependencies_check.yml +++ b/.github/workflows/dependencies_check.yml @@ -9,12 +9,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up JDK 11 uses: actions/setup-java@v3 with: - distribution: 'temurin' + distribution: "temurin" java-version: 11 - cache: 'maven' + cache: "maven" - name: Checking dependencies for vulnerabilities - run: mvn --batch-mode org.sonatype.ossindex.maven:ossindex-maven-plugin:audit -f pom.xml \ No newline at end of file + run: mvn --batch-mode org.sonatype.ossindex.maven:ossindex-maven-plugin:audit -f pom.xml diff --git a/.github/workflows/release_droid_prepare_original_checksum.yml b/.github/workflows/release_droid_prepare_original_checksum.yml index 4a980f8..843604c 100644 --- a/.github/workflows/release_droid_prepare_original_checksum.yml +++ b/.github/workflows/release_droid_prepare_original_checksum.yml @@ -5,18 +5,22 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 # UDFs fail with "VM error: Internal error: VM crashed" on ubuntu-latest steps: + - name: Free Disk Space + run: | + sudo rm -rf /usr/local/lib/android + sudo rm -rf /usr/share/dotnet - name: Checkout the repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up JDK 11 uses: actions/setup-java@v3 with: - distribution: 'temurin' + distribution: "temurin" java-version: 11 - cache: 'maven' + cache: "maven" - name: Enable testcontainer reuse run: echo 'testcontainers.reuse.enable=true' > "$HOME/.testcontainers.properties" - name: Run tests and build with Maven @@ -28,4 +32,4 @@ jobs: with: name: original_checksum retention-days: 5 - path: original_checksum \ No newline at end of file + path: original_checksum diff --git a/.github/workflows/release_droid_print_quick_checksum.yml b/.github/workflows/release_droid_print_quick_checksum.yml index 8add957..aed4444 100644 --- a/.github/workflows/release_droid_print_quick_checksum.yml +++ b/.github/workflows/release_droid_print_quick_checksum.yml @@ -8,17 +8,16 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout the repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up JDK 11 uses: actions/setup-java@v3 with: - distribution: 'temurin' + distribution: "temurin" java-version: 11 - cache: 'maven' + cache: "maven" - name: Build with Maven skipping tests run: mvn --batch-mode clean verify -DskipTests - name: Print checksum run: echo 'checksum_start==';find target -maxdepth 1 -name *.jar -exec sha256sum "{}" + | xargs;echo '==checksum_end' - diff --git a/.github/workflows/release_droid_release_on_maven_central.yml b/.github/workflows/release_droid_release_on_maven_central.yml index b467607..dfdbd6a 100644 --- a/.github/workflows/release_droid_release_on_maven_central.yml +++ b/.github/workflows/release_droid_release_on_maven_central.yml @@ -8,15 +8,15 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout the repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Maven Central Repository uses: actions/setup-java@v3 with: - distribution: 'temurin' + distribution: "temurin" java-version: 11 - cache: 'maven' + cache: "maven" server-id: ossrh server-username: MAVEN_USERNAME server-password: MAVEN_PASSWORD @@ -27,4 +27,4 @@ jobs: env: MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} - MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} \ No newline at end of file + MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} diff --git a/.github/workflows/release_droid_upload_github_release_assets.yml b/.github/workflows/release_droid_upload_github_release_assets.yml index 7350faf..7ae8bbb 100644 --- a/.github/workflows/release_droid_upload_github_release_assets.yml +++ b/.github/workflows/release_droid_upload_github_release_assets.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: upload_url: - description: 'Assets upload URL' + description: "Assets upload URL" required: true jobs: @@ -12,15 +12,15 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout the repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up JDK 11 uses: actions/setup-java@v3 with: - distribution: 'temurin' + distribution: "temurin" java-version: 11 - cache: 'maven' + cache: "maven" - name: Build with Maven skipping tests run: mvn --batch-mode clean verify -DskipTests - name: Generate sha256sum files diff --git a/.gitignore b/.gitignore index cbd2afe..ea71e1a 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,8 @@ pom.xml.versionsBackup .classpath .project /.settings/org.eclipse.jdt.apt.core.prefs +/.settings/org.eclipse.core.resources.prefs +/.settings/org.eclipse.m2e.core.prefs # .settings : we need Eclipse settings for code formatter and clean-up rules target .cache diff --git a/.project-keeper.yml b/.project-keeper.yml index 28d3438..c6aee8f 100644 --- a/.project-keeper.yml +++ b/.project-keeper.yml @@ -5,4 +5,7 @@ sources: - maven_central - integration_tests linkReplacements: - - "https://github.com/hamcrest/JavaHamcrest/hamcrest-all|https://github.com/hamcrest/JavaHamcrest" \ No newline at end of file + - "https://github.com/hamcrest/JavaHamcrest/hamcrest-all|https://github.com/hamcrest/JavaHamcrest" +excludes: + - "E-PK-CORE-18: Outdated content: '.github/workflows/ci-build.yml'" + - "E-PK-CORE-18: Outdated content: '.github/workflows/release_droid_prepare_original_checksum.yml'" diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index cdfe4f1..0000000 --- a/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,5 +0,0 @@ -eclipse.preferences.version=1 -encoding//src/main/java=UTF-8 -encoding//src/test/java=UTF-8 -encoding//src/test/resources=UTF-8 -encoding/=UTF-8 diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index 8b5a9aa..bb40c3f 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -111,7 +111,7 @@ org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.processAnnotations=enabled +org.eclipse.jdt.core.compiler.processAnnotations=disabled org.eclipse.jdt.core.compiler.release=disabled org.eclipse.jdt.core.compiler.source=11 org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs deleted file mode 100644 index f897a7f..0000000 --- a/.settings/org.eclipse.m2e.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -activeProfiles= -eclipse.preferences.version=1 -resolveWorkspaceProjects=true -version=1 diff --git a/dependencies.md b/dependencies.md index 3b9c4a4..bea09b3 100644 --- a/dependencies.md +++ b/dependencies.md @@ -11,7 +11,7 @@ | [BucketFS Java][7] | [MIT License][8] | | [exasol-test-setup-abstraction-java][9] | [MIT License][10] | | [Apache Commons Compress][11] | [Apache-2.0][12] | -| [SLF4J JDK14 Binding][13] | [MIT License][14] | +| [SLF4J JDK14 Provider][13] | [MIT License][14] | ## Test Dependencies @@ -48,7 +48,7 @@ | [Versions Maven Plugin][41] | [Apache License, Version 2.0][12] | | [duplicate-finder-maven-plugin Maven Mojo][42] | [Apache License 2.0][43] | | [Apache Maven Deploy Plugin][44] | [Apache-2.0][12] | -| [Apache Maven GPG Plugin][45] | [Apache License, Version 2.0][12] | +| [Apache Maven GPG Plugin][45] | [Apache-2.0][12] | | [Apache Maven Source Plugin][46] | [Apache License, Version 2.0][12] | | [Apache Maven Javadoc Plugin][47] | [Apache-2.0][12] | | [Nexus Staging Maven Plugin][48] | [Eclipse Public License][49] | @@ -85,7 +85,7 @@ [20]: http://www.opensource.org/licenses/bsd-license.php [21]: https://github.com/exasol/exasol-testcontainers/ [22]: https://github.com/exasol/exasol-testcontainers/blob/main/LICENSE -[23]: https://testcontainers.org +[23]: https://java.testcontainers.org [24]: http://opensource.org/licenses/MIT [25]: https://github.com/exasol/test-db-builder-java/ [26]: https://github.com/exasol/test-db-builder-java/blob/main/LICENSE @@ -104,7 +104,7 @@ [39]: https://sonatype.github.io/ossindex-maven/maven-plugin/ [40]: https://maven.apache.org/surefire/maven-surefire-plugin/ [41]: https://www.mojohaus.org/versions/versions-maven-plugin/ -[42]: https://github.com/basepom/duplicate-finder-maven-plugin +[42]: https://basepom.github.io/duplicate-finder-maven-plugin [43]: http://www.apache.org/licenses/LICENSE-2.0.html [44]: https://maven.apache.org/plugins/maven-deploy-plugin/ [45]: https://maven.apache.org/plugins/maven-gpg-plugin/ diff --git a/doc/changes/changelog.md b/doc/changes/changelog.md index d96483a..c404b40 100644 --- a/doc/changes/changelog.md +++ b/doc/changes/changelog.md @@ -1,5 +1,6 @@ # Changes +* [0.6.11](changes_0.6.11.md) * [0.6.10](changes_0.6.10.md) * [0.6.9](changes_0.6.9.md) * [0.6.8](changes_0.6.8.md) diff --git a/doc/changes/changes_0.6.11.md b/doc/changes/changes_0.6.11.md new file mode 100644 index 0000000..a4bf90d --- /dev/null +++ b/doc/changes/changes_0.6.11.md @@ -0,0 +1,46 @@ +# Udf Debugging Java 0.6.11, released 2023-09-26 + +Code name: Fix CVE-2023-42503 + +## Summary + +This release fixes CVE-2023-42503 in `org.apache.commons:commons-compress` by upgrading dependencies. + +**Known issue:** Transitive dependency `io.netty:netty-handler` used by `software.amazon.awssdk:cloudformation` in scope `provided` contains vulnerability CVE-2023-4586. We assume that the AWS SDK's usage of netty is not affected. + +## Security + +* #61: Fixed CVE-2023-42503 in `org.apache.commons:commons-compress` + +## Dependency Updates + +### Compile Dependency Updates + +* Updated `org.apache.commons:commons-compress:1.23.0` to `1.24.0` +* Updated `org.slf4j:slf4j-jdk14:2.0.7` to `2.0.9` + +### Runtime Dependency Updates + +* Updated `org.eclipse.parsson:parsson:1.1.2` to `1.1.4` + +### Test Dependency Updates + +* Updated `com.exasol:exasol-testcontainers:6.6.0` to `6.6.2` +* Updated `com.exasol:test-db-builder-java:3.4.2` to `3.5.0` +* Updated `org.junit.jupiter:junit-jupiter-engine:5.9.3` to `5.10.0` +* Updated `org.junit.jupiter:junit-jupiter-params:5.9.3` to `5.10.0` +* Updated `org.mockito:mockito-junit-jupiter:5.4.0` to `5.5.0` +* Updated `org.testcontainers:junit-jupiter:1.18.3` to `1.19.0` + +### Plugin Dependency Updates + +* Updated `com.exasol:error-code-crawler-maven-plugin:1.2.3` to `1.3.0` +* Updated `com.exasol:project-keeper-maven-plugin:2.9.7` to `2.9.12` +* Updated `org.apache.maven.plugins:maven-enforcer-plugin:3.3.0` to `3.4.0` +* Updated `org.apache.maven.plugins:maven-failsafe-plugin:3.0.0` to `3.1.2` +* Updated `org.apache.maven.plugins:maven-gpg-plugin:3.0.1` to `3.1.0` +* Updated `org.apache.maven.plugins:maven-surefire-plugin:3.0.0` to `3.1.2` +* Updated `org.basepom.maven:duplicate-finder-maven-plugin:1.5.1` to `2.0.1` +* Updated `org.codehaus.mojo:flatten-maven-plugin:1.4.1` to `1.5.0` +* Updated `org.codehaus.mojo:versions-maven-plugin:2.15.0` to `2.16.0` +* Updated `org.jacoco:jacoco-maven-plugin:0.8.9` to `0.8.10` diff --git a/pk_generated_parent.pom b/pk_generated_parent.pom index cff79e0..4c5de41 100644 --- a/pk_generated_parent.pom +++ b/pk_generated_parent.pom @@ -3,7 +3,7 @@ 4.0.0 com.exasol udf-debugging-java-generated-parent - 0.6.10 + 0.6.11 pom UTF-8 @@ -62,7 +62,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.3.0 + 3.4.0 enforce-maven @@ -82,7 +82,7 @@ org.codehaus.mojo flatten-maven-plugin - 1.4.1 + 1.5.0 true oss @@ -121,7 +121,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0 + 3.1.2 @@ -132,7 +132,7 @@ org.codehaus.mojo versions-maven-plugin - 2.15.0 + 2.16.0 display-updates @@ -150,7 +150,7 @@ org.basepom.maven duplicate-finder-maven-plugin - 1.5.1 + 2.0.1 default @@ -168,7 +168,6 @@ true true false - true true false @@ -184,7 +183,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.0.1 + 3.1.0 sign-artifacts @@ -204,6 +203,9 @@ org.apache.maven.plugins maven-source-plugin + 3.2.1 @@ -258,7 +260,7 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.0.0 + 3.1.2 @@ -279,7 +281,7 @@ org.jacoco jacoco-maven-plugin - 0.8.9 + 0.8.10 prepare-agent @@ -320,7 +322,7 @@ com.exasol error-code-crawler-maven-plugin - 1.2.3 + 1.3.0 verify diff --git a/pom.xml b/pom.xml index 9b6ab6e..95a8455 100644 --- a/pom.xml +++ b/pom.xml @@ -1,15 +1,13 @@ - + 4.0.0 udf-debugging-java - 0.6.10 + 0.6.11 udf-debugging-java Utilities for debugging, profiling and code coverage measure for UDFs. https://github.com/exasol/udf-debugging-java/ - 5.9.3 + 5.10.0 0.8.10 @@ -21,7 +19,7 @@ org.eclipse.parsson parsson - 1.1.2 + 1.1.4 runtime @@ -49,19 +47,17 @@ com.exasol exasol-test-setup-abstraction-java - 2.0.2 + 2.0.3 provided org.apache.commons commons-compress - 1.23.0 + 1.24.0 @@ -79,7 +75,7 @@ org.mockito mockito-junit-jupiter - 5.4.0 + 5.5.0 test @@ -92,19 +88,19 @@ com.exasol exasol-testcontainers - 6.6.0 + 6.6.2 test org.testcontainers junit-jupiter - 1.18.3 + 1.19.0 test com.exasol test-db-builder-java - 3.4.2 + 3.5.0 test @@ -117,7 +113,7 @@ org.slf4j slf4j-jdk14 - 2.0.7 + 2.0.9 @@ -143,7 +139,7 @@ com.exasol project-keeper-maven-plugin - 2.9.7 + 2.9.12 @@ -157,13 +153,14 @@ ossindex-maven-plugin - + CVE-2020-36641 + + CVE-2023-4586 @@ -172,7 +169,7 @@ udf-debugging-java-generated-parent com.exasol - 0.6.10 + 0.6.11 pk_generated_parent.pom From 4e5fc95c51a430332fe2deb9342d070351f17382 Mon Sep 17 00:00:00 2001 From: Christoph Pirkl Date: Fri, 1 Mar 2024 10:57:07 +0100 Subject: [PATCH 32/37] #63: Upgrade dependencies (#64) --- .gitattributes | 3 + .github/workflows/broken_links_checker.yml | 2 + .github/workflows/ci-build-next-java.yml | 8 +- .github/workflows/ci-build.yml | 47 +++-- .github/workflows/dependencies_check.yml | 62 ++++++- .github/workflows/dependencies_update.yml | 169 ++++++++++++++++++ ...elease_droid_prepare_original_checksum.yml | 16 +- .../release_droid_print_quick_checksum.yml | 11 +- ...release_droid_release_on_maven_central.yml | 11 +- ...ase_droid_upload_github_release_assets.yml | 11 +- .project-keeper.yml | 8 +- .vscode/settings.json | 6 +- dependencies.md | 98 +++++----- doc/changes/changelog.md | 1 + doc/changes/changes_0.6.12.md | 50 ++++++ pk_generated_parent.pom | 70 ++++++-- pom.xml | 46 +++-- .../modules/udflogs/LogRecorder.java | 2 +- .../exasol/udfdebugging/UdfTestSetupTest.java | 3 +- .../jprofiler/JProfilerModuleTest.java | 3 +- .../modules/udflogs/LogRecorderTest.java | 49 +++-- 21 files changed, 511 insertions(+), 165 deletions(-) create mode 100644 .github/workflows/dependencies_update.yml create mode 100644 doc/changes/changes_0.6.12.md diff --git a/.gitattributes b/.gitattributes index 9064858..2429bb3 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,9 +2,12 @@ dependencies.md linguist-genera doc/changes/changelog.md linguist-generated=true pk_generated_parent.pom linguist-generated=true .github/workflows/broken_links_checker.yml linguist-generated=true +.github/workflows/ci-build.yml linguist-generated=true .github/workflows/ci-build-next-java.yml linguist-generated=true .github/workflows/dependencies_check.yml linguist-generated=true +.github/workflows/dependencies_update.yml linguist-generated=true .github/workflows/release_droid_print_quick_checksum.yml linguist-generated=true +.github/workflows/release_droid_prepare_original_checksum.yml linguist-generated=true .github/workflows/release_droid_release_on_maven_central.yml linguist-generated=true .github/workflows/release_droid_upload_github_release_assets.yml linguist-generated=true diff --git a/.github/workflows/broken_links_checker.yml b/.github/workflows/broken_links_checker.yml index 82ec1cd..0fbcad5 100644 --- a/.github/workflows/broken_links_checker.yml +++ b/.github/workflows/broken_links_checker.yml @@ -1,3 +1,5 @@ +# Generated by Project Keeper +# https://github.com/exasol/project-keeper/blob/main/project-keeper/src/main/resources/templates/.github/workflows/broken_links_checker.yml name: Broken Links Checker on: diff --git a/.github/workflows/ci-build-next-java.yml b/.github/workflows/ci-build-next-java.yml index 7cbab08..e3acdb7 100644 --- a/.github/workflows/ci-build-next-java.yml +++ b/.github/workflows/ci-build-next-java.yml @@ -1,5 +1,6 @@ +# Generated by Project Keeper +# https://github.com/exasol/project-keeper/blob/main/project-keeper/src/main/resources/templates/.github/workflows/ci-build-next-java.yml name: CI Build next Java - on: push: branches: @@ -18,7 +19,7 @@ jobs: with: fetch-depth: 0 - name: Set up JDK 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: "temurin" java-version: 17 @@ -26,8 +27,9 @@ jobs: - name: Run tests and build with Maven run: | mvn --batch-mode --update-snapshots clean package -DtrimStackTrace=false \ + -Djava.version=17 \ -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn - - name: Publish Test Report + - name: Publish Test Report for Java 17 uses: scacap/action-surefire-report@v1 if: ${{ always() && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' }} with: diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 4d3ebab..726cf2a 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -1,5 +1,6 @@ +# Generated by Project Keeper +# https://github.com/exasol/project-keeper/blob/main/project-keeper/src/main/resources/templates/.github/workflows/ci-build-db-version-matrix.yml name: CI Build - on: push: branches: @@ -7,13 +8,20 @@ on: pull_request: jobs: - build: - runs-on: ubuntu-20.04 # UDFs fail with "VM error: Internal error: VM crashed" on ubuntu-latest + matrix-build: + runs-on: ubuntu-20.04 concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.exasol_db_version }} cancel-in-progress: true + strategy: + fail-fast: false + matrix: + exasol_db_version: ["8.25.0", "7.1.25"] + env: + DEFAULT_EXASOL_DB_VERSION: "8.25.0" steps: - name: Free Disk Space + if: ${{ false }} run: | sudo rm -rf /usr/local/lib/android sudo rm -rf /usr/share/dotnet @@ -21,16 +29,16 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up JDK 11 & 17 - uses: actions/setup-java@v3 + - name: Set up JDKs + uses: actions/setup-java@v4 with: distribution: "temurin" java-version: | - 17 11 + 17 cache: "maven" - name: Cache SonarCloud packages - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.sonar/cache key: ${{ runner.os }}-sonar @@ -39,23 +47,32 @@ jobs: run: echo 'testcontainers.reuse.enable=true' > "$HOME/.testcontainers.properties" - name: Run tests and build with Maven run: | - JAVA_HOME=$JAVA_HOME_11_X64 mvn --batch-mode clean verify \ + mvn --batch-mode clean verify \ -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ - -DtrimStackTrace=false - - name: Publish Test Report + -DtrimStackTrace=false \ + -Dcom.exasol.dockerdb.image=${{ matrix.exasol_db_version }} + env: + # Set additional environment variable as in scala projects the scalatest plugin does not forward + # the system property -Dcom.exasol.dockerdb.image to the test's implementation. + EXASOL_DB_VERSION: ${{ matrix.exasol_db_version }} + - name: Publish Test Report for Exasol ${{ matrix.exasol_db_version }} uses: scacap/action-surefire-report@v1 if: ${{ always() && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' }} with: github_token: ${{ secrets.GITHUB_TOKEN }} - name: Sonar analysis - if: ${{ env.SONAR_TOKEN != null }} + if: ${{ env.SONAR_TOKEN != null && matrix.exasol_db_version == env.DEFAULT_EXASOL_DB_VERSION }} run: | - JAVA_HOME=$JAVA_HOME_17_X64 mvn --batch-mode org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \ + mvn --batch-mode org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \ -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ -DtrimStackTrace=false \ - -Dsonar.organization=exasol \ - -Dsonar.host.url=https://sonarcloud.io \ -Dsonar.token=$SONAR_TOKEN env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + + build: + needs: matrix-build + runs-on: ubuntu-latest + steps: + - run: echo "Build successful" diff --git a/.github/workflows/dependencies_check.yml b/.github/workflows/dependencies_check.yml index 3059964..6926e55 100644 --- a/.github/workflows/dependencies_check.yml +++ b/.github/workflows/dependencies_check.yml @@ -1,20 +1,64 @@ -name: Dependencies Check - +# Generated by Project Keeper +# https://github.com/exasol/project-keeper/blob/main/project-keeper/src/main/resources/templates/.github/workflows/dependencies_check.yml +name: Report Security Issues on: + workflow_dispatch: schedule: - cron: "0 2 * * *" jobs: - build: + report_security_issues: runs-on: ubuntu-latest - + permissions: + contents: read + issues: write + outputs: + created-issues: ${{ steps.security-issues.outputs.created-issues }} steps: - uses: actions/checkout@v4 - - name: Set up JDK 11 - uses: actions/setup-java@v3 + + - name: Set up JDKs + uses: actions/setup-java@v4 with: distribution: "temurin" - java-version: 11 + java-version: | + 11 + 17 cache: "maven" - - name: Checking dependencies for vulnerabilities - run: mvn --batch-mode org.sonatype.ossindex.maven:ossindex-maven-plugin:audit -f pom.xml + + - name: Generate ossindex report + run: | + mvn --batch-mode org.sonatype.ossindex.maven:ossindex-maven-plugin:audit \ + org.sonatype.ossindex.maven:ossindex-maven-plugin:audit-aggregate \ + -Dossindex.reportFile=$(pwd)/ossindex-report.json \ + -Dossindex.fail=false + + - name: Report Security Issues + id: security-issues + uses: exasol/python-toolbox/.github/actions/security-issues@main + with: + format: "maven" + command: "cat ossindex-report.json" + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Output security issues (Debugging) + run: | + echo "$CREATED_ISSUES" > test.jsonl + cat test.jsonl + env: + CREATED_ISSUES: ${{ steps.security-issues.outputs.created-issues }} + + start_dependency_udpate: + needs: report_security_issues + if: ${{ needs.report_security_issues.outputs.created-issues }} + concurrency: + cancel-in-progress: true + group: "dependency_update" + # Workflow needs secret INTEGRATION_TEAM_SLACK_NOTIFICATION_WEBHOOK + secrets: inherit + permissions: + contents: write + pull-requests: write + uses: ./.github/workflows/dependencies_update.yml + with: + vulnerability_issues: ${{ needs.report_security_issues.outputs.created-issues }} diff --git a/.github/workflows/dependencies_update.yml b/.github/workflows/dependencies_update.yml new file mode 100644 index 0000000..58222ba --- /dev/null +++ b/.github/workflows/dependencies_update.yml @@ -0,0 +1,169 @@ +# Generated by Project Keeper +# https://github.com/exasol/project-keeper/blob/main/project-keeper/src/main/resources/templates/.github/workflows/dependencies_update.yml +name: Update dependencies +on: + workflow_call: + inputs: + vulnerability_issues: + description: "GitHub issues for vulnerable dependencies as JSONL" + required: true + type: string + workflow_dispatch: + +jobs: + update_dependencies: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up JDKs + uses: actions/setup-java@v4 + with: + distribution: "temurin" + java-version: | + 11 + 17 + cache: "maven" + + - name: Print issues + run: | + echo "Issues from Action input: $ISSUES" + env: + ISSUES: ${{ inputs.vulnerability_issues }} + + - name: Fail if not running on a branch + if: ${{ !startsWith(github.ref, 'refs/heads/') }} + uses: actions/github-script@v7 + with: + script: | + core.setFailed('Not running on a branch, github.ref is ${{ github.ref }}. Please start this workflow only on main or a branch') + + - name: Update dependencies + run: | + mvn --batch-mode com.exasol:project-keeper-maven-plugin:update-dependencies --projects . \ + -Dproject-keeper:vulnerabilities="$CREATED_ISSUES" + env: + CREATED_ISSUES: ${{ inputs.vulnerability_issues }} + + - name: Project Keeper Fix + run: | + mvn --batch-mode com.exasol:project-keeper-maven-plugin:fix --projects . + + - name: Project Keeper Fix for updated Project Keeper version + # Calling PK fix a second time is necessary because the first invocation potentially updated PK itself. + # So we need to run PK fix again with the latest PK version. + # [impl->dsn~dependency-updater.workflow.start-pk-fix~1] + run: | + mvn --batch-mode com.exasol:project-keeper-maven-plugin:fix --projects . + + - name: Generate Pull Request comment + id: pr-comment + # [impl->dsn~dependency-updater.workflow.pull-request-trigger-ci-build~1] + run: | + echo 'comment<> "$GITHUB_OUTPUT" + echo 'This Pull Request was created by [`dependencies_update.yml`](https://github.com/exasol/project-keeper/blob/main/project-keeper/src/main/resources/templates/.github/workflows/dependencies_update.yml) workflow.' >> "$GITHUB_OUTPUT" + if [ -n "$CREATED_ISSUES" ]; then + echo 'It updates dependencies to fix the following vulnerabilities:' >> "$GITHUB_OUTPUT" + echo $CREATED_ISSUES | jq --raw-output '. | "* Closes " + .issue_url + " (" + .cve + ")"' >> "$GITHUB_OUTPUT" + else + echo 'It updates dependencies.' >> "$GITHUB_OUTPUT" + fi + echo >> "$GITHUB_OUTPUT" + echo '# ⚠️ This PR does not trigger CI workflows by default ⚠️' >> "$GITHUB_OUTPUT" + echo 'Please click the **Close pull request** button and then **Reopen pull request** to trigger running checks.' >> "$GITHUB_OUTPUT" + echo 'See https://github.com/exasol/project-keeper/issues/534 for details.' >> "$GITHUB_OUTPUT" + echo 'EOF' >> "$GITHUB_OUTPUT" + + cat "$GITHUB_OUTPUT" + env: + CREATED_ISSUES: ${{ inputs.vulnerability_issues }} + + - name: Generate Pull Request Title + id: pr-title + run: | + if [ -n "$CREATED_ISSUES" ]; then + echo "Security issues are available" + echo "title=🔐 Update dependencies to fix vulnerabilities" >> "$GITHUB_OUTPUT" + else + echo "Security issues are not available" + echo "title=Update dependencies" >> "$GITHUB_OUTPUT" + fi + + cat "$GITHUB_OUTPUT" + env: + CREATED_ISSUES: ${{ inputs.vulnerability_issues }} + + - name: Configure git + run: | + git config --global user.email "opensource@exasol.com" + git config --global user.name "Automatic Dependency Updater" + + - name: Create branch + if: ${{ github.ref == 'refs/heads/main' }} + run: | + branch_name="dependency-update/$(date "+%Y%m%d%H%M%S")" + echo "Creating branch $branch_name" + git checkout -b "$branch_name" + + - name: Commit changes & push + if: ${{ startsWith(github.ref, 'refs/heads/' ) }} + run: | + branch_name=$(git rev-parse --abbrev-ref HEAD) + echo "Current branch: $branch_name" + echo "git diff --stat" + git diff --stat + echo "git diff --numstat" + git diff --numstat + echo "git diff --name-status" + git diff --name-status + echo "Adding untracked files:" + git add . --verbose --all + echo "Committing changes..." + git commit --message "$TITLE" + echo "Pushing branch $branch_name..." + git push --set-upstream origin "$branch_name" + echo "Done." + env: + TITLE: ${{ steps.pr-title.outputs.title }} + + - name: Create pull request + id: create-pr + if: ${{ github.ref == 'refs/heads/main' }} + run: | + pr_url=$(gh pr create --base main --title "$TITLE" --body "$COMMENT") + echo "Created Pull Request: $pr_url" + echo "pr_url=$pr_url" >> "$GITHUB_OUTPUT" + env: + COMMENT: ${{ steps.pr-comment.outputs.comment }} + TITLE: ${{ steps.pr-title.outputs.title }} + GH_TOKEN: ${{ github.token }} + + - name: Report failure Status to Slack channel + # Also run this step in case of failures + if: ${{ always() }} + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + token: ${{ secrets.GITHUB_TOKEN }} + notification_title: "Dependency check in {repo} has {status_message}" + message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>" + notify_when: "failure,cancelled,warnings" + env: + SLACK_WEBHOOK_URL: ${{ secrets.INTEGRATION_TEAM_SLACK_NOTIFICATION_WEBHOOK }} + + - name: Report new Pull Request to Slack channel + if: ${{ steps.create-pr.outputs.pr_url }} + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + token: ${{ secrets.GITHUB_TOKEN }} + notification_title: "Dependency update for {repo} created a Pull Request" + message_format: "{workflow} created Pull Request ${{ steps.create-pr.outputs.pr_url }}" + env: + SLACK_WEBHOOK_URL: ${{ secrets.INTEGRATION_TEAM_SLACK_NOTIFICATION_WEBHOOK }} diff --git a/.github/workflows/release_droid_prepare_original_checksum.yml b/.github/workflows/release_droid_prepare_original_checksum.yml index 843604c..2ff28b3 100644 --- a/.github/workflows/release_droid_prepare_original_checksum.yml +++ b/.github/workflows/release_droid_prepare_original_checksum.yml @@ -1,13 +1,15 @@ +# Generated by Project Keeper +# https://github.com/exasol/project-keeper/blob/main/project-keeper/src/main/resources/templates/.github/workflows/release_droid_prepare_original_checksum.yml name: Release Droid - Prepare Original Checksum - on: workflow_dispatch: jobs: build: - runs-on: ubuntu-20.04 # UDFs fail with "VM error: Internal error: VM crashed" on ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Free Disk Space + if: ${{ false }} run: | sudo rm -rf /usr/local/lib/android sudo rm -rf /usr/share/dotnet @@ -15,11 +17,13 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up JDK 11 - uses: actions/setup-java@v3 + - name: Set up JDKs + uses: actions/setup-java@v4 with: distribution: "temurin" - java-version: 11 + java-version: | + 11 + 17 cache: "maven" - name: Enable testcontainer reuse run: echo 'testcontainers.reuse.enable=true' > "$HOME/.testcontainers.properties" @@ -28,7 +32,7 @@ jobs: - name: Prepare checksum run: find target -maxdepth 1 -name *.jar -exec sha256sum "{}" + > original_checksum - name: Upload checksum to the artifactory - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: original_checksum retention-days: 5 diff --git a/.github/workflows/release_droid_print_quick_checksum.yml b/.github/workflows/release_droid_print_quick_checksum.yml index aed4444..86979cd 100644 --- a/.github/workflows/release_droid_print_quick_checksum.yml +++ b/.github/workflows/release_droid_print_quick_checksum.yml @@ -1,5 +1,6 @@ +# Generated by Project Keeper +# https://github.com/exasol/project-keeper/blob/main/project-keeper/src/main/resources/templates/.github/workflows/release_droid_print_quick_checksum.yml name: Release Droid - Print Quick Checksum - on: workflow_dispatch: @@ -11,11 +12,13 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up JDK 11 - uses: actions/setup-java@v3 + - name: Set up JDKs + uses: actions/setup-java@v4 with: distribution: "temurin" - java-version: 11 + java-version: | + 11 + 17 cache: "maven" - name: Build with Maven skipping tests run: mvn --batch-mode clean verify -DskipTests diff --git a/.github/workflows/release_droid_release_on_maven_central.yml b/.github/workflows/release_droid_release_on_maven_central.yml index dfdbd6a..0a5ee04 100644 --- a/.github/workflows/release_droid_release_on_maven_central.yml +++ b/.github/workflows/release_droid_release_on_maven_central.yml @@ -1,5 +1,6 @@ +# Generated by Project Keeper +# https://github.com/exasol/project-keeper/blob/main/project-keeper/src/main/resources/templates/.github/workflows/release_droid_release_on_maven_central.yml name: Release Droid - Release On Maven Central - on: workflow_dispatch: @@ -12,16 +13,20 @@ jobs: with: fetch-depth: 0 - name: Set up Maven Central Repository - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: "temurin" - java-version: 11 + java-version: | + 11 + 17 cache: "maven" server-id: ossrh server-username: MAVEN_USERNAME server-password: MAVEN_PASSWORD gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }} gpg-passphrase: MAVEN_GPG_PASSPHRASE + - name: List secret GPG keys + run: gpg --list-secret-keys - name: Publish to Central Repository run: mvn --batch-mode -Dgpg.skip=false -DskipTests clean deploy env: diff --git a/.github/workflows/release_droid_upload_github_release_assets.yml b/.github/workflows/release_droid_upload_github_release_assets.yml index 7ae8bbb..b19f7cf 100644 --- a/.github/workflows/release_droid_upload_github_release_assets.yml +++ b/.github/workflows/release_droid_upload_github_release_assets.yml @@ -1,5 +1,6 @@ +# Generated by Project Keeper +# https://github.com/exasol/project-keeper/blob/main/project-keeper/src/main/resources/templates/.github/workflows/release_droid_upload_github_release_assets.yml name: Release Droid - Upload GitHub Release Assets - on: workflow_dispatch: inputs: @@ -15,11 +16,13 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up JDK 11 - uses: actions/setup-java@v3 + - name: Set up JDKs + uses: actions/setup-java@v4 with: distribution: "temurin" - java-version: 11 + java-version: | + 11 + 17 cache: "maven" - name: Build with Maven skipping tests run: mvn --batch-mode clean verify -DskipTests diff --git a/.project-keeper.yml b/.project-keeper.yml index c6aee8f..b7df6c5 100644 --- a/.project-keeper.yml +++ b/.project-keeper.yml @@ -6,6 +6,8 @@ sources: - integration_tests linkReplacements: - "https://github.com/hamcrest/JavaHamcrest/hamcrest-all|https://github.com/hamcrest/JavaHamcrest" -excludes: - - "E-PK-CORE-18: Outdated content: '.github/workflows/ci-build.yml'" - - "E-PK-CORE-18: Outdated content: '.github/workflows/release_droid_prepare_original_checksum.yml'" +build: + runnerOs: ubuntu-20.04 + exasolDbVersions: + - "8.25.0" + - "7.1.25" diff --git a/.vscode/settings.json b/.vscode/settings.json index f1a4c2c..8778700 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,9 +1,9 @@ { "editor.formatOnSave": true, "editor.codeActionsOnSave": { - "source.organizeImports": true, - "source.generate.finalModifiers": true, - "source.fixAll": true + "source.organizeImports": "explicit", + "source.generate.finalModifiers": "explicit", + "source.fixAll": "explicit" }, "java.codeGeneration.useBlocks": true, "java.saveActions.organizeImports": true, diff --git a/dependencies.md b/dependencies.md index bea09b3..f73ddbe 100644 --- a/dependencies.md +++ b/dependencies.md @@ -20,7 +20,7 @@ | [JaCoCo :: Agent][5] | [Eclipse Public License 2.0][6] | | [JUnit Jupiter Engine][15] | [Eclipse Public License v2.0][16] | | [JUnit Jupiter Params][15] | [Eclipse Public License v2.0][16] | -| [mockito-junit-jupiter][17] | [The MIT License][18] | +| [mockito-junit-jupiter][17] | [MIT][18] | | [Hamcrest All][19] | [New BSD License][20] | | [Test containers for Exasol on Docker][21] | [MIT License][22] | | [Testcontainers :: JUnit Jupiter Extension][23] | [MIT][24] | @@ -38,29 +38,25 @@ | Dependency | License | | ------------------------------------------------------- | ---------------------------------------------- | | [SonarQube Scanner for Maven][30] | [GNU LGPL 3][31] | -| [Apache Maven Compiler Plugin][32] | [Apache-2.0][12] | -| [Apache Maven Enforcer Plugin][33] | [Apache-2.0][12] | -| [Maven Flatten Plugin][34] | [Apache Software Licenese][12] | -| [Maven Dependency Plugin][35] | [The Apache Software License, Version 2.0][36] | -| [Project keeper maven plugin][37] | [The MIT License][38] | -| [org.sonatype.ossindex.maven:ossindex-maven-plugin][39] | [ASL2][36] | -| [Maven Surefire Plugin][40] | [Apache-2.0][12] | -| [Versions Maven Plugin][41] | [Apache License, Version 2.0][12] | -| [duplicate-finder-maven-plugin Maven Mojo][42] | [Apache License 2.0][43] | -| [Apache Maven Deploy Plugin][44] | [Apache-2.0][12] | -| [Apache Maven GPG Plugin][45] | [Apache-2.0][12] | -| [Apache Maven Source Plugin][46] | [Apache License, Version 2.0][12] | -| [Apache Maven Javadoc Plugin][47] | [Apache-2.0][12] | -| [Nexus Staging Maven Plugin][48] | [Eclipse Public License][49] | -| [Maven Failsafe Plugin][50] | [Apache-2.0][12] | -| [JaCoCo :: Maven Plugin][51] | [Eclipse Public License 2.0][6] | -| [error-code-crawler-maven-plugin][52] | [MIT License][53] | -| [Reproducible Build Maven Plugin][54] | [Apache 2.0][36] | -| [Maven Clean Plugin][55] | [The Apache Software License, Version 2.0][36] | -| [Maven Resources Plugin][56] | [The Apache Software License, Version 2.0][36] | -| [Maven JAR Plugin][57] | [The Apache Software License, Version 2.0][36] | -| [Maven Install Plugin][58] | [The Apache Software License, Version 2.0][36] | -| [Maven Site Plugin 3][59] | [The Apache Software License, Version 2.0][36] | +| [Apache Maven Toolchains Plugin][32] | [Apache License, Version 2.0][12] | +| [Maven Dependency Plugin][33] | [The Apache Software License, Version 2.0][34] | +| [Project Keeper Maven plugin][35] | [The MIT License][36] | +| [Apache Maven Compiler Plugin][37] | [Apache-2.0][12] | +| [Apache Maven Enforcer Plugin][38] | [Apache-2.0][12] | +| [Maven Flatten Plugin][39] | [Apache Software Licenese][12] | +| [org.sonatype.ossindex.maven:ossindex-maven-plugin][40] | [ASL2][34] | +| [Maven Surefire Plugin][41] | [Apache-2.0][12] | +| [Versions Maven Plugin][42] | [Apache License, Version 2.0][12] | +| [duplicate-finder-maven-plugin Maven Mojo][43] | [Apache License 2.0][44] | +| [Apache Maven Deploy Plugin][45] | [Apache-2.0][12] | +| [Apache Maven GPG Plugin][46] | [Apache-2.0][12] | +| [Apache Maven Source Plugin][47] | [Apache License, Version 2.0][12] | +| [Apache Maven Javadoc Plugin][48] | [Apache-2.0][12] | +| [Nexus Staging Maven Plugin][49] | [Eclipse Public License][50] | +| [Maven Failsafe Plugin][51] | [Apache-2.0][12] | +| [JaCoCo :: Maven Plugin][52] | [Eclipse Public License 2.0][6] | +| [error-code-crawler-maven-plugin][53] | [MIT License][54] | +| [Reproducible Build Maven Plugin][55] | [Apache 2.0][34] | [0]: https://github.com/eclipse-ee4j/jsonp [1]: https://projects.eclipse.org/license/epl-2.0 @@ -80,7 +76,7 @@ [15]: https://junit.org/junit5/ [16]: https://www.eclipse.org/legal/epl-v20.html [17]: https://github.com/mockito/mockito -[18]: https://github.com/mockito/mockito/blob/main/LICENSE +[18]: https://opensource.org/licenses/MIT [19]: https://github.com/hamcrest/JavaHamcrest [20]: http://www.opensource.org/licenses/bsd-license.php [21]: https://github.com/exasol/exasol-testcontainers/ @@ -94,31 +90,27 @@ [29]: https://github.com/eclipse-ee4j/parsson [30]: http://sonarsource.github.io/sonar-scanner-maven/ [31]: http://www.gnu.org/licenses/lgpl.txt -[32]: https://maven.apache.org/plugins/maven-compiler-plugin/ -[33]: https://maven.apache.org/enforcer/maven-enforcer-plugin/ -[34]: https://www.mojohaus.org/flatten-maven-plugin/ -[35]: http://maven.apache.org/plugins/maven-dependency-plugin/ -[36]: http://www.apache.org/licenses/LICENSE-2.0.txt -[37]: https://github.com/exasol/project-keeper/ -[38]: https://github.com/exasol/project-keeper/blob/main/LICENSE -[39]: https://sonatype.github.io/ossindex-maven/maven-plugin/ -[40]: https://maven.apache.org/surefire/maven-surefire-plugin/ -[41]: https://www.mojohaus.org/versions/versions-maven-plugin/ -[42]: https://basepom.github.io/duplicate-finder-maven-plugin -[43]: http://www.apache.org/licenses/LICENSE-2.0.html -[44]: https://maven.apache.org/plugins/maven-deploy-plugin/ -[45]: https://maven.apache.org/plugins/maven-gpg-plugin/ -[46]: https://maven.apache.org/plugins/maven-source-plugin/ -[47]: https://maven.apache.org/plugins/maven-javadoc-plugin/ -[48]: http://www.sonatype.com/public-parent/nexus-maven-plugins/nexus-staging/nexus-staging-maven-plugin/ -[49]: http://www.eclipse.org/legal/epl-v10.html -[50]: https://maven.apache.org/surefire/maven-failsafe-plugin/ -[51]: https://www.jacoco.org/jacoco/trunk/doc/maven.html -[52]: https://github.com/exasol/error-code-crawler-maven-plugin/ -[53]: https://github.com/exasol/error-code-crawler-maven-plugin/blob/main/LICENSE -[54]: http://zlika.github.io/reproducible-build-maven-plugin -[55]: http://maven.apache.org/plugins/maven-clean-plugin/ -[56]: http://maven.apache.org/plugins/maven-resources-plugin/ -[57]: http://maven.apache.org/plugins/maven-jar-plugin/ -[58]: http://maven.apache.org/plugins/maven-install-plugin/ -[59]: http://maven.apache.org/plugins/maven-site-plugin/ +[32]: https://maven.apache.org/plugins/maven-toolchains-plugin/ +[33]: http://maven.apache.org/plugins/maven-dependency-plugin/ +[34]: http://www.apache.org/licenses/LICENSE-2.0.txt +[35]: https://github.com/exasol/project-keeper/ +[36]: https://github.com/exasol/project-keeper/blob/main/LICENSE +[37]: https://maven.apache.org/plugins/maven-compiler-plugin/ +[38]: https://maven.apache.org/enforcer/maven-enforcer-plugin/ +[39]: https://www.mojohaus.org/flatten-maven-plugin/ +[40]: https://sonatype.github.io/ossindex-maven/maven-plugin/ +[41]: https://maven.apache.org/surefire/maven-surefire-plugin/ +[42]: https://www.mojohaus.org/versions/versions-maven-plugin/ +[43]: https://basepom.github.io/duplicate-finder-maven-plugin +[44]: http://www.apache.org/licenses/LICENSE-2.0.html +[45]: https://maven.apache.org/plugins/maven-deploy-plugin/ +[46]: https://maven.apache.org/plugins/maven-gpg-plugin/ +[47]: https://maven.apache.org/plugins/maven-source-plugin/ +[48]: https://maven.apache.org/plugins/maven-javadoc-plugin/ +[49]: http://www.sonatype.com/public-parent/nexus-maven-plugins/nexus-staging/nexus-staging-maven-plugin/ +[50]: http://www.eclipse.org/legal/epl-v10.html +[51]: https://maven.apache.org/surefire/maven-failsafe-plugin/ +[52]: https://www.jacoco.org/jacoco/trunk/doc/maven.html +[53]: https://github.com/exasol/error-code-crawler-maven-plugin/ +[54]: https://github.com/exasol/error-code-crawler-maven-plugin/blob/main/LICENSE +[55]: http://zlika.github.io/reproducible-build-maven-plugin diff --git a/doc/changes/changelog.md b/doc/changes/changelog.md index c404b40..6637ca7 100644 --- a/doc/changes/changelog.md +++ b/doc/changes/changelog.md @@ -1,5 +1,6 @@ # Changes +* [0.6.12](changes_0.6.12.md) * [0.6.11](changes_0.6.11.md) * [0.6.10](changes_0.6.10.md) * [0.6.9](changes_0.6.9.md) diff --git a/doc/changes/changes_0.6.12.md b/doc/changes/changes_0.6.12.md new file mode 100644 index 0000000..2b7fbb4 --- /dev/null +++ b/doc/changes/changes_0.6.12.md @@ -0,0 +1,50 @@ +# Udf Debugging Java 0.6.12, released 2024-03-01 + +Code name: Fix CVE-2024-25710 and CVE-2024-26308 in compile dependency `org.apache.commons:commons-compress` + +## Summary + +This release fixes vulnerabilities CVE-2024-25710 and CVE-2024-26308 in compile dependency `org.apache.commons:commons-compress`. + +## Security + +* #63: Fixed CVE-2024-25710 and CVE-2024-26308 in compile dependency `org.apache.commons:commons-compress` + +## Dependency Updates + +### Compile Dependency Updates + +* Updated `com.exasol:bucketfs-java:3.1.0` to `3.1.2` +* Updated `jakarta.json:jakarta.json-api:2.1.2` to `2.1.3` +* Updated `org.apache.commons:commons-compress:1.24.0` to `1.26.0` +* Updated `org.jacoco:org.jacoco.core:0.8.10` to `0.8.11` +* Updated `org.slf4j:slf4j-jdk14:2.0.9` to `2.0.12` + +### Runtime Dependency Updates + +* Updated `org.eclipse.parsson:parsson:1.1.4` to `1.1.5` + +### Test Dependency Updates + +* Updated `com.exasol:exasol-testcontainers:6.6.2` to `7.0.1` +* Updated `com.exasol:test-db-builder-java:3.5.0` to `3.5.3` +* Updated `org.jacoco:org.jacoco.agent:0.8.10` to `0.8.11` +* Updated `org.junit.jupiter:junit-jupiter-engine:5.10.0` to `5.10.2` +* Updated `org.junit.jupiter:junit-jupiter-params:5.10.0` to `5.10.2` +* Updated `org.mockito:mockito-junit-jupiter:5.5.0` to `5.10.0` +* Updated `org.testcontainers:junit-jupiter:1.19.0` to `1.19.6` + +### Plugin Dependency Updates + +* Updated `com.exasol:error-code-crawler-maven-plugin:1.3.0` to `2.0.0` +* Updated `com.exasol:project-keeper-maven-plugin:2.9.12` to `4.1.0` +* Updated `org.apache.maven.plugins:maven-compiler-plugin:3.11.0` to `3.12.1` +* Updated `org.apache.maven.plugins:maven-enforcer-plugin:3.4.0` to `3.4.1` +* Updated `org.apache.maven.plugins:maven-failsafe-plugin:3.1.2` to `3.2.5` +* Updated `org.apache.maven.plugins:maven-javadoc-plugin:3.5.0` to `3.6.3` +* Updated `org.apache.maven.plugins:maven-surefire-plugin:3.1.2` to `3.2.5` +* Added `org.apache.maven.plugins:maven-toolchains-plugin:3.1.0` +* Updated `org.codehaus.mojo:flatten-maven-plugin:1.5.0` to `1.6.0` +* Updated `org.codehaus.mojo:versions-maven-plugin:2.16.0` to `2.16.2` +* Updated `org.jacoco:jacoco-maven-plugin:0.8.10` to `0.8.11` +* Updated `org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184` to `3.10.0.2594` diff --git a/pk_generated_parent.pom b/pk_generated_parent.pom index 4c5de41..2c847f9 100644 --- a/pk_generated_parent.pom +++ b/pk_generated_parent.pom @@ -3,12 +3,14 @@ 4.0.0 com.exasol udf-debugging-java-generated-parent - 0.6.11 + 0.6.12 pom UTF-8 UTF-8 11 + exasol + https://sonarcloud.io true @@ -48,21 +50,46 @@ org.sonarsource.scanner.maven sonar-maven-plugin - 3.9.1.2184 + 3.10.0.2594 + + + org.apache.maven.plugins + maven-toolchains-plugin + 3.1.0 + + + + toolchain + + + + + + + ${java.version} + + + org.apache.maven.plugins maven-compiler-plugin - 3.11.0 + 3.12.1 ${java.version} ${java.version} + true + + + -Xlint:all,-processing + + org.apache.maven.plugins maven-enforcer-plugin - 3.4.0 + 3.4.1 enforce-maven @@ -72,8 +99,11 @@ - [3.8.7,3.9.0) + 3.6.3 + + 17 + @@ -82,7 +112,7 @@ org.codehaus.mojo flatten-maven-plugin - 1.5.0 + 1.6.0 true oss @@ -121,7 +151,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.1.2 + 3.2.5 @@ -132,7 +162,7 @@ org.codehaus.mojo versions-maven-plugin - 2.16.0 + 2.16.2 display-updates @@ -145,6 +175,17 @@ file:///${project.basedir}/versionsMavenPluginRules.xml + false + true + true + true + false + true + true + true + false + true + true @@ -219,7 +260,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.5.0 + 3.6.3 attach-javadocs @@ -234,6 +275,8 @@ true true true + true + ${java.version} @@ -260,10 +303,9 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.1.2 + 3.2.5 - + -Djava.util.logging.config.file=src/test/resources/logging.properties ${argLine} ${test.excludeTags} @@ -281,7 +323,7 @@ org.jacoco jacoco-maven-plugin - 0.8.10 + 0.8.11 prepare-agent @@ -322,7 +364,7 @@ com.exasol error-code-crawler-maven-plugin - 1.3.0 + 2.0.0 verify diff --git a/pom.xml b/pom.xml index 95a8455..d92dcb6 100644 --- a/pom.xml +++ b/pom.xml @@ -2,24 +2,24 @@ 4.0.0 udf-debugging-java - 0.6.11 + 0.6.12 udf-debugging-java Utilities for debugging, profiling and code coverage measure for UDFs. https://github.com/exasol/udf-debugging-java/ - 5.10.0 - 0.8.10 + 5.10.2 + 0.8.11 jakarta.json jakarta.json-api - 2.1.2 + 2.1.3 org.eclipse.parsson parsson - 1.1.4 + 1.1.5 runtime @@ -42,12 +42,12 @@ com.exasol bucketfs-java - 3.1.0 + 3.1.2 com.exasol exasol-test-setup-abstraction-java - 2.0.3 + 2.1.0 @@ -75,7 +75,7 @@ org.mockito mockito-junit-jupiter - 5.5.0 + 5.10.0 test @@ -88,19 +88,19 @@ com.exasol exasol-testcontainers - 6.6.2 + 7.0.1 test org.testcontainers junit-jupiter - 1.19.0 + 1.19.6 test com.exasol test-db-builder-java - 3.5.0 + 3.5.3 test @@ -113,7 +113,7 @@ org.slf4j slf4j-jdk14 - 2.0.9 + 2.0.12 @@ -139,7 +139,7 @@ com.exasol project-keeper-maven-plugin - 2.9.12 + 4.1.0 @@ -148,6 +148,18 @@ + + org.apache.maven.plugins + maven-compiler-plugin + + + + -Xlint:all,-path + -Werror + + + org.sonatype.ossindex.maven ossindex-maven-plugin @@ -157,10 +169,6 @@ CVE-2020-36641 is reported to be fixed in aXMLRPC 1.12.1. We use version 1.13.0, so this is a false positive. --> CVE-2020-36641 - - CVE-2023-4586 @@ -169,7 +177,7 @@ udf-debugging-java-generated-parent com.exasol - 0.6.11 + 0.6.12 pk_generated_parent.pom diff --git a/src/main/java/com/exasol/udfdebugging/modules/udflogs/LogRecorder.java b/src/main/java/com/exasol/udfdebugging/modules/udflogs/LogRecorder.java index d7d0363..01dee15 100644 --- a/src/main/java/com/exasol/udfdebugging/modules/udflogs/LogRecorder.java +++ b/src/main/java/com/exasol/udfdebugging/modules/udflogs/LogRecorder.java @@ -37,7 +37,7 @@ public LogRecorder(final Consumer logFileHandler) { } @Override - public void close() throws Exception { + public void close() throws IOException { this.server.close(); } diff --git a/src/test/java/com/exasol/udfdebugging/UdfTestSetupTest.java b/src/test/java/com/exasol/udfdebugging/UdfTestSetupTest.java index ff22f50..2090a56 100644 --- a/src/test/java/com/exasol/udfdebugging/UdfTestSetupTest.java +++ b/src/test/java/com/exasol/udfdebugging/UdfTestSetupTest.java @@ -76,6 +76,7 @@ void testCoverageEnabled() { } @Test + @SuppressWarnings("try") // Try-with-resources variable not used in try block void testUdfLogsEnabled() throws SQLException { final Statement statement = mock(Statement.class); when(this.connection.createStatement()).thenReturn(statement); @@ -102,4 +103,4 @@ void testDebuggingDisabled() { assertThat(jvmOptions, not(hasItem(EXPECTED_DEBUG_JVM_OPTION))); } } -} \ No newline at end of file +} diff --git a/src/test/java/com/exasol/udfdebugging/modules/jprofiler/JProfilerModuleTest.java b/src/test/java/com/exasol/udfdebugging/modules/jprofiler/JProfilerModuleTest.java index 261838c..0e33f13 100644 --- a/src/test/java/com/exasol/udfdebugging/modules/jprofiler/JProfilerModuleTest.java +++ b/src/test/java/com/exasol/udfdebugging/modules/jprofiler/JProfilerModuleTest.java @@ -24,6 +24,7 @@ static void beforeAll() { } @Test + @SuppressWarnings("try") // Try-with-resources variable not used in try block void testUpload() throws BucketAccessException, TimeoutException, FileNotFoundException { final Bucket bucket = mock(Bucket.class); try (final JProfilerModule jProfilerModule = new JProfilerModule(bucket)) { @@ -43,4 +44,4 @@ void testGetJvmOptions() { + "=port=11002")); } } -} \ No newline at end of file +} diff --git a/src/test/java/com/exasol/udfdebugging/modules/udflogs/LogRecorderTest.java b/src/test/java/com/exasol/udfdebugging/modules/udflogs/LogRecorderTest.java index f759e6e..f9dad16 100644 --- a/src/test/java/com/exasol/udfdebugging/modules/udflogs/LogRecorderTest.java +++ b/src/test/java/com/exasol/udfdebugging/modules/udflogs/LogRecorderTest.java @@ -1,6 +1,9 @@ package com.exasol.udfdebugging.modules.udflogs; import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.hasSize; +import static org.junit.jupiter.api.Assertions.assertAll; import java.io.*; import java.net.Socket; @@ -9,7 +12,6 @@ import java.util.ArrayList; import java.util.List; -import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; class LogRecorderTest { @@ -17,55 +19,50 @@ class LogRecorderTest { @Test void testLogsAreWrittenAsFile() throws Exception { final List logFiles = new ArrayList<>(); - final LogRecorder logRecorder = new LogRecorder(logFiles::add); - final StreamToLogger connection = new StreamToLogger(logRecorder.getPort()); - connection.write("test"); - assertThat(logFiles, Matchers.hasSize(1)); - assertThat(Files.readString(logFiles.get(0)), Matchers.equalTo("test")); - connection.close(); - logRecorder.close(); + try (final LogRecorder logRecorder = new LogRecorder(logFiles::add); + final StreamToLogger connection = new StreamToLogger(logRecorder.getPort());) { + connection.write("test"); + assertAll(() -> assertThat(logFiles, hasSize(1)), + () -> assertThat(Files.readString(logFiles.get(0)), equalTo("test"))); + } } @Test void testParallelStreams() throws Exception { final List logFiles = new ArrayList<>(); - final LogRecorder logRecorder = new LogRecorder(logFiles::add); - final StreamToLogger connection1 = new StreamToLogger(logRecorder.getPort()); - connection1.write("test"); - assertThat(logFiles, Matchers.hasSize(1)); - assertThat(Files.readString(logFiles.get(0)), Matchers.equalTo("test")); - final StreamToLogger connection2 = new StreamToLogger(logRecorder.getPort()); - connection2.write("other"); - assertThat(logFiles, Matchers.hasSize(2)); - assertThat(Files.readString(logFiles.get(1)), Matchers.equalTo("other")); - connection1.close(); - connection2.close(); - logRecorder.close(); + try (final LogRecorder logRecorder = new LogRecorder(logFiles::add); + final StreamToLogger connection1 = new StreamToLogger(logRecorder.getPort());) { + connection1.write("test"); + assertAll(() -> assertThat(logFiles, hasSize(1)), + () -> assertThat(Files.readString(logFiles.get(0)), equalTo("test"))); + try (final StreamToLogger connection2 = new StreamToLogger(logRecorder.getPort())) { + connection2.write("other"); + assertAll(() -> assertThat(logFiles, hasSize(2)), + () -> assertThat(Files.readString(logFiles.get(1)), equalTo("other"))); + } + } } private static class StreamToLogger implements Closeable { private final Socket socket; - private final OutputStream outputStream; private final PrintWriter writer; public StreamToLogger(final int port) throws IOException { this.socket = new Socket("localhost", port); - this.outputStream = this.socket.getOutputStream(); - this.writer = new PrintWriter(this.outputStream); + this.writer = new PrintWriter(this.socket.getOutputStream()); } @SuppressWarnings("java:S2925") // sleep is required public void write(final String message) throws InterruptedException { this.writer.write(message); this.writer.flush(); - Thread.sleep(100); + Thread.sleep(400); } @Override public void close() throws IOException { this.writer.close(); - this.outputStream.close(); this.socket.close(); } } -} \ No newline at end of file +} From 3b29bbc9bc803261245920c3c243c856fb0bf713 Mon Sep 17 00:00:00 2001 From: Christoph Pirkl <4711730+kaklakariada@users.noreply.github.com> Date: Tue, 9 Apr 2024 08:19:12 +0200 Subject: [PATCH 33/37] #65: Update dependencies (#66) --- .gitattributes | 21 +- .github/workflows/broken_links_checker.yml | 3 + .github/workflows/ci-build-next-java.yml | 6 + .github/workflows/ci-build.yml | 153 +++++++++--- .github/workflows/dependencies_check.yml | 78 ++++--- .github/workflows/dependencies_update.yml | 133 ++++++----- .github/workflows/release.yml | 219 ++++++++++++++++++ ...elease_droid_prepare_original_checksum.yml | 39 ---- .../release_droid_print_quick_checksum.yml | 26 --- ...release_droid_release_on_maven_central.yml | 35 --- ...ase_droid_upload_github_release_assets.yml | 47 ---- .project-keeper.yml | 6 +- dependencies.md | 6 +- doc/changes/changelog.md | 1 + doc/changes/changes_0.6.13.md | 40 ++++ pk_generated_parent.pom | 17 +- pom.xml | 27 ++- release_config.yml | 4 - 18 files changed, 545 insertions(+), 316 deletions(-) create mode 100644 .github/workflows/release.yml delete mode 100644 .github/workflows/release_droid_prepare_original_checksum.yml delete mode 100644 .github/workflows/release_droid_print_quick_checksum.yml delete mode 100644 .github/workflows/release_droid_release_on_maven_central.yml delete mode 100644 .github/workflows/release_droid_upload_github_release_assets.yml create mode 100644 doc/changes/changes_0.6.13.md delete mode 100644 release_config.yml diff --git a/.gitattributes b/.gitattributes index 2429bb3..be0dddc 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,15 +1,12 @@ -dependencies.md linguist-generated=true -doc/changes/changelog.md linguist-generated=true -pk_generated_parent.pom linguist-generated=true -.github/workflows/broken_links_checker.yml linguist-generated=true -.github/workflows/ci-build.yml linguist-generated=true -.github/workflows/ci-build-next-java.yml linguist-generated=true -.github/workflows/dependencies_check.yml linguist-generated=true -.github/workflows/dependencies_update.yml linguist-generated=true -.github/workflows/release_droid_print_quick_checksum.yml linguist-generated=true -.github/workflows/release_droid_prepare_original_checksum.yml linguist-generated=true -.github/workflows/release_droid_release_on_maven_central.yml linguist-generated=true -.github/workflows/release_droid_upload_github_release_assets.yml linguist-generated=true +dependencies.md linguist-generated=true +doc/changes/changelog.md linguist-generated=true +pk_generated_parent.pom linguist-generated=true +.github/workflows/broken_links_checker.yml linguist-generated=true +.github/workflows/ci-build.yml linguist-generated=true +.github/workflows/ci-build-next-java.yml linguist-generated=true +.github/workflows/dependencies_check.yml linguist-generated=true +.github/workflows/dependencies_update.yml linguist-generated=true +.github/workflows/release.yml linguist-generated=true .settings/org.eclipse.jdt.core.prefs linguist-generated=true .settings/org.eclipse.jdt.ui.prefs linguist-generated=true diff --git a/.github/workflows/broken_links_checker.yml b/.github/workflows/broken_links_checker.yml index 0fbcad5..d7a38b4 100644 --- a/.github/workflows/broken_links_checker.yml +++ b/.github/workflows/broken_links_checker.yml @@ -13,6 +13,9 @@ on: jobs: linkChecker: runs-on: ubuntu-latest + defaults: + run: + shell: "bash" concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true diff --git a/.github/workflows/ci-build-next-java.yml b/.github/workflows/ci-build-next-java.yml index e3acdb7..8886e10 100644 --- a/.github/workflows/ci-build-next-java.yml +++ b/.github/workflows/ci-build-next-java.yml @@ -10,6 +10,12 @@ on: jobs: java-17-compatibility: runs-on: ubuntu-latest + defaults: + run: + shell: "bash" + permissions: + contents: read + checks: write # Allow scacap/action-surefire-report concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 726cf2a..7b0fc70 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -1,78 +1,165 @@ -# Generated by Project Keeper -# https://github.com/exasol/project-keeper/blob/main/project-keeper/src/main/resources/templates/.github/workflows/ci-build-db-version-matrix.yml +# This file was generated by Project Keeper. name: CI Build on: push: - branches: - - main - pull_request: - + branches: [ + main + ] + + pull_request: null jobs: matrix-build: runs-on: ubuntu-20.04 - concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.exasol_db_version }} + defaults: + run: { + shell: bash + } + permissions: { + contents: read, + checks: write + } + concurrency: { + group: '${{ github.workflow }}-${{ github.ref }}-${{ matrix.exasol_db_version }}', cancel-in-progress: true + } strategy: fail-fast: false matrix: - exasol_db_version: ["8.25.0", "7.1.25"] - env: - DEFAULT_EXASOL_DB_VERSION: "8.25.0" + exasol_db_version: [ + 8.26.0, + 7.1.26 + ] + + env: { + DEFAULT_EXASOL_DB_VERSION: 8.26.0 + } steps: - name: Free Disk Space + id: free-disk-space if: ${{ false }} run: | sudo rm -rf /usr/local/lib/android sudo rm -rf /usr/share/dotnet - name: Checkout the repository + id: checkout uses: actions/checkout@v4 - with: + with: { fetch-depth: 0 + } - name: Set up JDKs + id: setup-java uses: actions/setup-java@v4 with: - distribution: "temurin" + distribution: temurin java-version: | 11 17 - cache: "maven" + cache: maven - name: Cache SonarCloud packages + id: cache-sonar uses: actions/cache@v4 - with: - path: ~/.sonar/cache - key: ${{ runner.os }}-sonar - restore-keys: ${{ runner.os }}-sonar - - name: Enable testcontainer reuse + with: { + path: ~/.sonar/cache, + key: '${{ runner.os }}-sonar', + restore-keys: '${{ runner.os }}-sonar' + } + - { + name: Enable testcontainer reuse, + id: enable-testcontainer-reuse, run: echo 'testcontainers.reuse.enable=true' > "$HOME/.testcontainers.properties" + } - name: Run tests and build with Maven + id: build-pk-verify run: | mvn --batch-mode clean verify \ -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ -DtrimStackTrace=false \ -Dcom.exasol.dockerdb.image=${{ matrix.exasol_db_version }} - env: - # Set additional environment variable as in scala projects the scalatest plugin does not forward - # the system property -Dcom.exasol.dockerdb.image to the test's implementation. - EXASOL_DB_VERSION: ${{ matrix.exasol_db_version }} - - name: Publish Test Report for Exasol ${{ matrix.exasol_db_version }} - uses: scacap/action-surefire-report@v1 - if: ${{ always() && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' }} - with: - github_token: ${{ secrets.GITHUB_TOKEN }} + env: { + EXASOL_DB_VERSION: '${{ matrix.exasol_db_version }}' + } - name: Sonar analysis + id: sonar-analysis if: ${{ env.SONAR_TOKEN != null && matrix.exasol_db_version == env.DEFAULT_EXASOL_DB_VERSION }} run: | mvn --batch-mode org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \ -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ -DtrimStackTrace=false \ -Dsonar.token=$SONAR_TOKEN - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - + env: { + GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}', + SONAR_TOKEN: '${{ secrets.SONAR_TOKEN }}' + } + - name: Verify Release Artifacts + id: verify-release-artifacts + run: "print_message() {\n local -r message=$1\n echo \"$message\"\n echo \"$message\" >> \"$GITHUB_STEP_SUMMARY\"\n}\n\nprint_message \"### Release Artifacts\"\n\nIFS=$'\\n' artifacts_array=($ARTIFACTS)\nmissing_files=()\nfor file in \"${artifacts_array[@]}\";\ndo \n echo \"Checking if file $file exists...\"\n if ! [[ -f \"$file\" ]]; then\n print_message \"* ⚠️ \\`$file\\` does not exist ⚠️\"\n echo \"Content of directory $(dirname \"$file\"):\"\n ls \"$(dirname \"$file\")\"\n missing_files+=(\"$file\")\n else\n print_message \"* \\`$file\\` ✅\" \n fi\ndone\nprint_message \"\"\nnumber_of_missing_files=${#missing_files[@]}\nif [[ $number_of_missing_files -gt 0 ]]; then\n print_message \"⚠️ $number_of_missing_files release artifact(s) missing ⚠️\"\n exit 1\nfi\n" + env: { + ARTIFACTS: '${{ steps.build-pk-verify.outputs.release-artifacts }}' + } + - name: Upload artifacts + id: upload-artifacts + uses: actions/upload-artifact@v4 + with: { + name: 'artifacts-exasol-${{ matrix.exasol_db_version }}', + path: '${{ steps.build-pk-verify.outputs.release-artifacts }}', + retention-days: 5 + } build: needs: matrix-build runs-on: ubuntu-latest + defaults: + run: { + shell: bash + } + permissions: { + contents: read, + issues: read + } + outputs: { + release-required: '${{ steps.check-release.outputs.release-required }}' + } steps: - - run: echo "Build successful" + - name: Checkout the repository + uses: actions/checkout@v4 + with: { + fetch-depth: 0 + } + - name: Set up JDKs + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: | + 11 + 17 + cache: maven + - name: Check if release is needed + id: check-release + run: | + if mvn --batch-mode com.exasol:project-keeper-maven-plugin:verify-release --projects .; then + echo "### ✅ Release preconditions met, start release" >> "$GITHUB_STEP_SUMMARY" + echo "release-required=true" >> "$GITHUB_OUTPUT" + else + echo "### 🛑 Not all release preconditions met, skipping release" >> "$GITHUB_STEP_SUMMARY" + echo "See log output for details." >> "$GITHUB_STEP_SUMMARY" + echo "release-required=false" >> "$GITHUB_OUTPUT" + fi + env: { + GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' + } + start_release: + needs: build + if: ${{ github.ref == 'refs/heads/main' && needs.build.outputs.release-required == 'true' }} + concurrency: { + cancel-in-progress: false, + group: release + } + secrets: inherit + permissions: { + contents: write, + actions: read, + issues: read + } + uses: ./.github/workflows/release.yml + with: { + started-from-ci: true + } diff --git a/.github/workflows/dependencies_check.yml b/.github/workflows/dependencies_check.yml index 6926e55..9c2365c 100644 --- a/.github/workflows/dependencies_check.yml +++ b/.github/workflows/dependencies_check.yml @@ -1,64 +1,80 @@ -# Generated by Project Keeper -# https://github.com/exasol/project-keeper/blob/main/project-keeper/src/main/resources/templates/.github/workflows/dependencies_check.yml +# This file was generated by Project Keeper. name: Report Security Issues on: - workflow_dispatch: + workflow_dispatch: null schedule: - - cron: "0 2 * * *" - + - { + cron: 0 2 * * * + } jobs: report_security_issues: runs-on: ubuntu-latest - permissions: - contents: read + defaults: + run: { + shell: bash + } + permissions: { + contents: read, issues: write - outputs: - created-issues: ${{ steps.security-issues.outputs.created-issues }} + } + outputs: { + created-issues: '${{ steps.security-issues.outputs.created-issues }}' + } + concurrency: { + group: '${{ github.workflow }}-report_security_issues', + cancel-in-progress: true + } steps: - - uses: actions/checkout@v4 - + - { + name: Checkout, + id: checkout, + uses: actions/checkout@v4 + } - name: Set up JDKs + id: setup-jdks uses: actions/setup-java@v4 with: - distribution: "temurin" + distribution: temurin java-version: | 11 17 - cache: "maven" - + cache: maven - name: Generate ossindex report + id: ossindex-report run: | mvn --batch-mode org.sonatype.ossindex.maven:ossindex-maven-plugin:audit \ org.sonatype.ossindex.maven:ossindex-maven-plugin:audit-aggregate \ -Dossindex.reportFile=$(pwd)/ossindex-report.json \ -Dossindex.fail=false - - name: Report Security Issues id: security-issues uses: exasol/python-toolbox/.github/actions/security-issues@main - with: - format: "maven" - command: "cat ossindex-report.json" - github-token: ${{ secrets.GITHUB_TOKEN }} - + with: { + format: maven, + command: cat ossindex-report.json, + github-token: '${{ secrets.GITHUB_TOKEN }}' + } - name: Output security issues (Debugging) + id: debug-print-security-issues run: | echo "$CREATED_ISSUES" > test.jsonl cat test.jsonl - env: - CREATED_ISSUES: ${{ steps.security-issues.outputs.created-issues }} - + env: { + CREATED_ISSUES: '${{ steps.security-issues.outputs.created-issues }}' + } start_dependency_udpate: needs: report_security_issues if: ${{ needs.report_security_issues.outputs.created-issues }} - concurrency: - cancel-in-progress: true - group: "dependency_update" - # Workflow needs secret INTEGRATION_TEAM_SLACK_NOTIFICATION_WEBHOOK + concurrency: { + group: '${{ github.workflow }}-start_dependency_update', + cancel-in-progress: false + } secrets: inherit - permissions: - contents: write + permissions: { + contents: write, pull-requests: write + } uses: ./.github/workflows/dependencies_update.yml - with: - vulnerability_issues: ${{ needs.report_security_issues.outputs.created-issues }} + with: { + vulnerability_issues: '${{ needs.report_security_issues.outputs.created-issues }}' + } diff --git a/.github/workflows/dependencies_update.yml b/.github/workflows/dependencies_update.yml index 58222ba..9f536ee 100644 --- a/.github/workflows/dependencies_update.yml +++ b/.github/workflows/dependencies_update.yml @@ -1,70 +1,76 @@ -# Generated by Project Keeper -# https://github.com/exasol/project-keeper/blob/main/project-keeper/src/main/resources/templates/.github/workflows/dependencies_update.yml +# This file was generated by Project Keeper. name: Update dependencies on: workflow_call: inputs: - vulnerability_issues: - description: "GitHub issues for vulnerable dependencies as JSONL" - required: true + vulnerability_issues: { + description: GitHub issues for vulnerable dependencies as JSONL, + required: true, type: string - workflow_dispatch: - + } + workflow_dispatch: null jobs: update_dependencies: runs-on: ubuntu-latest - permissions: - contents: write + defaults: + run: { + shell: bash + } + permissions: { + contents: write, pull-requests: write - + } + concurrency: { + group: '${{ github.workflow }}', + cancel-in-progress: false + } steps: - uses: actions/checkout@v4 - with: + id: checkout + with: { fetch-depth: 0 - + } - name: Set up JDKs + id: setup-jdks uses: actions/setup-java@v4 with: - distribution: "temurin" + distribution: temurin java-version: | 11 17 - cache: "maven" - + cache: maven - name: Print issues + id: debug-print-issues run: | echo "Issues from Action input: $ISSUES" - env: - ISSUES: ${{ inputs.vulnerability_issues }} - + env: { + ISSUES: '${{ inputs.vulnerability_issues }}' + } - name: Fail if not running on a branch + id: check-branch if: ${{ !startsWith(github.ref, 'refs/heads/') }} uses: actions/github-script@v7 with: script: | core.setFailed('Not running on a branch, github.ref is ${{ github.ref }}. Please start this workflow only on main or a branch') - - name: Update dependencies + id: update-dependencies run: | mvn --batch-mode com.exasol:project-keeper-maven-plugin:update-dependencies --projects . \ -Dproject-keeper:vulnerabilities="$CREATED_ISSUES" - env: - CREATED_ISSUES: ${{ inputs.vulnerability_issues }} - + env: { + CREATED_ISSUES: '${{ inputs.vulnerability_issues }}' + } - name: Project Keeper Fix + id: project-keeper-fix run: | mvn --batch-mode com.exasol:project-keeper-maven-plugin:fix --projects . - - name: Project Keeper Fix for updated Project Keeper version - # Calling PK fix a second time is necessary because the first invocation potentially updated PK itself. - # So we need to run PK fix again with the latest PK version. - # [impl->dsn~dependency-updater.workflow.start-pk-fix~1] + id: project-keeper-fix-2 run: | mvn --batch-mode com.exasol:project-keeper-maven-plugin:fix --projects . - - name: Generate Pull Request comment id: pr-comment - # [impl->dsn~dependency-updater.workflow.pull-request-trigger-ci-build~1] run: | echo 'comment<> "$GITHUB_OUTPUT" echo 'This Pull Request was created by [`dependencies_update.yml`](https://github.com/exasol/project-keeper/blob/main/project-keeper/src/main/resources/templates/.github/workflows/dependencies_update.yml) workflow.' >> "$GITHUB_OUTPUT" @@ -81,9 +87,9 @@ jobs: echo 'EOF' >> "$GITHUB_OUTPUT" cat "$GITHUB_OUTPUT" - env: - CREATED_ISSUES: ${{ inputs.vulnerability_issues }} - + env: { + CREATED_ISSUES: '${{ inputs.vulnerability_issues }}' + } - name: Generate Pull Request Title id: pr-title run: | @@ -96,22 +102,23 @@ jobs: fi cat "$GITHUB_OUTPUT" - env: - CREATED_ISSUES: ${{ inputs.vulnerability_issues }} - + env: { + CREATED_ISSUES: '${{ inputs.vulnerability_issues }}' + } - name: Configure git + id: configure-git run: | git config --global user.email "opensource@exasol.com" git config --global user.name "Automatic Dependency Updater" - - name: Create branch + id: create-branch if: ${{ github.ref == 'refs/heads/main' }} run: | branch_name="dependency-update/$(date "+%Y%m%d%H%M%S")" echo "Creating branch $branch_name" git checkout -b "$branch_name" - - name: Commit changes & push + id: publish-branch if: ${{ startsWith(github.ref, 'refs/heads/' ) }} run: | branch_name=$(git rev-parse --abbrev-ref HEAD) @@ -129,9 +136,9 @@ jobs: echo "Pushing branch $branch_name..." git push --set-upstream origin "$branch_name" echo "Done." - env: - TITLE: ${{ steps.pr-title.outputs.title }} - + env: { + TITLE: '${{ steps.pr-title.outputs.title }}' + } - name: Create pull request id: create-pr if: ${{ github.ref == 'refs/heads/main' }} @@ -139,31 +146,35 @@ jobs: pr_url=$(gh pr create --base main --title "$TITLE" --body "$COMMENT") echo "Created Pull Request: $pr_url" echo "pr_url=$pr_url" >> "$GITHUB_OUTPUT" - env: - COMMENT: ${{ steps.pr-comment.outputs.comment }} - TITLE: ${{ steps.pr-title.outputs.title }} - GH_TOKEN: ${{ github.token }} - + env: { + COMMENT: '${{ steps.pr-comment.outputs.comment }}', + TITLE: '${{ steps.pr-title.outputs.title }}', + GH_TOKEN: '${{ github.token }}' + } - name: Report failure Status to Slack channel - # Also run this step in case of failures + id: report-failure-slack if: ${{ always() }} uses: ravsamhq/notify-slack-action@v2 - with: - status: ${{ job.status }} - token: ${{ secrets.GITHUB_TOKEN }} - notification_title: "Dependency check in {repo} has {status_message}" - message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>" - notify_when: "failure,cancelled,warnings" - env: - SLACK_WEBHOOK_URL: ${{ secrets.INTEGRATION_TEAM_SLACK_NOTIFICATION_WEBHOOK }} - + with: { + status: '${{ job.status }}', + token: '${{ secrets.GITHUB_TOKEN }}', + notification_title: 'Dependency check in {repo} has {status_message}', + message_format: '{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>', + notify_when: 'failure,cancelled,warnings' + } + env: { + SLACK_WEBHOOK_URL: '${{ secrets.INTEGRATION_TEAM_SLACK_NOTIFICATION_WEBHOOK }}' + } - 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 - with: - status: ${{ job.status }} - token: ${{ secrets.GITHUB_TOKEN }} - notification_title: "Dependency update for {repo} created a Pull Request" - message_format: "{workflow} created Pull Request ${{ steps.create-pr.outputs.pr_url }}" - env: - SLACK_WEBHOOK_URL: ${{ secrets.INTEGRATION_TEAM_SLACK_NOTIFICATION_WEBHOOK }} + with: { + status: '${{ job.status }}', + token: '${{ secrets.GITHUB_TOKEN }}', + notification_title: 'Dependency update for {repo} created a Pull Request', + message_format: '{workflow} created Pull Request ${{ steps.create-pr.outputs.pr_url }}' + } + env: { + SLACK_WEBHOOK_URL: '${{ secrets.INTEGRATION_TEAM_SLACK_NOTIFICATION_WEBHOOK }}' + } diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..5be64c8 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,219 @@ +# This file was generated by Project Keeper. +name: Release +on: + workflow_call: + inputs: + started-from-ci: { + description: 'Marks this release as started from CI, skipping precondition check', + type: boolean, + required: true, + default: false + } + workflow_dispatch: + inputs: + skip-maven-central: { + description: Skip deployment to Maven Central, + required: true, + type: boolean, + default: false + } + skip-github-release: { + description: Skip creating the GitHub release, + required: true, + type: boolean, + default: false + } +jobs: + release: + runs-on: ubuntu-latest + defaults: + run: { + shell: bash + } + concurrency: { + group: '${{ github.workflow }}', + cancel-in-progress: false + } + permissions: { + contents: write, + actions: read, + issues: read + } + steps: + - name: Checkout the repository + id: checkout + uses: actions/checkout@v4 + with: { + fetch-depth: 0 + } + - name: Set up Maven Central Repository + id: configure-maven-central-credentials + if: ${{ true }} + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: | + 11 + 17 + cache: maven + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }} + gpg-passphrase: MAVEN_GPG_PASSPHRASE + - name: Set up JDKs + id: setup-jdks + if: ${{ ! true }} + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: | + 11 + 17 + cache: maven + - name: Fail if not running on main branch + id: check-main-branch + if: ${{ github.ref != 'refs/heads/main' }} + uses: actions/github-script@v7 + with: + script: | + core.setFailed('Not running on main branch, github.ref is ${{ github.ref }}. Please start this workflow only on main') + - name: Check CI build of this commit succeeded + id: check-ci-build-status + if: ${{ ! inputs.started-from-ci }} + run: | + echo "Commit SHA: $COMMIT_SHA" + gh run list --workflow ci-build.yml --branch main --event push --commit $COMMIT_SHA + ci_build_status=$(gh run list --workflow ci-build.yml --branch main --event push --commit $COMMIT_SHA --json conclusion --template '{{range .}}{{.conclusion}}{{"\n"}}{{end}}') + echo "CI build status at commit $COMMIT_SHA was '$ci_build_status'" + if [[ "$ci_build_status" != "success" ]]; then + gh run list --workflow ci-build.yml --commit $COMMIT_SHA >> $GITHUB_STEP_SUMMARY + echo "Status of CI build for commit $COMMIT_SHA was '$ci_build_status', expected 'success'" >> $GITHUB_STEP_SUMMARY + cat $GITHUB_STEP_SUMMARY + exit 1 + fi + env: { + COMMIT_SHA: '${{ github.sha }}', + GH_TOKEN: '${{ github.token }}' + } + - name: Verify release preconditions + id: verify-release + run: | + mvn --batch-mode com.exasol:project-keeper-maven-plugin:verify-release --projects . + echo "$GITHUB_OUTPUT" + env: { + GITHUB_TOKEN: '${{ github.token }}' + } + - { + name: Build project, + id: build, + run: mvn --batch-mode -DskipTests clean verify + } + - { + name: List secret GPG keys, + id: list-secret-gpg-keys, + if: '${{ true && (! inputs.skip-maven-central) }}', + run: gpg --list-secret-keys + } + - name: Publish to Central Repository + id: deploy-maven-central + if: ${{ true && (! inputs.skip-maven-central) }} + run: | + echo "#### Maven Central Release" >> "$GITHUB_STEP_SUMMARY" + mvn --batch-mode -Dgpg.skip=false -DskipTests deploy + echo "Published to Maven Central ✅" >> "$GITHUB_STEP_SUMMARY" + env: { + MAVEN_USERNAME: '${{ secrets.OSSRH_USERNAME }}', + MAVEN_PASSWORD: '${{ secrets.OSSRH_PASSWORD }}', + MAVEN_GPG_PASSPHRASE: '${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}' + } + - name: Calculate Artifact Checksums + id: artifact-checksum + if: ${{ ! inputs.skip-github-release }} + run: | + echo "Calculating sha256 checksum for artifact files" + echo "artifacts<> "$GITHUB_OUTPUT" + IFS=$'\n' artifacts_array=($ARTIFACTS) + for file in "${artifacts_array[@]}"; + do + full_path=$(realpath "$file") + echo "Calculate sha256sum for file '$full_path'" + file_dir="$(dirname "$full_path")" + file_name=$(basename "$full_path") + pushd "$file_dir" + checksum_file_name="${file_name}.sha256" + sha256sum "$file_name" > "$checksum_file_name" + echo "$full_path" >> "$GITHUB_OUTPUT" + echo "${file_dir}/$checksum_file_name" >> "$GITHUB_OUTPUT" + popd + done + echo "EOF" >> "$GITHUB_OUTPUT" + echo "Full artifact file list" + cat "$GITHUB_OUTPUT" + env: { + ARTIFACTS: '${{ steps.verify-release.outputs.release-artifacts }}' + } + - name: Create GitHub Release + id: create-github-release + if: ${{ ! inputs.skip-github-release }} + run: | + echo "### GitHub Release" >> "$GITHUB_STEP_SUMMARY" + IFS=$'\n' artifacts_array=($ARTIFACTS) + echo "#### Attaching Release Artifacts" >> "$GITHUB_STEP_SUMMARY" + for file in "${artifacts_array[@]}"; + do + echo "Attaching artifact '$file'" + echo "* \`$file\`" >> "$GITHUB_STEP_SUMMARY" + done + echo "" >> "$GITHUB_STEP_SUMMARY" + release_url=$(gh release create --latest --title "$TITLE" --notes "$NOTES" --target main $TAG "${artifacts_array[@]}") + echo "Created release $TAG with title '$TITLE' at $release_url ✅" >> "$GITHUB_STEP_SUMMARY" + echo "release-url=$release_url" >> "$GITHUB_OUTPUT" + + # [impl->dsn~release-workflow.create-golang-tags~1] + echo "#### Creating Additional Tags" >> "$GITHUB_STEP_SUMMARY" + IFS=$'\n' tags_array=($ADDITIONAL_TAGS) + for tag in "${tags_array[@]}"; + do + echo "Creating tag '$tag'" + git tag "$tag" + git push origin "$tag" + echo "* \`$tag\`" >> "$GITHUB_STEP_SUMMARY" + done + + git fetch --tags origin + env: { + GH_TOKEN: '${{ github.token }}', + TAG: '${{ steps.verify-release.outputs.release-tag }}', + ADDITIONAL_TAGS: '${{ steps.verify-release.outputs.additional-release-tags }}', + NOTES: '${{ steps.verify-release.outputs.release-notes }}', + TITLE: '${{ steps.verify-release.outputs.release-title }}', + ARTIFACTS: '${{ steps.artifact-checksum.outputs.artifacts }}' + } + - name: Report failure Status to Slack channel + id: report-failure-status-slack + if: ${{ always() }} + uses: ravsamhq/notify-slack-action@v2 + with: { + status: '${{ job.status }}', + token: '${{ github.token }}', + notification_title: 'Release build in {repo} has {status_message}', + message_format: '{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>', + notify_when: 'failure,cancelled,warnings,skipped' + } + env: { + SLACK_WEBHOOK_URL: '${{ secrets.INTEGRATION_TEAM_SLACK_NOTIFICATION_WEBHOOK }}' + } + - 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 + with: { + status: '${{ job.status }}', + token: '${{ github.token }}', + notification_title: 'Release build for {repo} created a new release', + message_format: '{workflow} created release ${{ steps.create-github-release.outputs.release-url }}' + } + env: { + SLACK_WEBHOOK_URL: '${{ secrets.INTEGRATION_TEAM_SLACK_NOTIFICATION_WEBHOOK }}' + } diff --git a/.github/workflows/release_droid_prepare_original_checksum.yml b/.github/workflows/release_droid_prepare_original_checksum.yml deleted file mode 100644 index 2ff28b3..0000000 --- a/.github/workflows/release_droid_prepare_original_checksum.yml +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by Project Keeper -# https://github.com/exasol/project-keeper/blob/main/project-keeper/src/main/resources/templates/.github/workflows/release_droid_prepare_original_checksum.yml -name: Release Droid - Prepare Original Checksum -on: - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-20.04 - steps: - - name: Free Disk Space - if: ${{ false }} - run: | - sudo rm -rf /usr/local/lib/android - sudo rm -rf /usr/share/dotnet - - name: Checkout the repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Set up JDKs - uses: actions/setup-java@v4 - with: - distribution: "temurin" - java-version: | - 11 - 17 - cache: "maven" - - name: Enable testcontainer reuse - run: echo 'testcontainers.reuse.enable=true' > "$HOME/.testcontainers.properties" - - name: Run tests and build with Maven - run: mvn --batch-mode clean verify --file pom.xml - - name: Prepare checksum - run: find target -maxdepth 1 -name *.jar -exec sha256sum "{}" + > original_checksum - - name: Upload checksum to the artifactory - uses: actions/upload-artifact@v4 - with: - name: original_checksum - retention-days: 5 - path: original_checksum diff --git a/.github/workflows/release_droid_print_quick_checksum.yml b/.github/workflows/release_droid_print_quick_checksum.yml deleted file mode 100644 index 86979cd..0000000 --- a/.github/workflows/release_droid_print_quick_checksum.yml +++ /dev/null @@ -1,26 +0,0 @@ -# Generated by Project Keeper -# https://github.com/exasol/project-keeper/blob/main/project-keeper/src/main/resources/templates/.github/workflows/release_droid_print_quick_checksum.yml -name: Release Droid - Print Quick Checksum -on: - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout the repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Set up JDKs - uses: actions/setup-java@v4 - with: - distribution: "temurin" - java-version: | - 11 - 17 - cache: "maven" - - name: Build with Maven skipping tests - run: mvn --batch-mode clean verify -DskipTests - - name: Print checksum - run: echo 'checksum_start==';find target -maxdepth 1 -name *.jar -exec sha256sum "{}" + | xargs;echo '==checksum_end' diff --git a/.github/workflows/release_droid_release_on_maven_central.yml b/.github/workflows/release_droid_release_on_maven_central.yml deleted file mode 100644 index 0a5ee04..0000000 --- a/.github/workflows/release_droid_release_on_maven_central.yml +++ /dev/null @@ -1,35 +0,0 @@ -# Generated by Project Keeper -# https://github.com/exasol/project-keeper/blob/main/project-keeper/src/main/resources/templates/.github/workflows/release_droid_release_on_maven_central.yml -name: Release Droid - Release On Maven Central -on: - workflow_dispatch: - -jobs: - publish: - runs-on: ubuntu-latest - steps: - - name: Checkout the repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Set up Maven Central Repository - uses: actions/setup-java@v4 - with: - distribution: "temurin" - java-version: | - 11 - 17 - cache: "maven" - server-id: ossrh - server-username: MAVEN_USERNAME - server-password: MAVEN_PASSWORD - gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }} - gpg-passphrase: MAVEN_GPG_PASSPHRASE - - name: List secret GPG keys - run: gpg --list-secret-keys - - name: Publish to Central Repository - run: mvn --batch-mode -Dgpg.skip=false -DskipTests clean deploy - env: - MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} - MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} diff --git a/.github/workflows/release_droid_upload_github_release_assets.yml b/.github/workflows/release_droid_upload_github_release_assets.yml deleted file mode 100644 index b19f7cf..0000000 --- a/.github/workflows/release_droid_upload_github_release_assets.yml +++ /dev/null @@ -1,47 +0,0 @@ -# Generated by Project Keeper -# https://github.com/exasol/project-keeper/blob/main/project-keeper/src/main/resources/templates/.github/workflows/release_droid_upload_github_release_assets.yml -name: Release Droid - Upload GitHub Release Assets -on: - workflow_dispatch: - inputs: - upload_url: - description: "Assets upload URL" - required: true - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout the repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Set up JDKs - uses: actions/setup-java@v4 - with: - distribution: "temurin" - java-version: | - 11 - 17 - cache: "maven" - - name: Build with Maven skipping tests - run: mvn --batch-mode clean verify -DskipTests - - name: Generate sha256sum files - run: | - cd target - find . -maxdepth 1 -name \*.jar -exec bash -c 'sha256sum {} > {}.sha256' \; - - name: Upload assets to the GitHub release draft - uses: shogo82148/actions-upload-release-asset@v1 - with: - upload_url: ${{ github.event.inputs.upload_url }} - asset_path: target/*.jar - - name: Upload sha256sum files - uses: shogo82148/actions-upload-release-asset@v1 - with: - upload_url: ${{ github.event.inputs.upload_url }} - asset_path: target/*.sha256 - - name: Upload error-code-report - uses: shogo82148/actions-upload-release-asset@v1 - with: - upload_url: ${{ github.event.inputs.upload_url }} - asset_path: target/error_code_report.json diff --git a/.project-keeper.yml b/.project-keeper.yml index b7df6c5..8531de6 100644 --- a/.project-keeper.yml +++ b/.project-keeper.yml @@ -9,5 +9,7 @@ linkReplacements: build: runnerOs: ubuntu-20.04 exasolDbVersions: - - "8.25.0" - - "7.1.25" + - "8.26.0" + - "7.1.26" +excludes: + - "E-PK-CORE-17: Missing required file: 'release_config.yml'" diff --git a/dependencies.md b/dependencies.md index f73ddbe..b14126d 100644 --- a/dependencies.md +++ b/dependencies.md @@ -7,7 +7,7 @@ | --------------------------------------- | ------------------------------------------------------------------------------------------------------------ | | [Jakarta JSON Processing API][0] | [Eclipse Public License 2.0][1]; [GNU General Public License, version 2 with the GNU Classpath Exception][2] | | [error-reporting-java][3] | [MIT License][4] | -| [JaCoCo :: Core][5] | [Eclipse Public License 2.0][6] | +| [JaCoCo :: Core][5] | [EPL-2.0][6] | | [BucketFS Java][7] | [MIT License][8] | | [exasol-test-setup-abstraction-java][9] | [MIT License][10] | | [Apache Commons Compress][11] | [Apache-2.0][12] | @@ -17,7 +17,7 @@ | Dependency | License | | ----------------------------------------------- | --------------------------------- | -| [JaCoCo :: Agent][5] | [Eclipse Public License 2.0][6] | +| [JaCoCo :: Agent][5] | [EPL-2.0][6] | | [JUnit Jupiter Engine][15] | [Eclipse Public License v2.0][16] | | [JUnit Jupiter Params][15] | [Eclipse Public License v2.0][16] | | [mockito-junit-jupiter][17] | [MIT][18] | @@ -54,7 +54,7 @@ | [Apache Maven Javadoc Plugin][48] | [Apache-2.0][12] | | [Nexus Staging Maven Plugin][49] | [Eclipse Public License][50] | | [Maven Failsafe Plugin][51] | [Apache-2.0][12] | -| [JaCoCo :: Maven Plugin][52] | [Eclipse Public License 2.0][6] | +| [JaCoCo :: Maven Plugin][52] | [EPL-2.0][6] | | [error-code-crawler-maven-plugin][53] | [MIT License][54] | | [Reproducible Build Maven Plugin][55] | [Apache 2.0][34] | diff --git a/doc/changes/changelog.md b/doc/changes/changelog.md index 6637ca7..106aecf 100644 --- a/doc/changes/changelog.md +++ b/doc/changes/changelog.md @@ -1,5 +1,6 @@ # Changes +* [0.6.13](changes_0.6.13.md) * [0.6.12](changes_0.6.12.md) * [0.6.11](changes_0.6.11.md) * [0.6.10](changes_0.6.10.md) diff --git a/doc/changes/changes_0.6.13.md b/doc/changes/changes_0.6.13.md new file mode 100644 index 0000000..3bb0cfa --- /dev/null +++ b/doc/changes/changes_0.6.13.md @@ -0,0 +1,40 @@ +# Udf Debugging Java 0.6.13, released 2024-04-09 + +Code name: Fixes CVE-2024-29025 in io.netty:netty-codec-http:jar:4.1.100.Final:provided + +## Summary + +This release fixes vulnerability CVE-2024-29025 in `io.netty:netty-codec-http:jar:4.1.100.Final:provided`. + +**Excluded vulnerability** This release contains vulnerability CVE-2017-10355 in `fr.turri:aXMLRPC` for connecting to ExaOperation during tests. We accept this vulnerability (CWE-833: Deadlock) as we assume that we only connect to the known endpoint ExaOperations. + +## Security + +* #65: Fixed CVE-2024-29025 in `io.netty:netty-codec-http:jar:4.1.100.Final:provided` + +## Dependency Updates + +### Compile Dependency Updates + +* Updated `org.apache.commons:commons-compress:1.26.0` to `1.26.1` +* Updated `org.jacoco:org.jacoco.core:0.8.11` to `0.8.12` + +### Runtime Dependency Updates + +* Updated `org.eclipse.parsson:parsson:1.1.5` to `1.1.6` + +### Test Dependency Updates + +* Updated `com.exasol:test-db-builder-java:3.5.3` to `3.5.4` +* Updated `org.jacoco:org.jacoco.agent:0.8.11` to `0.8.12` +* Updated `org.mockito:mockito-junit-jupiter:5.10.0` to `5.11.0` +* Updated `org.testcontainers:junit-jupiter:1.19.6` to `1.19.7` + +### Plugin Dependency Updates + +* Updated `com.exasol:error-code-crawler-maven-plugin:2.0.0` to `2.0.2` +* Updated `com.exasol:project-keeper-maven-plugin:4.1.0` to `4.3.0` +* Updated `org.apache.maven.plugins:maven-compiler-plugin:3.12.1` to `3.13.0` +* Updated `org.apache.maven.plugins:maven-gpg-plugin:3.1.0` to `3.2.2` +* Updated `org.jacoco:jacoco-maven-plugin:0.8.11` to `0.8.12` +* Updated `org.sonarsource.scanner.maven:sonar-maven-plugin:3.10.0.2594` to `3.11.0.3922` diff --git a/pk_generated_parent.pom b/pk_generated_parent.pom index 2c847f9..fea4b89 100644 --- a/pk_generated_parent.pom +++ b/pk_generated_parent.pom @@ -3,7 +3,7 @@ 4.0.0 com.exasol udf-debugging-java-generated-parent - 0.6.12 + 0.6.13 pom UTF-8 @@ -50,7 +50,7 @@ org.sonarsource.scanner.maven sonar-maven-plugin - 3.10.0.2594 + 3.11.0.3922 org.apache.maven.plugins @@ -74,15 +74,14 @@ org.apache.maven.plugins maven-compiler-plugin - 3.12.1 + 3.13.0 ${java.version} ${java.version} true - - -Xlint:all,-processing - + -Xlint:all + -Werror @@ -224,7 +223,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.1.0 + 3.2.2 sign-artifacts @@ -323,7 +322,7 @@ org.jacoco jacoco-maven-plugin - 0.8.11 + 0.8.12 prepare-agent @@ -364,7 +363,7 @@ com.exasol error-code-crawler-maven-plugin - 2.0.0 + 2.0.2 verify diff --git a/pom.xml b/pom.xml index d92dcb6..62d0b00 100644 --- a/pom.xml +++ b/pom.xml @@ -2,13 +2,13 @@ 4.0.0 udf-debugging-java - 0.6.12 + 0.6.13 udf-debugging-java Utilities for debugging, profiling and code coverage measure for UDFs. https://github.com/exasol/udf-debugging-java/ 5.10.2 - 0.8.11 + 0.8.12 @@ -19,7 +19,7 @@ org.eclipse.parsson parsson - 1.1.5 + 1.1.6 runtime @@ -47,7 +47,7 @@ com.exasol exasol-test-setup-abstraction-java - 2.1.0 + 2.1.2 @@ -75,7 +75,7 @@ org.mockito mockito-junit-jupiter - 5.10.0 + 5.11.0 test @@ -94,13 +94,13 @@ org.testcontainers junit-jupiter - 1.19.6 + 1.19.7 test com.exasol test-db-builder-java - 3.5.3 + 3.5.4 test @@ -139,7 +139,7 @@ com.exasol project-keeper-maven-plugin - 4.1.0 + 4.3.0 @@ -165,10 +165,9 @@ ossindex-maven-plugin - - CVE-2020-36641 + + CVE-2017-10355 @@ -177,7 +176,7 @@ udf-debugging-java-generated-parent com.exasol - 0.6.12 + 0.6.13 pk_generated_parent.pom diff --git a/release_config.yml b/release_config.yml deleted file mode 100644 index 473c219..0000000 --- a/release_config.yml +++ /dev/null @@ -1,4 +0,0 @@ -release-platforms: - - GitHub - - Maven -language: Java From 8153cef68b45694d23899cf6d11f9b3d5dc4e3dd Mon Sep 17 00:00:00 2001 From: YotillaAntoni <92581297+YotillaAntoni@users.noreply.github.com> Date: Tue, 19 Nov 2024 10:33:17 +0100 Subject: [PATCH 34/37] Fix CVE-2024-47535: io.netty:netty-common:jar:4.1.108.Final:runtime (#68) * generate new version. update keeper * update versions * added feedback: explicitly state that is a transitive production dependency * added feedback: explicitly state that is a transitive production dependency * fixed release date --- .github/workflows/broken_links_checker.yml | 2 + .github/workflows/ci-build-next-java.yml | 52 +++++------ .github/workflows/ci-build.yml | 7 +- .github/workflows/dependencies_check.yml | 2 +- .github/workflows/dependencies_update.yml | 16 ++-- .github/workflows/release.yml | 4 +- .settings/org.eclipse.jdt.core.prefs | 28 ++++-- .settings/org.eclipse.jdt.ui.prefs | 6 ++ dependencies.md | 103 ++++++++++++--------- doc/changes/changelog.md | 1 + doc/changes/changes_0.6.14.md | 54 +++++++++++ pk_generated_parent.pom | 63 ++++++++++--- pom.xml | 30 +++--- 13 files changed, 237 insertions(+), 131 deletions(-) create mode 100644 doc/changes/changes_0.6.14.md diff --git a/.github/workflows/broken_links_checker.yml b/.github/workflows/broken_links_checker.yml index d7a38b4..39612b7 100644 --- a/.github/workflows/broken_links_checker.yml +++ b/.github/workflows/broken_links_checker.yml @@ -13,6 +13,8 @@ on: jobs: linkChecker: runs-on: ubuntu-latest + permissions: + contents: read defaults: run: shell: "bash" diff --git a/.github/workflows/ci-build-next-java.yml b/.github/workflows/ci-build-next-java.yml index 8886e10..712a7cb 100644 --- a/.github/workflows/ci-build-next-java.yml +++ b/.github/workflows/ci-build-next-java.yml @@ -1,43 +1,39 @@ -# Generated by Project Keeper -# https://github.com/exasol/project-keeper/blob/main/project-keeper/src/main/resources/templates/.github/workflows/ci-build-next-java.yml +# This file was generated by Project Keeper. name: CI Build next Java on: push: - branches: - - main - pull_request: - + branches: [ + main + ] + + pull_request: null jobs: - java-17-compatibility: + next-java-compatibility: runs-on: ubuntu-latest defaults: - run: - shell: "bash" - permissions: + run: { + shell: bash + } + permissions: { contents: read - checks: write # Allow scacap/action-surefire-report - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + } + concurrency: { + group: '${{ github.workflow }}-${{ github.ref }}', cancel-in-progress: true + } steps: - name: Checkout the repository uses: actions/checkout@v4 - with: + with: { fetch-depth: 0 + } - name: Set up JDK 17 uses: actions/setup-java@v4 - with: - distribution: "temurin" - java-version: 17 - cache: "maven" - - name: Run tests and build with Maven + with: { + distribution: temurin, + java-version: '17', + cache: maven + } + - name: Run tests and build with Maven 17 run: | - mvn --batch-mode --update-snapshots clean package -DtrimStackTrace=false \ - -Djava.version=17 \ - -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn - - name: Publish Test Report for Java 17 - uses: scacap/action-surefire-report@v1 - if: ${{ always() && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' }} - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - fail_if_no_tests: false + mvn --batch-mode clean package -DtrimStackTrace=false -Djava.version=17 diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 7b0fc70..05a0e2c 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -15,8 +15,7 @@ jobs: shell: bash } permissions: { - contents: read, - checks: write + contents: read } concurrency: { group: '${{ github.workflow }}-${{ github.ref }}-${{ matrix.exasol_db_version }}', @@ -51,7 +50,7 @@ jobs: uses: actions/setup-java@v4 with: distribution: temurin - java-version: | + java-version: |- 11 17 cache: maven @@ -128,7 +127,7 @@ jobs: uses: actions/setup-java@v4 with: distribution: temurin - java-version: | + java-version: |- 11 17 cache: maven diff --git a/.github/workflows/dependencies_check.yml b/.github/workflows/dependencies_check.yml index 9c2365c..02c5aa0 100644 --- a/.github/workflows/dependencies_check.yml +++ b/.github/workflows/dependencies_check.yml @@ -35,7 +35,7 @@ jobs: uses: actions/setup-java@v4 with: distribution: temurin - java-version: | + java-version: |- 11 17 cache: maven diff --git a/.github/workflows/dependencies_update.yml b/.github/workflows/dependencies_update.yml index 9f536ee..c901506 100644 --- a/.github/workflows/dependencies_update.yml +++ b/.github/workflows/dependencies_update.yml @@ -35,7 +35,7 @@ jobs: uses: actions/setup-java@v4 with: distribution: temurin - java-version: | + java-version: |- 11 17 cache: maven @@ -61,14 +61,6 @@ jobs: env: { CREATED_ISSUES: '${{ inputs.vulnerability_issues }}' } - - name: Project Keeper Fix - id: project-keeper-fix - run: | - mvn --batch-mode com.exasol:project-keeper-maven-plugin:fix --projects . - - name: Project Keeper Fix for updated Project Keeper version - id: project-keeper-fix-2 - run: | - mvn --batch-mode com.exasol:project-keeper-maven-plugin:fix --projects . - name: Generate Pull Request comment id: pr-comment run: | @@ -81,7 +73,11 @@ jobs: echo 'It updates dependencies.' >> "$GITHUB_OUTPUT" fi echo >> "$GITHUB_OUTPUT" - echo '# ⚠️ This PR does not trigger CI workflows by default ⚠️' >> "$GITHUB_OUTPUT" + echo '# ⚠️ Notes ⚠️' >> "$GITHUB_OUTPUT" + echo '## Run PK fix manually' >> "$GITHUB_OUTPUT" + echo 'Due to restrictions workflow `dependencies_update.yml` cannot update other workflows, see https://github.com/exasol/project-keeper/issues/578 for details.' >> "$GITHUB_OUTPUT" + echo 'Please checkout this PR locally and run `mvn com.exasol:project-keeper-maven-plugin:fix --projects .`' >> "$GITHUB_OUTPUT" + echo '## This PR does not trigger CI workflows' >> "$GITHUB_OUTPUT" echo 'Please click the **Close pull request** button and then **Reopen pull request** to trigger running checks.' >> "$GITHUB_OUTPUT" echo 'See https://github.com/exasol/project-keeper/issues/534 for details.' >> "$GITHUB_OUTPUT" echo 'EOF' >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5be64c8..e4682a3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,7 +52,7 @@ jobs: uses: actions/setup-java@v4 with: distribution: temurin - java-version: | + java-version: |- 11 17 cache: maven @@ -67,7 +67,7 @@ jobs: uses: actions/setup-java@v4 with: distribution: temurin - java-version: | + java-version: |- 11 17 cache: maven diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index bb40c3f..43365b0 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -1,15 +1,19 @@ eclipse.preferences.version=1 +org.eclipse.jdt.core.builder.annotationPath.allLocations=disabled org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore -org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull +org.eclipse.jdt.core.compiler.annotation.nonnull=javax.annotation.Nonnull org.eclipse.jdt.core.compiler.annotation.nonnull.secondary= -org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=javax.annotation.ParametersAreNonnullByDefault org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary= -org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.notowning=org.eclipse.jdt.annotation.NotOwning +org.eclipse.jdt.core.compiler.annotation.nullable=javax.annotation.Nullable org.eclipse.jdt.core.compiler.annotation.nullable.secondary= -org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled +org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled +org.eclipse.jdt.core.compiler.annotation.owning=org.eclipse.jdt.annotation.Owning +org.eclipse.jdt.core.compiler.annotation.resourceanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.methodParameters=generate org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.compliance=11 @@ -17,6 +21,7 @@ org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.APILeak=warning +org.eclipse.jdt.core.compiler.problem.annotatedTypeArgumentToUnannotated=info org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.autoboxing=ignore @@ -39,8 +44,10 @@ org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompatibleOwningContract=warning org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.insufficientResourceAnalysis=warning org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore @@ -56,15 +63,15 @@ org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning -org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error +org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=warning org.eclipse.jdt.core.compiler.problem.nullReference=warning -org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error -org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning +org.eclipse.jdt.core.compiler.problem.nullSpecViolation=warning +org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore -org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore +org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning @@ -78,7 +85,8 @@ org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled +org.eclipse.jdt.core.compiler.problem.suppressWarningsNotFullyAnalysed=info +org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=enabled org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning diff --git a/.settings/org.eclipse.jdt.ui.prefs b/.settings/org.eclipse.jdt.ui.prefs index 1add06a..54d02ac 100644 --- a/.settings/org.eclipse.jdt.ui.prefs +++ b/.settings/org.eclipse.jdt.ui.prefs @@ -76,6 +76,7 @@ sp_cleanup.add_missing_nls_tags=false sp_cleanup.add_missing_override_annotations=true sp_cleanup.add_missing_override_annotations_interface_methods=true sp_cleanup.add_serial_version_id=false +sp_cleanup.also_simplify_lambda=false sp_cleanup.always_use_blocks=true sp_cleanup.always_use_parentheses_in_expressions=true sp_cleanup.always_use_this_for_non_static_field_access=true @@ -130,6 +131,7 @@ sp_cleanup.one_if_rather_than_duplicate_blocks_that_fall_through=false sp_cleanup.operand_factorization=false sp_cleanup.organize_imports=true sp_cleanup.overridden_assignment=false +sp_cleanup.overridden_assignment_move_decl=false sp_cleanup.plain_replacement=false sp_cleanup.precompile_regex=false sp_cleanup.primitive_comparison=false @@ -159,10 +161,12 @@ sp_cleanup.remove_unnecessary_casts=true sp_cleanup.remove_unnecessary_nls_tags=true sp_cleanup.remove_unused_imports=true sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_method_parameters=false sp_cleanup.remove_unused_private_fields=true sp_cleanup.remove_unused_private_members=false sp_cleanup.remove_unused_private_methods=true sp_cleanup.remove_unused_private_types=true +sp_cleanup.replace_deprecated_calls=false sp_cleanup.return_expression=false sp_cleanup.simplify_lambda_expression_and_method_ref=false sp_cleanup.single_used_field=false @@ -174,6 +178,8 @@ sp_cleanup.strictly_equal_or_different=false sp_cleanup.stringbuffer_to_stringbuilder=false sp_cleanup.stringbuilder=false sp_cleanup.stringbuilder_for_local_vars=false +sp_cleanup.stringconcat_stringbuffer_stringbuilder=false +sp_cleanup.stringconcat_to_textblock=false sp_cleanup.substring=false sp_cleanup.switch=false sp_cleanup.system_property=false diff --git a/dependencies.md b/dependencies.md index b14126d..af7d03f 100644 --- a/dependencies.md +++ b/dependencies.md @@ -37,26 +37,31 @@ | Dependency | License | | ------------------------------------------------------- | ---------------------------------------------- | -| [SonarQube Scanner for Maven][30] | [GNU LGPL 3][31] | -| [Apache Maven Toolchains Plugin][32] | [Apache License, Version 2.0][12] | -| [Maven Dependency Plugin][33] | [The Apache Software License, Version 2.0][34] | -| [Project Keeper Maven plugin][35] | [The MIT License][36] | -| [Apache Maven Compiler Plugin][37] | [Apache-2.0][12] | -| [Apache Maven Enforcer Plugin][38] | [Apache-2.0][12] | -| [Maven Flatten Plugin][39] | [Apache Software Licenese][12] | -| [org.sonatype.ossindex.maven:ossindex-maven-plugin][40] | [ASL2][34] | -| [Maven Surefire Plugin][41] | [Apache-2.0][12] | -| [Versions Maven Plugin][42] | [Apache License, Version 2.0][12] | -| [duplicate-finder-maven-plugin Maven Mojo][43] | [Apache License 2.0][44] | -| [Apache Maven Deploy Plugin][45] | [Apache-2.0][12] | -| [Apache Maven GPG Plugin][46] | [Apache-2.0][12] | -| [Apache Maven Source Plugin][47] | [Apache License, Version 2.0][12] | -| [Apache Maven Javadoc Plugin][48] | [Apache-2.0][12] | -| [Nexus Staging Maven Plugin][49] | [Eclipse Public License][50] | -| [Maven Failsafe Plugin][51] | [Apache-2.0][12] | -| [JaCoCo :: Maven Plugin][52] | [EPL-2.0][6] | -| [error-code-crawler-maven-plugin][53] | [MIT License][54] | -| [Reproducible Build Maven Plugin][55] | [Apache 2.0][34] | +| [Apache Maven Clean Plugin][30] | [Apache-2.0][12] | +| [Apache Maven Install Plugin][31] | [Apache-2.0][12] | +| [Apache Maven Resources Plugin][32] | [Apache-2.0][12] | +| [Apache Maven Site Plugin][33] | [Apache License, Version 2.0][12] | +| [SonarQube Scanner for Maven][34] | [GNU LGPL 3][35] | +| [Apache Maven Toolchains Plugin][36] | [Apache-2.0][12] | +| [Maven Dependency Plugin][37] | [The Apache Software License, Version 2.0][38] | +| [Project Keeper Maven plugin][39] | [The MIT License][40] | +| [Apache Maven Compiler Plugin][41] | [Apache-2.0][12] | +| [Apache Maven Enforcer Plugin][42] | [Apache-2.0][12] | +| [Maven Flatten Plugin][43] | [Apache Software Licenese][12] | +| [org.sonatype.ossindex.maven:ossindex-maven-plugin][44] | [ASL2][38] | +| [Maven Surefire Plugin][45] | [Apache-2.0][12] | +| [Versions Maven Plugin][46] | [Apache License, Version 2.0][12] | +| [duplicate-finder-maven-plugin Maven Mojo][47] | [Apache License 2.0][48] | +| [Apache Maven Deploy Plugin][49] | [Apache-2.0][12] | +| [Apache Maven GPG Plugin][50] | [Apache-2.0][12] | +| [Apache Maven Source Plugin][51] | [Apache License, Version 2.0][12] | +| [Apache Maven Javadoc Plugin][52] | [Apache-2.0][12] | +| [Nexus Staging Maven Plugin][53] | [Eclipse Public License][54] | +| [Maven Failsafe Plugin][55] | [Apache-2.0][12] | +| [JaCoCo :: Maven Plugin][56] | [EPL-2.0][6] | +| [Quality Summarizer Maven Plugin][57] | [MIT License][58] | +| [error-code-crawler-maven-plugin][59] | [MIT License][60] | +| [Reproducible Build Maven Plugin][61] | [Apache 2.0][38] | [0]: https://github.com/eclipse-ee4j/jsonp [1]: https://projects.eclipse.org/license/epl-2.0 @@ -88,29 +93,35 @@ [27]: https://github.com/itsallcode/junit5-system-extensions [28]: http://www.eclipse.org/legal/epl-v20.html [29]: https://github.com/eclipse-ee4j/parsson -[30]: http://sonarsource.github.io/sonar-scanner-maven/ -[31]: http://www.gnu.org/licenses/lgpl.txt -[32]: https://maven.apache.org/plugins/maven-toolchains-plugin/ -[33]: http://maven.apache.org/plugins/maven-dependency-plugin/ -[34]: http://www.apache.org/licenses/LICENSE-2.0.txt -[35]: https://github.com/exasol/project-keeper/ -[36]: https://github.com/exasol/project-keeper/blob/main/LICENSE -[37]: https://maven.apache.org/plugins/maven-compiler-plugin/ -[38]: https://maven.apache.org/enforcer/maven-enforcer-plugin/ -[39]: https://www.mojohaus.org/flatten-maven-plugin/ -[40]: https://sonatype.github.io/ossindex-maven/maven-plugin/ -[41]: https://maven.apache.org/surefire/maven-surefire-plugin/ -[42]: https://www.mojohaus.org/versions/versions-maven-plugin/ -[43]: https://basepom.github.io/duplicate-finder-maven-plugin -[44]: http://www.apache.org/licenses/LICENSE-2.0.html -[45]: https://maven.apache.org/plugins/maven-deploy-plugin/ -[46]: https://maven.apache.org/plugins/maven-gpg-plugin/ -[47]: https://maven.apache.org/plugins/maven-source-plugin/ -[48]: https://maven.apache.org/plugins/maven-javadoc-plugin/ -[49]: http://www.sonatype.com/public-parent/nexus-maven-plugins/nexus-staging/nexus-staging-maven-plugin/ -[50]: http://www.eclipse.org/legal/epl-v10.html -[51]: https://maven.apache.org/surefire/maven-failsafe-plugin/ -[52]: https://www.jacoco.org/jacoco/trunk/doc/maven.html -[53]: https://github.com/exasol/error-code-crawler-maven-plugin/ -[54]: https://github.com/exasol/error-code-crawler-maven-plugin/blob/main/LICENSE -[55]: http://zlika.github.io/reproducible-build-maven-plugin +[30]: https://maven.apache.org/plugins/maven-clean-plugin/ +[31]: https://maven.apache.org/plugins/maven-install-plugin/ +[32]: https://maven.apache.org/plugins/maven-resources-plugin/ +[33]: https://maven.apache.org/plugins/maven-site-plugin/ +[34]: http://sonarsource.github.io/sonar-scanner-maven/ +[35]: http://www.gnu.org/licenses/lgpl.txt +[36]: https://maven.apache.org/plugins/maven-toolchains-plugin/ +[37]: http://maven.apache.org/plugins/maven-dependency-plugin/ +[38]: http://www.apache.org/licenses/LICENSE-2.0.txt +[39]: https://github.com/exasol/project-keeper/ +[40]: https://github.com/exasol/project-keeper/blob/main/LICENSE +[41]: https://maven.apache.org/plugins/maven-compiler-plugin/ +[42]: https://maven.apache.org/enforcer/maven-enforcer-plugin/ +[43]: https://www.mojohaus.org/flatten-maven-plugin/ +[44]: https://sonatype.github.io/ossindex-maven/maven-plugin/ +[45]: https://maven.apache.org/surefire/maven-surefire-plugin/ +[46]: https://www.mojohaus.org/versions/versions-maven-plugin/ +[47]: https://basepom.github.io/duplicate-finder-maven-plugin +[48]: http://www.apache.org/licenses/LICENSE-2.0.html +[49]: https://maven.apache.org/plugins/maven-deploy-plugin/ +[50]: https://maven.apache.org/plugins/maven-gpg-plugin/ +[51]: https://maven.apache.org/plugins/maven-source-plugin/ +[52]: https://maven.apache.org/plugins/maven-javadoc-plugin/ +[53]: http://www.sonatype.com/public-parent/nexus-maven-plugins/nexus-staging/nexus-staging-maven-plugin/ +[54]: http://www.eclipse.org/legal/epl-v10.html +[55]: https://maven.apache.org/surefire/maven-failsafe-plugin/ +[56]: https://www.jacoco.org/jacoco/trunk/doc/maven.html +[57]: https://github.com/exasol/quality-summarizer-maven-plugin/ +[58]: https://github.com/exasol/quality-summarizer-maven-plugin/blob/main/LICENSE +[59]: https://github.com/exasol/error-code-crawler-maven-plugin/ +[60]: https://github.com/exasol/error-code-crawler-maven-plugin/blob/main/LICENSE +[61]: http://zlika.github.io/reproducible-build-maven-plugin diff --git a/doc/changes/changelog.md b/doc/changes/changelog.md index 106aecf..616e9f0 100644 --- a/doc/changes/changelog.md +++ b/doc/changes/changelog.md @@ -1,5 +1,6 @@ # Changes +* [0.6.14](changes_0.6.14.md) * [0.6.13](changes_0.6.13.md) * [0.6.12](changes_0.6.12.md) * [0.6.11](changes_0.6.11.md) diff --git a/doc/changes/changes_0.6.14.md b/doc/changes/changes_0.6.14.md new file mode 100644 index 0000000..124e9a2 --- /dev/null +++ b/doc/changes/changes_0.6.14.md @@ -0,0 +1,54 @@ +# Udf Debugging Java 0.6.14, released 2024-11-19 + +Code name: Fix CVE-2024-47535: io.netty:netty-common:jar:4.1.108.Final:provided + +## Summary + +This release fixes CVE-2024-47535 in transitive production dependency `io.netty:netty-common:jar:4.1.108.Final:provided` added by `com.exasol:exasol-test-setup-abstraction-java`. + +## Security + +* #67: Fixed CVE-2024-47535 in `io.netty:netty-common:jar:4.1.108.Final:provided` + +## Dependency Updates + +### Compile Dependency Updates + +* Updated `com.exasol:bucketfs-java:3.1.2` to `3.2.0` +* Updated `org.apache.commons:commons-compress:1.26.1` to `1.27.1` +* Updated `org.slf4j:slf4j-jdk14:2.0.12` to `2.0.16` + +### Runtime Dependency Updates + +* Updated `org.eclipse.parsson:parsson:1.1.6` to `1.1.7` + +### Test Dependency Updates + +* Updated `com.exasol:exasol-testcontainers:7.0.1` to `7.1.1` +* Updated `com.exasol:test-db-builder-java:3.5.4` to `3.6.0` +* Updated `org.itsallcode:junit5-system-extensions:1.2.0` to `1.2.2` +* Updated `org.junit.jupiter:junit-jupiter-engine:5.10.2` to `5.11.3` +* Updated `org.junit.jupiter:junit-jupiter-params:5.10.2` to `5.11.3` +* Updated `org.mockito:mockito-junit-jupiter:5.11.0` to `5.14.2` +* Updated `org.testcontainers:junit-jupiter:1.19.7` to `1.20.3` + +### Plugin Dependency Updates + +* Updated `com.exasol:error-code-crawler-maven-plugin:2.0.2` to `2.0.3` +* Updated `com.exasol:project-keeper-maven-plugin:4.3.0` to `4.4.0` +* Added `com.exasol:quality-summarizer-maven-plugin:0.2.0` +* Updated `io.github.zlika:reproducible-build-maven-plugin:0.16` to `0.17` +* Updated `org.apache.maven.plugins:maven-clean-plugin:2.5` to `3.4.0` +* Updated `org.apache.maven.plugins:maven-deploy-plugin:3.1.1` to `3.1.2` +* Updated `org.apache.maven.plugins:maven-enforcer-plugin:3.4.1` to `3.5.0` +* Updated `org.apache.maven.plugins:maven-failsafe-plugin:3.2.5` to `3.5.1` +* Updated `org.apache.maven.plugins:maven-gpg-plugin:3.2.2` to `3.2.7` +* Updated `org.apache.maven.plugins:maven-install-plugin:2.4` to `3.1.3` +* Updated `org.apache.maven.plugins:maven-javadoc-plugin:3.6.3` to `3.10.1` +* Updated `org.apache.maven.plugins:maven-resources-plugin:2.6` to `3.3.1` +* Updated `org.apache.maven.plugins:maven-site-plugin:3.3` to `3.9.1` +* Updated `org.apache.maven.plugins:maven-surefire-plugin:3.2.5` to `3.5.1` +* Updated `org.apache.maven.plugins:maven-toolchains-plugin:3.1.0` to `3.2.0` +* Updated `org.codehaus.mojo:versions-maven-plugin:2.16.2` to `2.17.1` +* Updated `org.sonarsource.scanner.maven:sonar-maven-plugin:3.11.0.3922` to `4.0.0.4121` +* Updated `org.sonatype.plugins:nexus-staging-maven-plugin:1.6.13` to `1.7.0` diff --git a/pk_generated_parent.pom b/pk_generated_parent.pom index fea4b89..32c5a9f 100644 --- a/pk_generated_parent.pom +++ b/pk_generated_parent.pom @@ -3,7 +3,7 @@ 4.0.0 com.exasol udf-debugging-java-generated-parent - 0.6.13 + 0.6.14 pom UTF-8 @@ -47,15 +47,35 @@ + + org.apache.maven.plugins + maven-clean-plugin + 3.4.0 + + + org.apache.maven.plugins + maven-install-plugin + 3.1.3 + + + org.apache.maven.plugins + maven-resources-plugin + 3.3.1 + + + org.apache.maven.plugins + maven-site-plugin + 3.9.1 + org.sonarsource.scanner.maven sonar-maven-plugin - 3.11.0.3922 + 4.0.0.4121 org.apache.maven.plugins maven-toolchains-plugin - 3.1.0 + 3.2.0 @@ -88,7 +108,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.4.1 + 3.5.0 enforce-maven @@ -150,7 +170,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.2.5 + 3.5.1 @@ -161,7 +181,7 @@ org.codehaus.mojo versions-maven-plugin - 2.16.2 + 2.17.1 display-updates @@ -215,7 +235,7 @@ org.apache.maven.plugins maven-deploy-plugin - 3.1.1 + 3.1.2 true @@ -223,7 +243,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.2.2 + 3.2.7 sign-artifacts @@ -244,8 +264,8 @@ org.apache.maven.plugins maven-source-plugin + Failed to execute goal org.apache.maven.plugins:maven-source-plugin:3.3.0:jar-no-fork (attach-sources) on project project-keeper-shared-model-classes: Presumably you have configured maven-source-plugn to execute twice times in your build. You have to configure a classifier for at least on of them. + Using goal "jar-no-fork" didn't help. See https://stackoverflow.com/questions/76305897/maven-build-fails-after-upgrading-to-maven-source-plugin-from-3-2-1-to-3-3-0 --> 3.2.1 @@ -259,7 +279,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.6.3 + 3.10.1 attach-javadocs @@ -281,7 +301,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.13 + 1.7.0 true ossrh @@ -302,7 +322,7 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.2.5 + 3.5.1 -Djava.util.logging.config.file=src/test/resources/logging.properties ${argLine} @@ -360,10 +380,23 @@ + + com.exasol + quality-summarizer-maven-plugin + 0.2.0 + + + summarize-metrics + + summarize + + + + com.exasol error-code-crawler-maven-plugin - 2.0.2 + 2.0.3 verify @@ -376,7 +409,7 @@ io.github.zlika reproducible-build-maven-plugin - 0.16 + 0.17 strip-jar diff --git a/pom.xml b/pom.xml index 62d0b00..40a8ca8 100644 --- a/pom.xml +++ b/pom.xml @@ -2,12 +2,12 @@ 4.0.0 udf-debugging-java - 0.6.13 + 0.6.14 udf-debugging-java Utilities for debugging, profiling and code coverage measure for UDFs. https://github.com/exasol/udf-debugging-java/ - 5.10.2 + 5.11.3 0.8.12 @@ -19,7 +19,7 @@ org.eclipse.parsson parsson - 1.1.6 + 1.1.7 runtime @@ -42,22 +42,22 @@ com.exasol bucketfs-java - 3.1.2 + 3.2.0 com.exasol exasol-test-setup-abstraction-java - 2.1.2 + 2.1.6 + in methods that are meant to be used with the exasol-test-setup-abstraction-java. --> provided org.apache.commons commons-compress - 1.26.1 + 1.27.1 @@ -75,7 +75,7 @@ org.mockito mockito-junit-jupiter - 5.11.0 + 5.14.2 test @@ -88,32 +88,32 @@ com.exasol exasol-testcontainers - 7.0.1 + 7.1.1 test org.testcontainers junit-jupiter - 1.19.7 + 1.20.3 test com.exasol test-db-builder-java - 3.5.4 + 3.6.0 test org.itsallcode junit5-system-extensions - 1.2.0 + 1.2.2 test org.slf4j slf4j-jdk14 - 2.0.12 + 2.0.16 @@ -139,7 +139,7 @@ com.exasol project-keeper-maven-plugin - 4.3.0 + 4.4.0 @@ -176,7 +176,7 @@ udf-debugging-java-generated-parent com.exasol - 0.6.13 + 0.6.14 pk_generated_parent.pom From fccf0a3160a89339b54b361223441f2ff3f581ec Mon Sep 17 00:00:00 2001 From: Christoph Pirkl <4711730+kaklakariada@users.noreply.github.com> Date: Wed, 12 Feb 2025 12:34:35 +0100 Subject: [PATCH 35/37] #69 #70: Upgrade dependencies (#71) --- .github/workflows/broken_links_checker.yml | 4 -- .github/workflows/ci-build-next-java.yml | 39 ------------ .github/workflows/ci-build.yml | 71 +++++++++++++++++++-- .project-keeper.yml | 17 +++-- .settings/org.eclipse.jdt.core.prefs | 8 +-- dependencies.md | 72 +++++++++++----------- doc/changes/changelog.md | 1 + doc/changes/changes_0.6.15.md | 40 ++++++++++++ pk_generated_parent.pom | 16 ++--- pom.xml | 18 +++--- 10 files changed, 176 insertions(+), 110 deletions(-) delete mode 100644 .github/workflows/ci-build-next-java.yml create mode 100644 doc/changes/changes_0.6.15.md diff --git a/.github/workflows/broken_links_checker.yml b/.github/workflows/broken_links_checker.yml index 39612b7..90488ca 100644 --- a/.github/workflows/broken_links_checker.yml +++ b/.github/workflows/broken_links_checker.yml @@ -5,10 +5,6 @@ name: Broken Links Checker on: schedule: - cron: "0 5 * * 0" - push: - branches: - - main - pull_request: jobs: linkChecker: diff --git a/.github/workflows/ci-build-next-java.yml b/.github/workflows/ci-build-next-java.yml deleted file mode 100644 index 712a7cb..0000000 --- a/.github/workflows/ci-build-next-java.yml +++ /dev/null @@ -1,39 +0,0 @@ -# This file was generated by Project Keeper. -name: CI Build next Java -on: - push: - branches: [ - main - ] - - pull_request: null -jobs: - next-java-compatibility: - runs-on: ubuntu-latest - defaults: - run: { - shell: bash - } - permissions: { - contents: read - } - concurrency: { - group: '${{ github.workflow }}-${{ github.ref }}', - cancel-in-progress: true - } - steps: - - name: Checkout the repository - uses: actions/checkout@v4 - with: { - fetch-depth: 0 - } - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: { - distribution: temurin, - java-version: '17', - cache: maven - } - - name: Run tests and build with Maven 17 - run: | - mvn --batch-mode clean package -DtrimStackTrace=false -Djava.version=17 diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 05a0e2c..062a061 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -9,7 +9,7 @@ on: pull_request: null jobs: matrix-build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest defaults: run: { shell: bash @@ -25,12 +25,12 @@ jobs: fail-fast: false matrix: exasol_db_version: [ - 8.26.0, - 7.1.26 + 8.32.0, + 7.1.30 ] env: { - DEFAULT_EXASOL_DB_VERSION: 8.26.0 + DEFAULT_EXASOL_DB_VERSION: 8.32.0 } steps: - name: Free Disk Space @@ -67,6 +67,11 @@ jobs: id: enable-testcontainer-reuse, run: echo 'testcontainers.reuse.enable=true' > "$HOME/.testcontainers.properties" } + - { + name: Fix VM Crash in UDFs, + id: fix-vm-crash, + run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 + } - name: Run tests and build with Maven id: build-pk-verify run: | @@ -103,8 +108,61 @@ jobs: path: '${{ steps.build-pk-verify.outputs.release-artifacts }}', retention-days: 5 } + - name: Configure broken links checker + id: configure-link-check + run: | + mkdir -p ./target + echo '{"aliveStatusCodes": [429, 200], "ignorePatterns": [' \ + '{"pattern": "^https?://(www|dev).mysql.com/"},' \ + '{"pattern": "^https?://(www.)?opensource.org"}' \ + '{"pattern": "^https?://(www.)?eclipse.org"}' \ + '{"pattern": "^https?://projects.eclipse.org"}' \ + ']}' > ./target/broken_links_checker.json + - uses: gaurav-nelson/github-action-markdown-link-check@v1 + id: run-link-check + with: { + use-quiet-mode: yes, + use-verbose-mode: yes, + config-file: ./target/broken_links_checker.json + } + next-java-compatibility: + runs-on: ubuntu-latest + defaults: + run: { + shell: bash + } + permissions: { + contents: read + } + concurrency: { + group: '${{ github.workflow }}-next-java-${{ github.ref }}', + cancel-in-progress: true + } + steps: + - name: Checkout the repository + id: checkout + uses: actions/checkout@v4 + with: { + fetch-depth: 0 + } + - name: Set up JDK 17 + id: setup-java + uses: actions/setup-java@v4 + with: { + distribution: temurin, + java-version: '17', + 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 + } build: - needs: matrix-build + needs: [ + matrix-build, + next-java-compatibility + ] runs-on: ubuntu-latest defaults: run: { @@ -119,11 +177,13 @@ jobs: } steps: - name: Checkout the repository + id: checkout uses: actions/checkout@v4 with: { fetch-depth: 0 } - name: Set up JDKs + id: setup-java uses: actions/setup-java@v4 with: distribution: temurin @@ -133,6 +193,7 @@ jobs: cache: maven - name: Check if release is needed id: check-release + if: ${{ github.ref == 'refs/heads/main' }} run: | if mvn --batch-mode com.exasol:project-keeper-maven-plugin:verify-release --projects .; then echo "### ✅ Release preconditions met, start release" >> "$GITHUB_STEP_SUMMARY" diff --git a/.project-keeper.yml b/.project-keeper.yml index 8531de6..e9264e9 100644 --- a/.project-keeper.yml +++ b/.project-keeper.yml @@ -7,9 +7,16 @@ sources: linkReplacements: - "https://github.com/hamcrest/JavaHamcrest/hamcrest-all|https://github.com/hamcrest/JavaHamcrest" build: - runnerOs: ubuntu-20.04 exasolDbVersions: - - "8.26.0" - - "7.1.26" -excludes: - - "E-PK-CORE-17: Missing required file: 'release_config.yml'" + - "8.32.0" + - "7.1.30" + workflows: + - name: ci-build.yml + stepCustomizations: + - action: INSERT_AFTER + job: matrix-build + stepId: enable-testcontainer-reuse + content: + name: Fix VM Crash in UDFs + id: fix-vm-crash + run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index 43365b0..6d0c568 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -2,14 +2,14 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.builder.annotationPath.allLocations=disabled org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore -org.eclipse.jdt.core.compiler.annotation.nonnull=javax.annotation.Nonnull +org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull org.eclipse.jdt.core.compiler.annotation.nonnull.secondary= -org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=javax.annotation.ParametersAreNonnullByDefault +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary= org.eclipse.jdt.core.compiler.annotation.notowning=org.eclipse.jdt.annotation.NotOwning -org.eclipse.jdt.core.compiler.annotation.nullable=javax.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable org.eclipse.jdt.core.compiler.annotation.nullable.secondary= -org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled +org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.annotation.owning=org.eclipse.jdt.annotation.Owning org.eclipse.jdt.core.compiler.annotation.resourceanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled diff --git a/dependencies.md b/dependencies.md index af7d03f..db51a8a 100644 --- a/dependencies.md +++ b/dependencies.md @@ -35,33 +35,33 @@ ## Plugin Dependencies -| Dependency | License | -| ------------------------------------------------------- | ---------------------------------------------- | -| [Apache Maven Clean Plugin][30] | [Apache-2.0][12] | -| [Apache Maven Install Plugin][31] | [Apache-2.0][12] | -| [Apache Maven Resources Plugin][32] | [Apache-2.0][12] | -| [Apache Maven Site Plugin][33] | [Apache License, Version 2.0][12] | -| [SonarQube Scanner for Maven][34] | [GNU LGPL 3][35] | -| [Apache Maven Toolchains Plugin][36] | [Apache-2.0][12] | -| [Maven Dependency Plugin][37] | [The Apache Software License, Version 2.0][38] | -| [Project Keeper Maven plugin][39] | [The MIT License][40] | -| [Apache Maven Compiler Plugin][41] | [Apache-2.0][12] | -| [Apache Maven Enforcer Plugin][42] | [Apache-2.0][12] | -| [Maven Flatten Plugin][43] | [Apache Software Licenese][12] | -| [org.sonatype.ossindex.maven:ossindex-maven-plugin][44] | [ASL2][38] | -| [Maven Surefire Plugin][45] | [Apache-2.0][12] | -| [Versions Maven Plugin][46] | [Apache License, Version 2.0][12] | -| [duplicate-finder-maven-plugin Maven Mojo][47] | [Apache License 2.0][48] | -| [Apache Maven Deploy Plugin][49] | [Apache-2.0][12] | -| [Apache Maven GPG Plugin][50] | [Apache-2.0][12] | -| [Apache Maven Source Plugin][51] | [Apache License, Version 2.0][12] | -| [Apache Maven Javadoc Plugin][52] | [Apache-2.0][12] | -| [Nexus Staging Maven Plugin][53] | [Eclipse Public License][54] | -| [Maven Failsafe Plugin][55] | [Apache-2.0][12] | -| [JaCoCo :: Maven Plugin][56] | [EPL-2.0][6] | -| [Quality Summarizer Maven Plugin][57] | [MIT License][58] | -| [error-code-crawler-maven-plugin][59] | [MIT License][60] | -| [Reproducible Build Maven Plugin][61] | [Apache 2.0][38] | +| Dependency | License | +| ------------------------------------------------------- | --------------------------------- | +| [Apache Maven Clean Plugin][30] | [Apache-2.0][12] | +| [Apache Maven Install Plugin][31] | [Apache-2.0][12] | +| [Apache Maven Resources Plugin][32] | [Apache-2.0][12] | +| [Apache Maven Site Plugin][33] | [Apache-2.0][12] | +| [SonarQube Scanner for Maven][34] | [GNU LGPL 3][35] | +| [Apache Maven Toolchains Plugin][36] | [Apache-2.0][12] | +| [Apache Maven Dependency Plugin][37] | [Apache-2.0][12] | +| [Project Keeper Maven plugin][38] | [The MIT License][39] | +| [Apache Maven Compiler Plugin][40] | [Apache-2.0][12] | +| [Apache Maven Enforcer Plugin][41] | [Apache-2.0][12] | +| [Maven Flatten Plugin][42] | [Apache Software Licenese][12] | +| [org.sonatype.ossindex.maven:ossindex-maven-plugin][43] | [ASL2][44] | +| [Maven Surefire Plugin][45] | [Apache-2.0][12] | +| [Versions Maven Plugin][46] | [Apache License, Version 2.0][12] | +| [duplicate-finder-maven-plugin Maven Mojo][47] | [Apache License 2.0][48] | +| [Apache Maven Deploy Plugin][49] | [Apache-2.0][12] | +| [Apache Maven GPG Plugin][50] | [Apache-2.0][12] | +| [Apache Maven Source Plugin][51] | [Apache License, Version 2.0][12] | +| [Apache Maven Javadoc Plugin][52] | [Apache-2.0][12] | +| [Nexus Staging Maven Plugin][53] | [Eclipse Public License][54] | +| [Maven Failsafe Plugin][55] | [Apache-2.0][12] | +| [JaCoCo :: Maven Plugin][56] | [EPL-2.0][6] | +| [Quality Summarizer Maven Plugin][57] | [MIT License][58] | +| [error-code-crawler-maven-plugin][59] | [MIT License][60] | +| [Reproducible Build Maven Plugin][61] | [Apache 2.0][44] | [0]: https://github.com/eclipse-ee4j/jsonp [1]: https://projects.eclipse.org/license/epl-2.0 @@ -97,17 +97,17 @@ [31]: https://maven.apache.org/plugins/maven-install-plugin/ [32]: https://maven.apache.org/plugins/maven-resources-plugin/ [33]: https://maven.apache.org/plugins/maven-site-plugin/ -[34]: http://sonarsource.github.io/sonar-scanner-maven/ +[34]: http://docs.sonarqube.org/display/PLUG/Plugin+Library/sonar-maven-plugin [35]: http://www.gnu.org/licenses/lgpl.txt [36]: https://maven.apache.org/plugins/maven-toolchains-plugin/ -[37]: http://maven.apache.org/plugins/maven-dependency-plugin/ -[38]: http://www.apache.org/licenses/LICENSE-2.0.txt -[39]: https://github.com/exasol/project-keeper/ -[40]: https://github.com/exasol/project-keeper/blob/main/LICENSE -[41]: https://maven.apache.org/plugins/maven-compiler-plugin/ -[42]: https://maven.apache.org/enforcer/maven-enforcer-plugin/ -[43]: https://www.mojohaus.org/flatten-maven-plugin/ -[44]: https://sonatype.github.io/ossindex-maven/maven-plugin/ +[37]: https://maven.apache.org/plugins/maven-dependency-plugin/ +[38]: https://github.com/exasol/project-keeper/ +[39]: https://github.com/exasol/project-keeper/blob/main/LICENSE +[40]: https://maven.apache.org/plugins/maven-compiler-plugin/ +[41]: https://maven.apache.org/enforcer/maven-enforcer-plugin/ +[42]: https://www.mojohaus.org/flatten-maven-plugin/ +[43]: https://sonatype.github.io/ossindex-maven/maven-plugin/ +[44]: http://www.apache.org/licenses/LICENSE-2.0.txt [45]: https://maven.apache.org/surefire/maven-surefire-plugin/ [46]: https://www.mojohaus.org/versions/versions-maven-plugin/ [47]: https://basepom.github.io/duplicate-finder-maven-plugin diff --git a/doc/changes/changelog.md b/doc/changes/changelog.md index 616e9f0..c34054b 100644 --- a/doc/changes/changelog.md +++ b/doc/changes/changelog.md @@ -1,5 +1,6 @@ # Changes +* [0.6.15](changes_0.6.15.md) * [0.6.14](changes_0.6.14.md) * [0.6.13](changes_0.6.13.md) * [0.6.12](changes_0.6.12.md) diff --git a/doc/changes/changes_0.6.15.md b/doc/changes/changes_0.6.15.md new file mode 100644 index 0000000..6123997 --- /dev/null +++ b/doc/changes/changes_0.6.15.md @@ -0,0 +1,40 @@ +# Udf Debugging Java 0.6.15, released 2025-02-12 + +Code name: Fix vulnerabilities CVE-2025-25193 and CVE-2025-24970 in test dependencies + +## Summary + +This release fixes the following vulnerabilities in test dependencies: + +* `io.netty:netty-common:jar:4.1.115.Final:test`: CVE-2025-25193 +* `io.netty:netty-handler:jar:4.1.115.Final:test`: CVE-2025-24970 + +## Security + +* #69: Fixed CVE-2025-25193 in `io.netty:netty-common:jar:4.1.115.Final:test` +* #70: Fixed CVE-2025-24970 in `io.netty:netty-handler:jar:4.1.115.Final:test` + +## Dependency Updates + +### Compile Dependency Updates + +* Updated `com.exasol:bucketfs-java:3.2.0` to `3.2.1` + +### Test Dependency Updates + +* Updated `com.exasol:exasol-testcontainers:7.1.1` to `7.1.3` +* Updated `org.junit.jupiter:junit-jupiter-engine:5.11.3` to `5.11.4` +* Updated `org.junit.jupiter:junit-jupiter-params:5.11.3` to `5.11.4` +* Updated `org.mockito:mockito-junit-jupiter:5.14.2` to `5.15.2` +* Updated `org.testcontainers:junit-jupiter:1.20.3` to `1.20.4` + +### Plugin Dependency Updates + +* Updated `com.exasol:project-keeper-maven-plugin:4.4.0` to `4.5.0` +* Updated `org.apache.maven.plugins:maven-deploy-plugin:3.1.2` to `3.1.3` +* Updated `org.apache.maven.plugins:maven-failsafe-plugin:3.5.1` to `3.5.2` +* Updated `org.apache.maven.plugins:maven-javadoc-plugin:3.10.1` to `3.11.1` +* Updated `org.apache.maven.plugins:maven-site-plugin:3.9.1` to `3.21.0` +* Updated `org.apache.maven.plugins:maven-surefire-plugin:3.5.1` to `3.5.2` +* Updated `org.codehaus.mojo:versions-maven-plugin:2.17.1` to `2.18.0` +* Updated `org.sonarsource.scanner.maven:sonar-maven-plugin:4.0.0.4121` to `5.0.0.4389` diff --git a/pk_generated_parent.pom b/pk_generated_parent.pom index 32c5a9f..b7e005e 100644 --- a/pk_generated_parent.pom +++ b/pk_generated_parent.pom @@ -3,7 +3,7 @@ 4.0.0 com.exasol udf-debugging-java-generated-parent - 0.6.14 + 0.6.15 pom UTF-8 @@ -65,12 +65,12 @@ org.apache.maven.plugins maven-site-plugin - 3.9.1 + 3.21.0 org.sonarsource.scanner.maven sonar-maven-plugin - 4.0.0.4121 + 5.0.0.4389 org.apache.maven.plugins @@ -170,7 +170,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.1 + 3.5.2 @@ -181,7 +181,7 @@ org.codehaus.mojo versions-maven-plugin - 2.17.1 + 2.18.0 display-updates @@ -235,7 +235,7 @@ org.apache.maven.plugins maven-deploy-plugin - 3.1.2 + 3.1.3 true @@ -279,7 +279,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.10.1 + 3.11.1 attach-javadocs @@ -322,7 +322,7 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.5.1 + 3.5.2 -Djava.util.logging.config.file=src/test/resources/logging.properties ${argLine} diff --git a/pom.xml b/pom.xml index 40a8ca8..7c43be6 100644 --- a/pom.xml +++ b/pom.xml @@ -2,12 +2,12 @@ 4.0.0 udf-debugging-java - 0.6.14 + 0.6.15 udf-debugging-java Utilities for debugging, profiling and code coverage measure for UDFs. https://github.com/exasol/udf-debugging-java/ - 5.11.3 + 5.11.4 0.8.12 @@ -42,12 +42,12 @@ com.exasol bucketfs-java - 3.2.0 + 3.2.1 com.exasol exasol-test-setup-abstraction-java - 2.1.6 + 2.1.7 From b23448a06ab76280d1a017e1f2c1794e962a194c Mon Sep 17 00:00:00 2001 From: Christoph Pirkl <4711730+kaklakariada@users.noreply.github.com> Date: Mon, 2 Jun 2025 12:02:55 +0200 Subject: [PATCH 37/37] #74: Upgrade dependencies (#76) --- .gitattributes | 1 + .github/workflows/broken_links_checker.yml | 51 ++++++----- .github/workflows/ci-build.yml | 21 +++-- .github/workflows/dependencies_check.yml | 6 +- .project-keeper.yml | 18 +++- .settings/org.eclipse.jdt.core.prefs | 4 +- SECURITY.md | 25 ++++++ dependencies.md | 89 ++++++++++--------- doc/changes/changelog.md | 1 + doc/changes/changes_0.6.16.md | 48 ++++++++++ pk_generated_parent.pom | 61 +++++++++---- pom.xml | 22 ++--- .../exasol/udfdebugging/PushDownTesting.java | 3 + .../modules/coverage/CoverageModule.java | 3 +- .../modules/coverage/CoverageModuleTest.java | 20 +++-- src/test/resources/logging.properties | 2 +- 16 files changed, 257 insertions(+), 118 deletions(-) create mode 100644 SECURITY.md create mode 100644 doc/changes/changes_0.6.16.md diff --git a/.gitattributes b/.gitattributes index be0dddc..fd991dc 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,4 @@ +SECURITY.md linguist-generated=true dependencies.md linguist-generated=true doc/changes/changelog.md linguist-generated=true pk_generated_parent.pom linguist-generated=true diff --git a/.github/workflows/broken_links_checker.yml b/.github/workflows/broken_links_checker.yml index 90488ca..09e4bac 100644 --- a/.github/workflows/broken_links_checker.yml +++ b/.github/workflows/broken_links_checker.yml @@ -1,35 +1,44 @@ -# Generated by Project Keeper -# https://github.com/exasol/project-keeper/blob/main/project-keeper/src/main/resources/templates/.github/workflows/broken_links_checker.yml +# This file was generated by Project Keeper. name: Broken Links Checker - on: schedule: - - cron: "0 5 * * 0" - + - { + cron: 0 5 * * 0 + } + workflow_dispatch: null jobs: linkChecker: runs-on: ubuntu-latest - permissions: + permissions: { contents: read + } defaults: - run: - shell: "bash" - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + run: { + shell: bash + } + concurrency: { + group: '${{ github.workflow }}-${{ github.ref }}', cancel-in-progress: true + } steps: - - uses: actions/checkout@v4 - - name: Configure broken links checker + - { + id: checkout, + uses: actions/checkout@v4 + } + - id: configure-broken-links-checker + name: Configure broken links checker run: | mkdir -p ./target echo '{"aliveStatusCodes": [429, 200], "ignorePatterns": [' \ - '{"pattern": "^https?://(www|dev).mysql.com/"},' \ - '{"pattern": "^https?://(www.)?opensource.org"}' \ - '{"pattern": "^https?://(www.)?eclipse.org"}' \ - '{"pattern": "^https?://projects.eclipse.org"}' \ - ']}' > ./target/broken_links_checker.json - - uses: gaurav-nelson/github-action-markdown-link-check@v1 - with: - use-quiet-mode: "yes" - use-verbose-mode: "yes" + '{"pattern": "^https?://(www|dev).mysql.com/"},' \ + '{"pattern": "^https?://(www.)?opensource.org"}' \ + '{"pattern": "^https?://(www.)?eclipse.org"}' \ + '{"pattern": "^https?://projects.eclipse.org"}' \ + ']}' > ./target/broken_links_checker.json + - id: run-broken-links-checker + uses: gaurav-nelson/github-action-markdown-link-check@v1 + with: { + use-quiet-mode: yes, + use-verbose-mode: yes, config-file: ./target/broken_links_checker.json + } diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 463b863..63f3e50 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -6,10 +6,17 @@ on: main ] - pull_request: null + pull_request: + types: [ + opened, + synchronize, + reopened, + ready_for_review + ] + jobs: matrix-build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 defaults: run: { shell: bash @@ -25,12 +32,11 @@ jobs: fail-fast: false matrix: exasol_db_version: [ - 8.32.0, - 7.1.30 + 8.34.0 ] env: { - DEFAULT_EXASOL_DB_VERSION: 8.32.0 + DEFAULT_EXASOL_DB_VERSION: 8.34.0 } steps: - name: Free Disk Space @@ -67,6 +73,11 @@ jobs: id: enable-testcontainer-reuse, run: echo 'testcontainers.reuse.enable=true' > "$HOME/.testcontainers.properties" } + - { + name: Fix VM Crash in UDFs, + id: fix-vm-crash, + run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 + } - name: Run tests and build with Maven id: build-pk-verify run: | diff --git a/.github/workflows/dependencies_check.yml b/.github/workflows/dependencies_check.yml index 02c5aa0..0832e80 100644 --- a/.github/workflows/dependencies_check.yml +++ b/.github/workflows/dependencies_check.yml @@ -46,9 +46,9 @@ jobs: org.sonatype.ossindex.maven:ossindex-maven-plugin:audit-aggregate \ -Dossindex.reportFile=$(pwd)/ossindex-report.json \ -Dossindex.fail=false - - name: Report Security Issues - id: security-issues - uses: exasol/python-toolbox/.github/actions/security-issues@main + - name: Create GitHub Issues + id: create-security-issues + uses: exasol/python-toolbox/.github/actions/security-issues@1.1.0 with: { format: maven, command: cat ossindex-report.json, diff --git a/.project-keeper.yml b/.project-keeper.yml index 850a718..bab3287 100644 --- a/.project-keeper.yml +++ b/.project-keeper.yml @@ -5,8 +5,18 @@ sources: - maven_central - integration_tests build: - # UDFs in Exasol 7.1 require Ubuntu 20.04 - runnerOs: ubuntu-20.04 + runnerOs: ubuntu-24.04 exasolDbVersions: - - "8.32.0" - - "7.1.30" + - "8.34.0" + # UDFs in Exasol 7.1 with Ubuntu 20.04 will be fixed in the next Docker-DB release + # - "7.1.30" + workflows: + - name: ci-build.yml + stepCustomizations: + - action: INSERT_AFTER + job: matrix-build + stepId: enable-testcontainer-reuse + content: + name: Fix VM Crash in UDFs + id: fix-vm-crash + run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index 6d0c568..7644ed3 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -241,7 +241,7 @@ org.eclipse.jdt.core.formatter.indent_empty_lines=false org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true org.eclipse.jdt.core.formatter.indentation.size=4 org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert @@ -447,7 +447,7 @@ org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constan org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert org.eclipse.jdt.core.formatter.join_lines_in_comments=true -org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=false org.eclipse.jdt.core.formatter.keep_annotation_declaration_on_one_line=one_line_never org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line=one_line_never org.eclipse.jdt.core.formatter.keep_code_block_on_one_line=one_line_never diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..f0edc21 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,25 @@ +# Security + +If you believe you have found a new security vulnerability in this repository, please report it to us as follows. + +## Reporting Security Issues + +* Please do **not** report security vulnerabilities through public GitHub issues. + +* Please create a draft security advisory on the Github page: the reporting form is under `> Security > Advisories`. The URL is https://github.com/exasol/udf-debugging-java/security/advisories/new. + +* If you prefer to email, please send your report to `infosec@exasol.com`. + +## Guidelines + +* When reporting a vulnerability, please include as much information as possible, including the complete steps to reproduce the issue. + +* Avoid sending us executables. + +* Feel free to include any script you wrote and used but avoid sending us scripts that download and run binaries. + +* We will prioritise reports that show how the exploits work in realistic environments. + +* We prefer all communications to be in English. + +* We do not offer financial rewards. We are happy to acknowledge your research publicly when possible. diff --git a/dependencies.md b/dependencies.md index 8e4a0e0..3778478 100644 --- a/dependencies.md +++ b/dependencies.md @@ -11,7 +11,7 @@ | [BucketFS Java][7] | [MIT License][8] | | [exasol-test-setup-abstraction-java][9] | [MIT License][10] | | [Apache Commons Compress][11] | [Apache-2.0][12] | -| [SLF4J JDK14 Provider][13] | [MIT License][14] | +| [SLF4J JDK14 Provider][13] | [MIT][14] | ## Test Dependencies @@ -35,33 +35,34 @@ ## Plugin Dependencies -| Dependency | License | -| ------------------------------------------------------- | --------------------------------- | -| [Apache Maven Clean Plugin][30] | [Apache-2.0][12] | -| [Apache Maven Install Plugin][31] | [Apache-2.0][12] | -| [Apache Maven Resources Plugin][32] | [Apache-2.0][12] | -| [Apache Maven Site Plugin][33] | [Apache-2.0][12] | -| [SonarQube Scanner for Maven][34] | [GNU LGPL 3][35] | -| [Apache Maven Toolchains Plugin][36] | [Apache-2.0][12] | -| [Apache Maven Dependency Plugin][37] | [Apache-2.0][12] | -| [Project Keeper Maven plugin][38] | [The MIT License][39] | -| [Apache Maven Compiler Plugin][40] | [Apache-2.0][12] | -| [Apache Maven Enforcer Plugin][41] | [Apache-2.0][12] | -| [Maven Flatten Plugin][42] | [Apache Software Licenese][12] | -| [org.sonatype.ossindex.maven:ossindex-maven-plugin][43] | [ASL2][44] | -| [Maven Surefire Plugin][45] | [Apache-2.0][12] | -| [Versions Maven Plugin][46] | [Apache License, Version 2.0][12] | -| [duplicate-finder-maven-plugin Maven Mojo][47] | [Apache License 2.0][48] | -| [Apache Maven Deploy Plugin][49] | [Apache-2.0][12] | -| [Apache Maven GPG Plugin][50] | [Apache-2.0][12] | -| [Apache Maven Source Plugin][51] | [Apache License, Version 2.0][12] | -| [Apache Maven Javadoc Plugin][52] | [Apache-2.0][12] | -| [Nexus Staging Maven Plugin][53] | [Eclipse Public License][54] | -| [Maven Failsafe Plugin][55] | [Apache-2.0][12] | -| [JaCoCo :: Maven Plugin][56] | [EPL-2.0][6] | -| [Quality Summarizer Maven Plugin][57] | [MIT License][58] | -| [error-code-crawler-maven-plugin][59] | [MIT License][60] | -| [Reproducible Build Maven Plugin][61] | [Apache 2.0][44] | +| Dependency | License | +| ------------------------------------------------------- | ------------------------------------------- | +| [Apache Maven Clean Plugin][30] | [Apache-2.0][12] | +| [Apache Maven Install Plugin][31] | [Apache-2.0][12] | +| [Apache Maven Resources Plugin][32] | [Apache-2.0][12] | +| [Apache Maven Site Plugin][33] | [Apache-2.0][12] | +| [SonarQube Scanner for Maven][34] | [GNU LGPL 3][35] | +| [Apache Maven Toolchains Plugin][36] | [Apache-2.0][12] | +| [Apache Maven Dependency Plugin][37] | [Apache-2.0][12] | +| [Project Keeper Maven plugin][38] | [The MIT License][39] | +| [Apache Maven Compiler Plugin][40] | [Apache-2.0][12] | +| [Apache Maven Enforcer Plugin][41] | [Apache-2.0][12] | +| [Maven Flatten Plugin][42] | [Apache Software Licenese][12] | +| [org.sonatype.ossindex.maven:ossindex-maven-plugin][43] | [ASL2][44] | +| [Maven Surefire Plugin][45] | [Apache-2.0][12] | +| [Versions Maven Plugin][46] | [Apache License, Version 2.0][12] | +| [duplicate-finder-maven-plugin Maven Mojo][47] | [Apache License 2.0][48] | +| [Apache Maven Artifact Plugin][49] | [Apache-2.0][12] | +| [Apache Maven Deploy Plugin][50] | [Apache-2.0][12] | +| [Apache Maven GPG Plugin][51] | [Apache-2.0][12] | +| [Apache Maven Source Plugin][52] | [Apache License, Version 2.0][12] | +| [Apache Maven Javadoc Plugin][53] | [Apache-2.0][12] | +| [Nexus Staging Maven Plugin][54] | [Eclipse Public License][55] | +| [Maven Failsafe Plugin][56] | [Apache-2.0][12] | +| [JaCoCo :: Maven Plugin][57] | [EPL-2.0][6] | +| [Quality Summarizer Maven Plugin][58] | [MIT License][59] | +| [error-code-crawler-maven-plugin][60] | [MIT License][61] | +| [Git Commit Id Maven Plugin][62] | [GNU Lesser General Public License 3.0][63] | [0]: https://github.com/eclipse-ee4j/jsonp [1]: https://projects.eclipse.org/license/epl-2.0 @@ -77,7 +78,7 @@ [11]: https://commons.apache.org/proper/commons-compress/ [12]: https://www.apache.org/licenses/LICENSE-2.0.txt [13]: http://www.slf4j.org -[14]: http://www.opensource.org/licenses/mit-license.php +[14]: https://opensource.org/license/mit [15]: https://junit.org/junit5/ [16]: https://www.eclipse.org/legal/epl-v20.html [17]: https://github.com/mockito/mockito @@ -97,7 +98,7 @@ [31]: https://maven.apache.org/plugins/maven-install-plugin/ [32]: https://maven.apache.org/plugins/maven-resources-plugin/ [33]: https://maven.apache.org/plugins/maven-site-plugin/ -[34]: http://docs.sonarqube.org/display/PLUG/Plugin+Library/sonar-maven-plugin +[34]: http://docs.sonarqube.org/display/PLUG/Plugin+Library/sonar-scanner-maven/sonar-maven-plugin [35]: http://www.gnu.org/licenses/lgpl.txt [36]: https://maven.apache.org/plugins/maven-toolchains-plugin/ [37]: https://maven.apache.org/plugins/maven-dependency-plugin/ @@ -112,16 +113,18 @@ [46]: https://www.mojohaus.org/versions/versions-maven-plugin/ [47]: https://basepom.github.io/duplicate-finder-maven-plugin [48]: http://www.apache.org/licenses/LICENSE-2.0.html -[49]: https://maven.apache.org/plugins/maven-deploy-plugin/ -[50]: https://maven.apache.org/plugins/maven-gpg-plugin/ -[51]: https://maven.apache.org/plugins/maven-source-plugin/ -[52]: https://maven.apache.org/plugins/maven-javadoc-plugin/ -[53]: http://www.sonatype.com/public-parent/nexus-maven-plugins/nexus-staging/nexus-staging-maven-plugin/ -[54]: http://www.eclipse.org/legal/epl-v10.html -[55]: https://maven.apache.org/surefire/maven-failsafe-plugin/ -[56]: https://www.jacoco.org/jacoco/trunk/doc/maven.html -[57]: https://github.com/exasol/quality-summarizer-maven-plugin/ -[58]: https://github.com/exasol/quality-summarizer-maven-plugin/blob/main/LICENSE -[59]: https://github.com/exasol/error-code-crawler-maven-plugin/ -[60]: https://github.com/exasol/error-code-crawler-maven-plugin/blob/main/LICENSE -[61]: http://zlika.github.io/reproducible-build-maven-plugin +[49]: https://maven.apache.org/plugins/maven-artifact-plugin/ +[50]: https://maven.apache.org/plugins/maven-deploy-plugin/ +[51]: https://maven.apache.org/plugins/maven-gpg-plugin/ +[52]: https://maven.apache.org/plugins/maven-source-plugin/ +[53]: https://maven.apache.org/plugins/maven-javadoc-plugin/ +[54]: http://www.sonatype.com/public-parent/nexus-maven-plugins/nexus-staging/nexus-staging-maven-plugin/ +[55]: http://www.eclipse.org/legal/epl-v10.html +[56]: https://maven.apache.org/surefire/maven-failsafe-plugin/ +[57]: https://www.jacoco.org/jacoco/trunk/doc/maven.html +[58]: https://github.com/exasol/quality-summarizer-maven-plugin/ +[59]: https://github.com/exasol/quality-summarizer-maven-plugin/blob/main/LICENSE +[60]: https://github.com/exasol/error-code-crawler-maven-plugin/ +[61]: https://github.com/exasol/error-code-crawler-maven-plugin/blob/main/LICENSE +[62]: https://github.com/git-commit-id/git-commit-id-maven-plugin +[63]: http://www.gnu.org/licenses/lgpl-3.0.txt diff --git a/doc/changes/changelog.md b/doc/changes/changelog.md index c34054b..39e84a8 100644 --- a/doc/changes/changelog.md +++ b/doc/changes/changelog.md @@ -1,5 +1,6 @@ # Changes +* [0.6.16](changes_0.6.16.md) * [0.6.15](changes_0.6.15.md) * [0.6.14](changes_0.6.14.md) * [0.6.13](changes_0.6.13.md) diff --git a/doc/changes/changes_0.6.16.md b/doc/changes/changes_0.6.16.md new file mode 100644 index 0000000..f085995 --- /dev/null +++ b/doc/changes/changes_0.6.16.md @@ -0,0 +1,48 @@ +# Udf Debugging Java 0.6.16, released 2025-06-02 + +Code name: Security updates on top of 0.6.15 + +## Summary + +This release is a security update. We updated the dependencies of the project to fix transitive security issues. + +We also added an exception for the OSSIndex for CVE-2024-55551, which is a false positive in Exasol's JDBC driver. +This issue has been fixed quite a while back now, but the OSSIndex unfortunately does not contain the fix version of 24.2.1 (2024-12-10) set. + +## Security + +* #74: Fix CVE-2024-55551 in com.exasol:exasol-jdbc:jar:24.2.1 + +## Dependency Updates + +### Compile Dependency Updates + +* Updated `org.jacoco:org.jacoco.core:0.8.12` to `0.8.13` +* Updated `org.slf4j:slf4j-jdk14:2.0.16` to `2.0.17` + +### Test Dependency Updates + +* Updated `com.exasol:exasol-testcontainers:7.1.3` to `7.1.5` +* Updated `com.exasol:test-db-builder-java:3.6.0` to `3.6.1` +* Updated `org.jacoco:org.jacoco.agent:0.8.12` to `0.8.13` +* Updated `org.junit.jupiter:junit-jupiter-engine:5.11.4` to `5.13.0` +* Updated `org.junit.jupiter:junit-jupiter-params:5.11.4` to `5.13.0` +* Updated `org.mockito:mockito-junit-jupiter:5.15.2` to `5.18.0` +* Updated `org.testcontainers:junit-jupiter:1.20.4` to `1.21.1` + +### Plugin Dependency Updates + +* Updated `com.exasol:project-keeper-maven-plugin:4.5.0` to `5.1.0` +* Added `io.github.git-commit-id:git-commit-id-maven-plugin:9.0.1` +* Removed `io.github.zlika:reproducible-build-maven-plugin:0.17` +* Added `org.apache.maven.plugins:maven-artifact-plugin:3.6.0` +* Updated `org.apache.maven.plugins:maven-clean-plugin:3.4.0` to `3.4.1` +* Updated `org.apache.maven.plugins:maven-compiler-plugin:3.13.0` to `3.14.0` +* Updated `org.apache.maven.plugins:maven-deploy-plugin:3.1.3` to `3.1.4` +* Updated `org.apache.maven.plugins:maven-failsafe-plugin:3.5.2` to `3.5.3` +* Updated `org.apache.maven.plugins:maven-install-plugin:3.1.3` to `3.1.4` +* Updated `org.apache.maven.plugins:maven-javadoc-plugin:3.11.1` to `3.11.2` +* Updated `org.apache.maven.plugins:maven-surefire-plugin:3.5.2` to `3.5.3` +* Updated `org.codehaus.mojo:flatten-maven-plugin:1.6.0` to `1.7.0` +* Updated `org.jacoco:jacoco-maven-plugin:0.8.12` to `0.8.13` +* Updated `org.sonarsource.scanner.maven:sonar-maven-plugin:5.0.0.4389` to `5.1.0.4751` diff --git a/pk_generated_parent.pom b/pk_generated_parent.pom index b7e005e..26ca8c2 100644 --- a/pk_generated_parent.pom +++ b/pk_generated_parent.pom @@ -3,11 +3,12 @@ 4.0.0 com.exasol udf-debugging-java-generated-parent - 0.6.15 + 0.6.16 pom UTF-8 UTF-8 + ${git.commit.time} 11 exasol https://sonarcloud.io @@ -50,12 +51,12 @@ org.apache.maven.plugins maven-clean-plugin - 3.4.0 + 3.4.1 org.apache.maven.plugins maven-install-plugin - 3.1.3 + 3.1.4 org.apache.maven.plugins @@ -70,7 +71,7 @@ org.sonarsource.scanner.maven sonar-maven-plugin - 5.0.0.4389 + 5.1.0.4751 org.apache.maven.plugins @@ -94,7 +95,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.13.0 + 3.14.0 ${java.version} ${java.version} @@ -118,7 +119,7 @@ - 3.6.3 + 3.8.7 17 @@ -131,7 +132,7 @@ org.codehaus.mojo flatten-maven-plugin - 1.6.0 + 1.7.0 true oss @@ -170,7 +171,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.2 + 3.5.3 @@ -185,7 +186,7 @@ display-updates - package + verify display-plugin-updates display-dependency-updates @@ -202,6 +203,7 @@ true true true + false false true true @@ -232,10 +234,24 @@ false + + org.apache.maven.plugins + maven-artifact-plugin + 3.6.0 + + + check-build-plan + verify + + check-buildplan + + + + org.apache.maven.plugins maven-deploy-plugin - 3.1.3 + 3.1.4 true @@ -279,7 +295,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.11.1 + 3.11.2 attach-javadocs @@ -322,7 +338,7 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.5.2 + 3.5.3 -Djava.util.logging.config.file=src/test/resources/logging.properties ${argLine} @@ -342,7 +358,7 @@ org.jacoco jacoco-maven-plugin - 0.8.12 + 0.8.13 prepare-agent @@ -407,18 +423,25 @@ - io.github.zlika - reproducible-build-maven-plugin - 0.17 + io.github.git-commit-id + git-commit-id-maven-plugin + 9.0.1 - strip-jar - package + get-the-git-infos - strip-jar + revision + initialize + + true + UTC + + git.commit.time + + diff --git a/pom.xml b/pom.xml index 07c4024..b55779c 100644 --- a/pom.xml +++ b/pom.xml @@ -2,13 +2,13 @@ 4.0.0 udf-debugging-java - 0.6.15 + 0.6.16 udf-debugging-java Utilities for debugging, profiling and code coverage measure for UDFs. https://github.com/exasol/udf-debugging-java/ - 5.11.4 - 0.8.12 + 5.13.0 + 0.8.13 @@ -75,7 +75,7 @@ org.mockito mockito-junit-jupiter - 5.15.2 + 5.18.0 test @@ -88,19 +88,19 @@ com.exasol exasol-testcontainers - 7.1.3 + 7.1.5 test org.testcontainers junit-jupiter - 1.20.4 + 1.21.1 test com.exasol test-db-builder-java - 3.6.0 + 3.6.1 test @@ -113,7 +113,7 @@ org.slf4j slf4j-jdk14 - 2.0.16 + 2.0.17 @@ -139,7 +139,7 @@ com.exasol project-keeper-maven-plugin - 4.5.0 + 5.1.0 @@ -168,6 +168,8 @@ CVE-2017-10355 + + CVE-2024-55551 @@ -176,7 +178,7 @@ udf-debugging-java-generated-parent com.exasol - 0.6.15 + 0.6.16 pk_generated_parent.pom diff --git a/src/main/java/com/exasol/udfdebugging/PushDownTesting.java b/src/main/java/com/exasol/udfdebugging/PushDownTesting.java index 2ac6488..f09f147 100644 --- a/src/main/java/com/exasol/udfdebugging/PushDownTesting.java +++ b/src/main/java/com/exasol/udfdebugging/PushDownTesting.java @@ -9,6 +9,9 @@ * This class contains helper functions for testing virtual schema push down queries. */ public class PushDownTesting { + private PushDownTesting() { + // Not instanciable + } /** * Get the push-down SQL query generated by a Virtual Schema adapter call. diff --git a/src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModule.java b/src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModule.java index 2f3672c..055bd1a 100644 --- a/src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModule.java +++ b/src/main/java/com/exasol/udfdebugging/modules/coverage/CoverageModule.java @@ -1,7 +1,6 @@ package com.exasol.udfdebugging.modules.coverage; import java.io.FileNotFoundException; -import java.io.IOException; import java.net.InetSocketAddress; import java.nio.file.Path; import java.util.concurrent.TimeoutException; @@ -63,7 +62,7 @@ private void uploadAgentToBucketFs(final Bucket bucket) { } @Override - public void close() throws IOException { + public void close() { // nothing to close } } diff --git a/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleTest.java b/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleTest.java index 40129a8..7d09754 100644 --- a/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleTest.java +++ b/src/test/java/com/exasol/udfdebugging/modules/coverage/CoverageModuleTest.java @@ -18,11 +18,14 @@ class CoverageModuleTest { @Test + @SuppressWarnings("try") // auto-closeable resource coverageModule is never referenced in body of try statement void testUpload() throws BucketAccessException, TimeoutException, FileNotFoundException { final Bucket bucket = mock(Bucket.class); - new CoverageModule((port) -> new InetSocketAddress("1.2.3.4", port), bucket); - verify(bucket).uploadFile(Path.of("target", "jacoco-agent", "org.jacoco.agent-runtime.jar"), - "org.jacoco.agent-runtime.jar"); + try (CoverageModule coverageModule = new CoverageModule(port -> new InetSocketAddress("1.2.3.4", port), + bucket)) { + verify(bucket).uploadFile(Path.of("target", "jacoco-agent", "org.jacoco.agent-runtime.jar"), + "org.jacoco.agent-runtime.jar"); + } } @Test @@ -30,9 +33,10 @@ void testGetJvmOptions() { final Bucket bucket = mock(Bucket.class); when(bucket.getBucketFsName()).thenReturn("my_bucketfs"); when(bucket.getBucketName()).thenReturn("my_bucket"); - final CoverageModule coverageModule = new CoverageModule((port) -> new InetSocketAddress("1.2.3.4", port), - bucket); - assertThat(coverageModule.getJvmOptions().collect(Collectors.toList()), contains( - "-javaagent:/buckets/my_bucketfs/my_bucket/org.jacoco.agent-runtime.jar=output=tcpclient,address=1.2.3.4,port=3002")); + try (final CoverageModule coverageModule = new CoverageModule(port -> new InetSocketAddress("1.2.3.4", port), + bucket)) { + assertThat(coverageModule.getJvmOptions().collect(Collectors.toList()), contains( + "-javaagent:/buckets/my_bucketfs/my_bucket/org.jacoco.agent-runtime.jar=output=tcpclient,address=1.2.3.4,port=3002")); + } } -} \ No newline at end of file +} diff --git a/src/test/resources/logging.properties b/src/test/resources/logging.properties index 8c97abe..8d41bf2 100644 --- a/src/test/resources/logging.properties +++ b/src/test/resources/logging.properties @@ -2,5 +2,5 @@ handlers=java.util.logging.ConsoleHandler .level=INFO java.util.logging.ConsoleHandler.level=ALL java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter -java.util.logging.SimpleFormatter.format=%1$tF %1$tT.%1$tL [%4$-7s] %5$s %n +java.util.logging.SimpleFormatter.format=%1$tF %1$tT.%1$tL [%4$-7s] %5$s %6$s%n com.exasol.level=ALL