Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Commit

Permalink
upgrade to Gradle 7.3.1 / Java 17 (airbytehq#7964)
Browse files Browse the repository at this point in the history
* upgrade gradle

* upgrade to Java 17 (and fix a few of the node versioning misses)

* oops

* try to run a different format version

* fix spotless by upgrading / reformatting some files

* fix ci settings

* upgrade mockito to avoid other errors

* undo bad format

* fix "incorrect" sql comments

* fmt

* add debug flag

* remove

* bump

* bump jooq to a version that has a java 17 dist

* fix

* remove logs

* oops

* revert jooq upgrade

* fix

* set up java for connector test

* fix yaml

* generate std source tests

* fail zombie job attempts and add failure reason (airbytehq#8709)

* fail zombie job attempts and add failure reason

* remove failure reason

* bump gcp dependencies to pick up grpc update (airbytehq#8713)

* Bump Airbyte version from 0.33.9-alpha to 0.33.10-alpha (airbytehq#8714)

Co-authored-by: jrhizor <jrhizor@users.noreply.github.com>

* Change CDK "Caching" header to "nested streams & caching"

* Update fields in source-connectors specifications: file, freshdesk, github, google-directory, google-workspace-admin-reports, iterable (airbytehq#8524)

Signed-off-by: Sergey Chvalyuk <grubberr@gmail.com>

Co-authored-by: Serhii Chvaliuk <grubberr@gmail.com>
Co-authored-by: Sherif A. Nada <snadalive@gmail.com>

* move S3Config into destination-s3; update dependencies accordingly (airbytehq#8562)

Co-authored-by: Lake Mossman <lake@airbyte.io>
Co-authored-by: jrhizor <jrhizor@users.noreply.github.com>
Co-authored-by: Sherif A. Nada <snadalive@gmail.com>
Co-authored-by: Iryna Grankova <87977540+igrankova@users.noreply.github.com>
Co-authored-by: Serhii Chvaliuk <grubberr@gmail.com>
Co-authored-by: Edward Gao <edward.gao@airbyte.io>
  • Loading branch information
7 people authored Dec 11, 2021
1 parent e9f414d commit 25674fc
Show file tree
Hide file tree
Showing 28 changed files with 227 additions and 185 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/gke-kube-test-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ jobs:

- uses: actions/setup-java@v1
with:
java-version: '14'
java-version: '17'

- uses: actions/setup-node@v1
with:
node-version: '14.7'
node-version: '16.13.0'

- name: Fix EC-2 Runner
run: |
Expand Down
32 changes: 24 additions & 8 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:

- uses: actions/setup-java@v1
with:
java-version: "14"
java-version: "17"

- uses: actions/setup-node@v1
with:
Expand All @@ -96,7 +96,11 @@ jobs:
run: |
mkdir -p ~/.gradle/
cat > ~/.gradle/gradle.properties <<EOF
org.gradle.jvmargs=-Xmx8g -Xss4m
org.gradle.jvmargs=-Xmx8g -Xss4m --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
org.gradle.workers.max=8
org.gradle.vfs.watch=false
EOF
Expand Down Expand Up @@ -206,7 +210,7 @@ jobs:

- uses: actions/setup-java@v1
with:
java-version: "14"
java-version: "17"

- uses: actions/setup-node@v1
with:
Expand All @@ -216,7 +220,11 @@ jobs:
run: |
mkdir -p ~/.gradle/
cat > ~/.gradle/gradle.properties <<EOF
org.gradle.jvmargs=-Xmx8g -Xss4m
org.gradle.jvmargs=-Xmx8g -Xss4m --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
org.gradle.workers.max=8
org.gradle.vfs.watch=false
EOF
Expand Down Expand Up @@ -330,7 +338,7 @@ jobs:

- uses: actions/setup-java@v1
with:
java-version: "14"
java-version: "17"

- uses: actions/setup-node@v1
with:
Expand All @@ -343,7 +351,11 @@ jobs:
run: |
mkdir -p ~/.gradle/
cat > ~/.gradle/gradle.properties <<EOF
org.gradle.jvmargs=-Xmx8g -Xss4m
org.gradle.jvmargs=-Xmx8g -Xss4m --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
org.gradle.workers.max=8
org.gradle.vfs.watch=false
EOF
Expand Down Expand Up @@ -411,7 +423,7 @@ jobs:

- uses: actions/setup-java@v1
with:
java-version: "14"
java-version: "17"

- uses: actions/setup-node@v1
with:
Expand All @@ -425,7 +437,11 @@ jobs:
run: |
mkdir -p ~/.gradle/
cat > ~/.gradle/gradle.properties <<EOF
org.gradle.jvmargs=-Xmx8g -Xss4m
org.gradle.jvmargs=-Xmx8g -Xss4m --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
org.gradle.workers.max=8
org.gradle.vfs.watch=false
EOF
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-cdk-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- uses: actions/setup-java@v1
with:
java-version: '14'
java-version: '17'
- name: Checkout Airbyte
uses: actions/checkout@v2
- name: Build CDK Package
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-airbyte-os.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
fetch-depth: 0
- uses: actions/setup-java@v1
with:
java-version: '14'
java-version: '17'

- uses: actions/setup-node@v1
with:
node-version: '14.7'
node-version: '16.13.0'
- name: Save Old Version
id: old_version
run: |
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ jobs:
# Beside PyEnv, this does not set any runtimes up because it uses an AMI image that has everything pre-installed. See https://github.com/airbytehq/airbyte/issues/4559/
- name: Install Pyenv
run: python3 -m pip install virtualenv==16.7.9 --user
- uses: actions/setup-java@v1
with:
java-version: '17'
- name: Write Integration Test Credentials
run: ./tools/bin/ci_credentials.sh ${{ github.event.inputs.connector }}
env:
Expand Down
4 changes: 2 additions & 2 deletions airbyte-db/lib/src/main/resources/configs_database/schema.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- tables
CREATE
CREATE
TABLE
IF NOT EXISTS AIRBYTE_CONFIGS(
id BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
Expand All @@ -11,7 +11,7 @@
);

-- indices
CREATE
CREATE
UNIQUE INDEX IF NOT EXISTS airbyte_configs_type_id_idx ON
AIRBYTE_CONFIGS(
config_type,
Expand Down
4 changes: 2 additions & 2 deletions airbyte-db/lib/src/main/resources/jobs_database/schema.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- types
CREATE
CREATE
TYPE JOB_STATUS AS ENUM(
'pending',
'running',
Expand Down Expand Up @@ -27,7 +27,7 @@ CREATE
);

-- tables
CREATE
CREATE
TABLE
IF NOT EXISTS AIRBYTE_METADATA(
KEY VARCHAR(255) PRIMARY KEY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,13 @@ public void testCopyData() throws SQLException {
.withConnectionId(CONNECTION_2_ID)
.withState(new State().withState(Jsons.deserialize("{ \"cursor\": 3 }"))));

final OffsetDateTime timestamp = OffsetDateTime.now();
final OffsetDateTime timestampWithFullPrecision = OffsetDateTime.now();
/*
* The AWS CI machines get a higher precision value here (2021-12-07T19:56:28.967213187Z) vs what is
* retrievable on Postgres or on my local machine (2021-12-07T19:56:28.967213Z). Truncating the
* value to match.
*/
final OffsetDateTime timestamp = timestampWithFullPrecision.withNano(1000 * (timestampWithFullPrecision.getNano() / 1000));

database.query(ctx -> {
V0_30_22_001__Store_last_sync_state.copyData(ctx, STD_CONNECTION_STATES, timestamp);
Expand Down
2 changes: 1 addition & 1 deletion airbyte-integrations/bases/base-java/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG JDK_VERSION=14.0.2
ARG JDK_VERSION=17.0.1
FROM openjdk:${JDK_VERSION}-slim
COPY --from=airbyte/integration-base:dev /airbyte /airbyte

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG JDK_VERSION=14.0.2
ARG JDK_VERSION=17.0.1
FROM openjdk:${JDK_VERSION}-slim

# Install Docker to launch worker images. Eventually should be replaced with Docker-java.
Expand Down
2 changes: 1 addition & 1 deletion airbyte-integrations/bases/standard-source-test/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG JDK_VERSION=14.0.2
ARG JDK_VERSION=17.0.1
FROM openjdk:${JDK_VERSION}-slim

# Install Docker to launch worker images. Eventually should be replaced with Docker-java.
Expand Down
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-jdbc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ dependencies {
testFixturesRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.4.2'
testFixturesImplementation 'org.junit.jupiter:junit-jupiter-api:5.4.2'
testFixturesImplementation 'org.junit.jupiter:junit-jupiter-params:5.4.2'
testFixturesImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '3.4.6'
testFixturesImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '4.0.0'

implementation files(project(':airbyte-integrations:bases:base-java').airbyteDocker.outputs)
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- generic setup for a brand new empty postgresql RDS
CREATE
CREATE
ROLE integrationtest_rw;

GRANT integrationtest_rw TO airbyte;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- create the specific user we want to use from airbyte
CREATE
CREATE
USER testcaseuser WITH password 'ThisIsNotTheRealPassword.PleaseSetThisByHand';

GRANT integrationtest_rw TO testcaseuser;
2 changes: 1 addition & 1 deletion airbyte-scheduler/app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG JDK_VERSION=14.0.2
ARG JDK_VERSION=17.0.1
FROM openjdk:${JDK_VERSION}-slim AS scheduler

ENV APPLICATION airbyte-scheduler
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ WHERE
) counts ON
jobs.scope = counts.scope
WHERE
-- job must be at least MINIMUM_AGE_IN_DAYS old or connection has more than EXCESSIVE_NUMBER_OF_JOBS
(
/* job must be at least MINIMUM_AGE_IN_DAYS old or connection has more than EXCESSIVE_NUMBER_OF_JOBS */
(
jobs.created_at <(
TO_TIMESTAMP(
?,
Expand All @@ -29,8 +29,8 @@ WHERE
OR counts.jobCount >?
)
AND jobs.id NOT IN(
-- cannot be the most recent job with saved state
SELECT
/* cannot be the most recent job with saved state */
SELECT
job_id AS latest_job_id_with_state
FROM
(
Expand Down Expand Up @@ -69,8 +69,8 @@ WHERE
stateRecency = 1
)
AND jobs.id NOT IN(
-- cannot be one of the last MINIMUM_RECENCY jobs for that connection/scope
SELECT
/* cannot be one of the last MINIMUM_RECENCY jobs for that connection/scope */
SELECT
id
FROM
(
Expand Down
2 changes: 1 addition & 1 deletion airbyte-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG JDK_VERSION=14.0.2
ARG JDK_VERSION=17.0.1
FROM openjdk:${JDK_VERSION}-slim AS server

EXPOSE 8000
Expand Down
8 changes: 4 additions & 4 deletions airbyte-server/src/test/resources/migration/schema.sql
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
-- extensions
CREATE
CREATE
EXTENSION IF NOT EXISTS "uuid-ossp";

-- types
CREATE
CREATE
TYPE JOB_STATUS AS ENUM(
'pending',
'running',
Expand Down Expand Up @@ -31,7 +31,7 @@ CREATE
);

-- tables
CREATE
CREATE
TABLE
AIRBYTE_METADATA(
KEY VARCHAR(255) PRIMARY KEY,
Expand Down Expand Up @@ -73,7 +73,7 @@ CREATE
);

-- entries
INSERT
INSERT
INTO
AIRBYTE_METADATA
VALUES(
Expand Down
2 changes: 1 addition & 1 deletion airbyte-workers/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG JDK_VERSION=14.0.2
ARG JDK_VERSION=17.0.1
FROM openjdk:${JDK_VERSION}-slim AS worker

ARG DOCKER_BUILD_ARCH=amd64
Expand Down
2 changes: 1 addition & 1 deletion airbyte-workers/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dependencies {
implementation project(':airbyte-protocol:models')
implementation project(':airbyte-scheduler:persistence')

testImplementation 'org.mockito:mockito-inline:2.13.0'
testImplementation 'org.mockito:mockito-inline:4.0.0'
testImplementation 'org.postgresql:postgresql:42.2.18'
testImplementation "org.flywaydb:flyway-core:7.14.0"
testImplementation 'io.temporal:temporal-testing:1.6.0'
Expand Down
12 changes: 6 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ buildscript {
plugins {
id 'base'
id 'pmd'
id 'com.diffplug.spotless' version '5.7.0'
id 'com.diffplug.spotless' version '6.0.0'
id 'com.github.hierynomus.license' version '0.16.1'
}

Expand Down Expand Up @@ -103,7 +103,7 @@ spotless {

importOrder()

eclipse('4.16.0').configFile(rootProject.file('tools/gradle/codestyle/java-google-style.xml'))
eclipse('4.21.0').configFile(rootProject.file('tools/gradle/codestyle/java-google-style.xml'))

licenseHeaderFile createJavaLicenseWith(rootProject.file('LICENSE_SHORT'))
removeUnusedImports()
Expand Down Expand Up @@ -132,7 +132,7 @@ def Task getDockerBuildTask(String artifactName, String projectDir) {
def buildPlatform = System.getenv('DOCKER_BUILD_PLATFORM') ?: 'linux/amd64'
def alpineImage = System.getenv('ALPINE_IMAGE') ?: 'alpine:3.4'
def postgresImage = System.getenv('POSTGRES_IMAGE') ?: 'postgres:13-alpine'
def jdkVersion = System.getenv('JDK_VERSION') ?: '14.0.2'
def jdkVersion = System.getenv('JDK_VERSION') ?: '17.0.1'
def buildArch = System.getenv('DOCKER_BUILD_ARCH') ?: 'amd64'

inputDir = file("$projectDir/build/docker")
Expand Down Expand Up @@ -178,8 +178,8 @@ subprojects {
apply plugin: 'java'
apply plugin: 'jacoco'

sourceCompatibility = JavaVersion.VERSION_14
targetCompatibility = JavaVersion.VERSION_14
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

repositories {
mavenCentral()
Expand Down Expand Up @@ -300,7 +300,7 @@ subprojects {
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.2'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.2'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.7.2'
testImplementation 'org.mockito:mockito-junit-jupiter:3.12.4'
testImplementation 'org.mockito:mockito-junit-jupiter:4.0.0'
testImplementation 'org.assertj:assertj-core:3.21.0'

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,3 @@

Test methods start with `test`. Other methods are internal helpers in the java class implementing the test suite.

## testGetSpec

Verify that a spec operation issued to the connector returns a valid spec.

## testCheckConnection

Verify that a check operation issued to the connector with the input config file returns a success response.

## testDiscover

Verifies when a discover operation is run on the connector using the given config file, a valid catalog is output by the connector.

## testFullRefreshRead

Configuring all streams in the input catalog to full refresh mode, verifies that a read operation produces some RECORD messages.

## testIdenticalFullRefreshes

Configuring all streams in the input catalog to full refresh mode, performs two read operations on all streams which support full refresh syncs. It then verifies that the RECORD messages output from both were identical.

## testIncrementalSyncWithState

This test verifies that all streams in the input catalog which support incremental sync can do so correctly. It does this by running two read operations on the connector's Docker image: the first takes the configured catalog and config provided to this test as input. It then verifies that the sync produced a non-zero number of RECORD and STATE messages. The second read takes the same catalog and config used in the first test, plus the last STATE message output by the first read operation as the input state file. It verifies that no records are produced \(since we read all records in the first sync\). This test is performed only for streams which support incremental. Streams which do not support incremental sync are ignored. If no streams in the input catalog support incremental sync, this test is skipped.

## testEmptyStateIncrementalIdenticalToFullRefresh

If the source does not support incremental sync, this test is skipped. Otherwise, this test runs two syncs: one where all streams provided in the input catalog sync in full refresh mode, and another where all the streams which in the input catalog which support incremental, sync in incremental mode \(streams which don't support incremental sync in full refresh mode\). Then, the test asserts that the two syncs produced the same RECORD messages. Any other type of message is disregarded.

## testEntrypointEnvVar

In order to launch a source on Kubernetes in a pod, we need to be able to wrap the entrypoint. The source connector must specify its entrypoint in the AIRBYTE_ENTRYPOINT variable. This test ensures that the entrypoint environment variable is set.

Loading

0 comments on commit 25674fc

Please sign in to comment.