Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ on:
branches: [ develop, release/** ]
types: [opened, synchronize, reopened, labeled]

permissions:
contents: read

jobs:
build:
runs-on: k8s-runner-build
Expand All @@ -37,12 +40,20 @@ jobs:
&& (github.event.action != 'labeled' || github.event.label.name == 'build')
)
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
ref: ${{ github.event.workflow_run.head_sha }}
persist-credentials: false

- name: Set up JDK 11
uses: actions/setup-java@cf277c60eb25467037889841efdb72551f06f6c3 # v4.9.1
with:
distribution: 'temurin'
java-version: '11'
overwrite-settings: false

- name: Cache
uses: actions/cache@v4
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ github.workflow }}-${{ hashFiles('**/pom.xml') }}
Expand All @@ -53,7 +64,7 @@ jobs:
run: mvn clean test -fae -T 2 -B -V -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.httpconnectionManager.ttlSeconds=25

- name: Archive build artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: always()
with:
name: reports-${{ github.run_id }}
Expand Down
3 changes: 3 additions & 0 deletions amazon-redshift-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
<repository>
<id>redshift</id>
<url>http://redshift-maven-repository.s3-website-us-east-1.amazonaws.com/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>

Expand Down
1 change: 1 addition & 0 deletions aurora-mysql-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
<instructions>
<_exportcontents>
io.cdap.plugin.auroradb.mysql.*;
io.cdap.plugin.db.*;
io.cdap.plugin.db.source.*;
io.cdap.plugin.db.sink.*;
org.apache.commons.lang;
Expand Down
18 changes: 4 additions & 14 deletions cloudsql-mysql-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@
<artifactId>mysql-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
Comment thread
AbhishekKumar9984 marked this conversation as resolved.
Resolved

<!-- test dependencies -->
<dependency>
Expand Down Expand Up @@ -133,20 +137,6 @@

<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
Comment thread
AbhishekKumar9984 marked this conversation as resolved.
Resolved
<configuration>
<instructions>
<_exportcontents>
io.cdap.plugin.*
</_exportcontents>
<Embed-Dependency>*;inline=false;scope=compile</Embed-Dependency>
<Embed-Transitive>true</Embed-Transitive>
<Embed-Directory>lib</Embed-Directory>
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>io.cdap</groupId>
<artifactId>cdap-maven-plugin</artifactId>
Expand Down
15 changes: 0 additions & 15 deletions cloudsql-postgresql-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>31.0.1-jre</version>
</dependency>
Comment thread
AbhishekKumar9984 marked this conversation as resolved.
Resolved
<!-- test dependencies -->
<dependency>
Expand Down Expand Up @@ -138,20 +137,6 @@

<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
<_exportcontents>
io.cdap.plugin.*
</_exportcontents>
<Embed-Dependency>*;inline=false;scope=compile</Embed-Dependency>
<Embed-Transitive>true</Embed-Transitive>
<Embed-Directory>lib</Embed-Directory>
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>io.cdap</groupId>
<artifactId>cdap-maven-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,14 @@
import org.mockito.Mockito;

import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class DBSpecificFailedConnectionTest {
private static final String JDBC_DRIVER_CLASS_NAME = "oracle.jdbc.OracleDriver";
private static final String ARGS_PREFIX = " and arguments: {";
private static final String ARGS_SUFFIX = "}. Error: ";

protected void test(String jdbcClassName, AbstractDBSpecificConnector connector, String expectedErrorMsg)
throws ClassNotFoundException, IOException {
Expand All @@ -45,6 +49,26 @@ protected void test(String jdbcClassName, AbstractDBSpecificConnector connector,
connector.test(context);
List<ValidationFailure> validationFailures = context.getFailureCollector().getValidationFailures();
Assert.assertEquals(1, validationFailures.size());
Assert.assertEquals(expectedErrorMsg, validationFailures.get(0).getMessage());
Assert.assertEquals(normalizeArgumentsOrder(expectedErrorMsg),
normalizeArgumentsOrder(validationFailures.get(0).getMessage()));
}

private static String normalizeArgumentsOrder(String message) {
if (message == null) {
return null;
}
int start = message.indexOf(ARGS_PREFIX);
if (start < 0) {
return message;
}
int argsStart = start + ARGS_PREFIX.length();
int argsEnd = message.indexOf(ARGS_SUFFIX, argsStart);
if (argsEnd < 0) {
return message;
}
String sortedArgs = Arrays.stream(message.substring(argsStart, argsEnd).split(", "))
.sorted()
.collect(Collectors.joining(", "));
return message.substring(0, argsStart) + sortedArgs + message.substring(argsEnd);
}
}
1 change: 1 addition & 0 deletions generic-database-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
<instructions>
<_exportcontents>
io.cdap.plugin.jdbc.*;
io.cdap.plugin.db.*;
io.cdap.plugin.db.source.*;
io.cdap.plugin.db.sink.*;
</_exportcontents>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ private static void prepareTestData(Connection conn) throws SQLException {

@AfterClass
public static void tearDownDB() throws SQLException {
if (!tearDown) {
if (!tearDown || hsqlDBServer == null) {
return;
}

Expand Down
62 changes: 42 additions & 20 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@
<surefire.redirectTestOutputToFile>true</surefire.redirectTestOutputToFile>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- version properties -->
<cdap.version>6.11.0</cdap.version>
<cdap.version>6.12.0-SNAPSHOT</cdap.version>
<cdap.plugin.version>2.13.1</cdap.plugin.version>
<guava.version>13.0.1</guava.version>
<guava.version>33.8.0-jre</guava.version>
<hadoop.version>3.3.6</hadoop.version>
<hsql.version>2.2.4</hsql.version>
<junit.version>4.13</junit.version>
Expand All @@ -97,6 +97,12 @@
<repository>
<id>sonatype-snapshots</id>
<url>https://central.sonatype.com/repository/maven-snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>

Expand Down Expand Up @@ -370,8 +376,8 @@
<version>1.1.0</version>
<configuration>
<cdapArtifacts>
<parent>system:cdap-data-pipeline[6.11.0-SNAPSHOT,7.0.0-SNAPSHOT)</parent>
<parent>system:cdap-data-streams[6.11.0-SNAPSHOT,7.0.0-SNAPSHOT)</parent>
<parent>system:cdap-data-pipeline[6.12.0-SNAPSHOT,7.0.0-SNAPSHOT)</parent>
<parent>system:cdap-data-streams[6.12.0-SNAPSHOT,7.0.0-SNAPSHOT)</parent>
</cdapArtifacts>
</configuration>
<executions>
Expand All @@ -387,21 +393,48 @@
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<id>enforce-upper-bound-deps</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireUpperBoundDeps>
<includes>
<include>com.google.guava:guava</include>
</includes>
</requireUpperBoundDeps>
<bannedDependencies>
<excludes>
<exclude>com.google.guava:guava:(,33.8.0-jre)</exclude>
</excludes>
<message>Guava versions older than 33.8.0-jre are banned due to security vulnerabilities (CVE-2023-2976, CVE-2020-8908).</message>
</bannedDependencies>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<release>11</release>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
<configuration>
<argLine>-Xmx3g -Djava.awt.headless=true -XX:MaxPermSize=256m -XX:+UseConcMarkSweepGC -Djava.net.preferIPv4Stack=true</argLine>
<argLine>-Xmx3g -Djava.awt.headless=true -XX:+UseG1GC -Djava.net.preferIPv4Stack=true</argLine>
<redirectTestOutputToFile>${surefire.redirectTestOutputToFile}</redirectTestOutputToFile>
<reuseForks>false</reuseForks>
<reportFormat>plain</reportFormat>
Expand Down Expand Up @@ -566,9 +599,9 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<version>3.1.1</version>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
<doclint>none</doclint>
<failOnError>false</failOnError>
<links>
<link>http://download.oracle.com/javase/${jee.version}/docs/api/</link>
Expand Down Expand Up @@ -613,7 +646,6 @@
<properties>
<testSourceLocation>src/e2e-test/java</testSourceLocation>
<TEST_RUNNER>TestRunner.java</TEST_RUNNER>
<guava.version>32.1.2-jre</guava.version>
Comment thread
AbhishekKumar9984 marked this conversation as resolved.
Resolved
</properties>
<build>
<testResources>
Expand Down Expand Up @@ -708,16 +740,6 @@
</plugins>
</build>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>31.1-jre</version>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
Expand Down
Loading