Skip to content

Commit 6d21941

Browse files
authored
[hotfix] Fix Java 11 target compatibility & add tests (#3633)
* [hotfix] Fix Java 11 target compatibility Signed-off-by: yuxiqian <[email protected]> # Conflicts: # .github/workflows/flink_cdc_java_8.yml # .github/workflows/flink_cdc_migration_test_base.yml # pom.xml * fix: clarify GiHub workflow names Signed-off-by: yuxiqian <[email protected]> --------- Signed-off-by: yuxiqian <[email protected]>
1 parent b0a7d92 commit 6d21941

File tree

36 files changed

+369
-103
lines changed

36 files changed

+369
-103
lines changed

.github/workflows/flink_cdc_base.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@ on:
1919
workflow_call:
2020
inputs:
2121
java-version:
22-
description: "Jdk version to test against."
22+
description: "Jdk versions to test against."
2323
required: false
2424
type: string
25-
default: "8"
25+
default: "['8']"
2626
flink-version:
27-
description: "Flink version to test against."
27+
description: "Flink versions to test against."
2828
required: false
2929
type: string
30+
default: "['generic']"
3031
module:
3132
description: "Flink CDC module to test against."
3233
required: true
@@ -99,9 +100,12 @@ jobs:
99100
compile_and_test:
100101
runs-on: ubuntu-latest
101102
timeout-minutes: 120
103+
strategy:
104+
matrix:
105+
java-version: ${{ fromJSON(inputs.java-version) }}
106+
flink-version: ${{ fromJSON(inputs.flink-version) }}
102107
steps:
103-
- run: echo "Running CI pipeline for JDK version ${{ inputs.java-version }}"
104-
108+
- run: echo "Running CI pipeline for JDK version ${{ matrix.java-version }}"
105109
- name: Clean up disk space
106110
run: |
107111
set -euo pipefail
@@ -127,7 +131,7 @@ jobs:
127131
- name: Set JDK
128132
uses: actions/setup-java@v4
129133
with:
130-
java-version: ${{ inputs.java-version }}
134+
java-version: ${{ matrix.java-version }}
131135
distribution: 'temurin'
132136
cache: 'maven'
133137

@@ -200,8 +204,8 @@ jobs:
200204
build_maven_parameter="-DspecifiedMongoVersion=7.0.12"
201205
fi
202206
203-
if [ ! -z "${{ inputs.flink-version }}" ]; then
204-
build_maven_parameter="${build_maven_parameter:+$build_maven_parameter }-DspecifiedFlinkVersion=${{ inputs.flink-version }}"
207+
if [ ! -z "${{ matrix.flink-version }}" ]; then
208+
build_maven_parameter="${build_maven_parameter:+$build_maven_parameter }-DspecifiedFlinkVersion=${{ matrix.flink-version }}"
205209
fi
206210
207211
build_maven_parameter="${build_maven_parameter:+$build_maven_parameter }${{ inputs.custom-maven-parameter }}"
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
name: Flink CDC CI Nightly
17+
on:
18+
schedule:
19+
- cron: '0 0 * * *' # Deploy every day
20+
workflow_dispatch:
21+
22+
concurrency:
23+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.number || github.run_id }}
24+
cancel-in-progress: true
25+
26+
jobs:
27+
license_check:
28+
name: License Check
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Check out repository code
32+
uses: actions/checkout@v4
33+
with:
34+
submodules: true
35+
- name: Set up Ruby environment
36+
uses: ruby/setup-ruby@v1
37+
with:
38+
ruby-version: '3.3'
39+
- name: Set JDK
40+
uses: actions/setup-java@v4
41+
with:
42+
java-version: '11'
43+
distribution: 'temurin'
44+
cache: 'maven'
45+
- name: Compiling jar packages
46+
run: mvn --no-snapshot-updates -B package -DskipTests
47+
- name: Run license check
48+
run: gem install rubyzip -v 2.3.0 && ./tools/ci/license_check.rb
49+
ut:
50+
strategy:
51+
matrix:
52+
module: [ 'core', 'pipeline_connectors', 'mysql', 'postgres', 'oracle', 'mongodb6', 'mongodb7', 'sqlserver', 'tidb', 'oceanbase', 'db2', 'vitess' ]
53+
name: Unit Tests
54+
uses: ./.github/workflows/flink_cdc_base.yml
55+
with:
56+
java-version: "[11]"
57+
module: ${{ matrix.module }}
58+
pipeline_e2e:
59+
name: Pipeline E2E Tests
60+
uses: ./.github/workflows/flink_cdc_base.yml
61+
with:
62+
java-version: "[11]"
63+
flink-version: "['1.19.1', '1.20.0']"
64+
module: pipeline_e2e
65+
source_e2e:
66+
name: Source E2E Tests
67+
uses: ./.github/workflows/flink_cdc_base.yml
68+
with:
69+
java-version: "[11]"
70+
flink-version: "['1.19.1', '1.20.0']"
71+
module: source_e2e
72+
migration_test:
73+
name: Migration Tests
74+
uses: ./.github/workflows/flink_cdc_migration_test_base.yml
75+
with:
76+
java-version: "[11]"
77+
flink-version: "['1.19.1', '1.20.0']"

.github/workflows/flink_cdc.yml renamed to .github/workflows/flink_cdc_java_8.yml

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -60,37 +60,29 @@ jobs:
6060
ut:
6161
strategy:
6262
matrix:
63-
java-version: [ '8' ]
6463
module: [ 'core', 'pipeline_connectors', 'mysql', 'postgres', 'oracle', 'mongodb6', 'mongodb7', 'sqlserver', 'tidb', 'oceanbase', 'db2', 'vitess' ]
6564
name: Unit Tests
6665
uses: ./.github/workflows/flink_cdc_base.yml
6766
with:
68-
java-version: ${{ matrix.java-version }}
67+
java-version: "[8]"
6968
module: ${{ matrix.module }}
7069
pipeline_e2e:
71-
strategy:
72-
matrix:
73-
java-version: [ '8' ]
74-
flink-version: ['1.19.1', '1.20.0']
75-
module: [ 'pipeline_e2e' ]
7670
name: Pipeline E2E Tests
7771
uses: ./.github/workflows/flink_cdc_base.yml
7872
with:
79-
java-version: ${{ matrix.java-version }}
80-
flink-version: ${{ matrix.flink-version }}
81-
module: ${{ matrix.module }}
73+
java-version: "[8]"
74+
flink-version: "['1.19.1', '1.20.0']"
75+
module: pipeline_e2e
8276
source_e2e:
83-
strategy:
84-
matrix:
85-
java-version: [ '8' ]
86-
flink-version: ['1.19.1', '1.20.0']
87-
module: [ 'source_e2e' ]
8877
name: Source E2E Tests
8978
uses: ./.github/workflows/flink_cdc_base.yml
9079
with:
91-
java-version: ${{ matrix.java-version }}
92-
flink-version: ${{ matrix.flink-version }}
93-
module: ${{ matrix.module }}
80+
java-version: "[8]"
81+
flink-version: "['1.19.1', '1.20.0']"
82+
module: source_e2e
9483
migration_test:
9584
name: Migration Tests
96-
uses: ./.github/workflows/flink_cdc_migration_test.yml
85+
uses: ./.github/workflows/flink_cdc_migration_test_base.yml
86+
with:
87+
java-version: "[8]"
88+
flink-version: "['1.19.1', '1.20.0']"

.github/workflows/flink_cdc_migration_test.yml renamed to .github/workflows/flink_cdc_migration_test_base.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,32 @@ name: Migration Tests
1717

1818
on:
1919
workflow_call:
20+
inputs:
21+
java-version:
22+
description: "Jdk versions to test against, passed as a JSON array string."
23+
required: false
24+
type: string
25+
default: "['8']"
26+
flink-version:
27+
description: "Flink versions to test against, passed as a JSON array string."
28+
required: true
29+
type: string
2030

2131
jobs:
2232
migration_test_ut:
2333
runs-on: ubuntu-latest
34+
strategy:
35+
matrix:
36+
java-version: ${{ fromJSON(inputs.java-version) }}
37+
flink-version: ${{ fromJSON(inputs.flink-version) }}
2438
steps:
2539
- name: Check out repository code
2640
uses: actions/checkout@v4
2741
with:
2842
submodules: true
2943
- uses: actions/setup-java@v4
3044
with:
31-
java-version: 8
45+
java-version: ${{ matrix.java-version }}
3246
distribution: temurin
3347
- name: Compile snapshot CDC version
3448
run: mvn --no-snapshot-updates -B install -DskipTests
@@ -39,8 +53,8 @@ jobs:
3953
runs-on: ubuntu-latest
4054
strategy:
4155
matrix:
42-
flink-version: [ '1.19.1', '1.20.0' ]
43-
56+
java-version: ${{ fromJSON(inputs.java-version) }}
57+
flink-version: ${{ fromJSON(inputs.flink-version) }}
4458
steps:
4559
- uses: actions/checkout@v4
4660
- name: Set up Ruby
@@ -50,7 +64,7 @@ jobs:
5064
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
5165
- uses: actions/setup-java@v4
5266
with:
53-
java-version: 8
67+
java-version: ${{ matrix.java-version }}
5468
distribution: temurin
5569
cache: maven
5670
- name: Install dependencies
@@ -78,6 +92,7 @@ jobs:
7892
runs-on: ubuntu-latest
7993
strategy:
8094
matrix:
95+
java-version: ${{ fromJSON(inputs.java-version) }}
8196
flink-version: [ '1.19.1', '1.20.0' ]
8297

8398
steps:
@@ -89,7 +104,7 @@ jobs:
89104
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
90105
- uses: actions/setup-java@v4
91106
with:
92-
java-version: 8
107+
java-version: ${{ matrix.java-version }}
93108
distribution: temurin
94109
cache: maven
95110
- name: Install dependencies

flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-doris/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ limitations under the License.
112112
<plugin>
113113
<groupId>org.apache.maven.plugins</groupId>
114114
<artifactId>maven-shade-plugin</artifactId>
115+
<version>${maven.shade.plugin.version}</version>
115116
<executions>
116117
<execution>
117118
<id>shade-flink</id>

flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-elasticsearch/pom.xml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ limitations under the License.
222222
<plugin>
223223
<groupId>org.apache.maven.plugins</groupId>
224224
<artifactId>maven-shade-plugin</artifactId>
225-
<version>3.2.4</version>
225+
<version>${maven.shade.plugin.version}</version>
226226
<executions>
227227
<execution>
228228
<phase>package</phase>
@@ -245,15 +245,6 @@ limitations under the License.
245245
</execution>
246246
</executions>
247247
</plugin>
248-
<plugin>
249-
<groupId>org.apache.maven.plugins</groupId>
250-
<artifactId>maven-compiler-plugin</artifactId>
251-
<version>3.8.1</version>
252-
<configuration>
253-
<source>1.8</source>
254-
<target>1.8</target>
255-
</configuration>
256-
</plugin>
257248
</plugins>
258249
</build>
259250
</project>

flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-kafka/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ limitations under the License.
8181
<plugin>
8282
<groupId>org.apache.maven.plugins</groupId>
8383
<artifactId>maven-shade-plugin</artifactId>
84-
<version>3.1.1</version>
84+
<version>${maven.shade.plugin.version}</version>
8585
<executions>
8686
<execution>
8787
<id>shade-flink</id>

flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-mysql/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ limitations under the License.
144144
<plugin>
145145
<groupId>org.apache.maven.plugins</groupId>
146146
<artifactId>maven-shade-plugin</artifactId>
147-
<version>3.2.4</version>
147+
<version>${maven.shade.plugin.version}</version>
148148
<executions>
149149
<execution>
150150
<id>shade-flink</id>

flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-paimon/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ limitations under the License.
260260
<plugin>
261261
<groupId>org.apache.maven.plugins</groupId>
262262
<artifactId>maven-shade-plugin</artifactId>
263-
<version>3.1.1</version>
263+
<version>${maven.shade.plugin.version}</version>
264264
<executions>
265265
<execution>
266266
<id>shade-flink</id>

flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-starrocks/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ limitations under the License.
8080
<plugin>
8181
<groupId>org.apache.maven.plugins</groupId>
8282
<artifactId>maven-shade-plugin</artifactId>
83-
<version>3.1.1</version>
83+
<version>${maven.shade.plugin.version}</version>
8484
<executions>
8585
<execution>
8686
<id>shade-flink</id>

0 commit comments

Comments
 (0)