You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ec...@apache.org on 2024/03/01 13:28:01 UTC

(flink-connector-shared-utils) branch ci_utils updated (ec54606 -> b5ad097)

This is an automated email from the ASF dual-hosted git repository.

echauchot pushed a change to branch ci_utils
in repository https://gitbox.apache.org/repos/asf/flink-connector-shared-utils.git


    from ec54606  [FLINK-34314] Update CI Node Actions from NodeJS 16 to NodeJS 20. This closes  (#35)
     new 30d0b10  [FLINK-34137] Setup CI and archunit for archunit tests skipping
     new 4c3b7bb  [FLINK-34137] Update test-project parent to regular flink-connector-parent
     new 866c7b4  [FLINK-34137] Use additionalExcludes property to exclude archunit tests
     new 2868ea1  [FLINK-34137] Create a parent and 2 sub modules: one with tests, and one with no tests
     new 5786a05  [FLINK-34137] Add a simple non-violated test rule for production and test code and simplify dependencies
     new e6e2136  [FLINK-34137] Bump to flink 1.17.2
     new e9f50c1  [FLINK-34137] Use flink-connector-parent v1.1.0 with surefire tests exclusions
     new ad16ea8  [FLINK-34137] exclude junit-platform-engine archunit transitive dep for dependency convergence
     new b5ad097  [FLINK-34137] upgrade all flinks versions in CI: 1.16.x -> 1.17.x, 1.17.x -> 1.18.x

The 9 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .github/workflows/_testing.yml                     | 33 ++++++++----
 .github/workflows/ci.yml                           | 10 ++++
 .gitignore                                         |  4 +-
 .gitignore => module-with-no-tests/.gitignore      |  5 --
 module-with-no-tests/pom.xml                       | 14 +++++
 .../apache/flink/connector/testing/SomeClass.java  |  0
 .gitignore => module-with-tests/.gitignore         |  5 --
 .../09379350-830e-42a3-8b31-afde18cf1eb4           |  0
 module-with-tests/archunit-violations/stored.rules |  3 ++
 module-with-tests/pom.xml                          | 33 ++++++++++++
 .../connector/testing/SomeConnectorClass.java      |  2 +-
 .../connector/testing/SomeConnectorClassTest.java  |  2 +-
 .../ConnectorProductionCodeArchitectureTest.java   | 47 ++++++++++++++++
 .../ConnectorTestCodeArchitectureTest.java         | 44 +++++++++++++++
 .../src/test/resources/archunit.properties         | 38 +++++++++++++
 pom.xml                                            | 62 +++++++++++++++++-----
 16 files changed, 268 insertions(+), 34 deletions(-)
 copy .gitignore => module-with-no-tests/.gitignore (82%)
 create mode 100644 module-with-no-tests/pom.xml
 copy {src => module-with-no-tests/src}/main/java/org/apache/flink/connector/testing/SomeClass.java (100%)
 copy .gitignore => module-with-tests/.gitignore (82%)
 create mode 100644 module-with-tests/archunit-violations/09379350-830e-42a3-8b31-afde18cf1eb4
 create mode 100644 module-with-tests/archunit-violations/stored.rules
 create mode 100644 module-with-tests/pom.xml
 rename src/main/java/org/apache/flink/connector/testing/SomeClass.java => module-with-tests/src/main/java/org/apache/flink/connector/testing/SomeConnectorClass.java (96%)
 rename src/test/java/org/apache/flink/connector/testing/SomeClassTest.java => module-with-tests/src/test/java/org/apache/flink/connector/testing/SomeConnectorClassTest.java (96%)
 create mode 100644 module-with-tests/src/test/java/org/apache/flink/connector/testing/architecture/ConnectorProductionCodeArchitectureTest.java
 create mode 100644 module-with-tests/src/test/java/org/apache/flink/connector/testing/architecture/ConnectorTestCodeArchitectureTest.java
 create mode 100644 module-with-tests/src/test/resources/archunit.properties


(flink-connector-shared-utils) 05/09: [FLINK-34137] Add a simple non-violated test rule for production and test code and simplify dependencies

Posted by ec...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

echauchot pushed a commit to branch ci_utils
in repository https://gitbox.apache.org/repos/asf/flink-connector-shared-utils.git

commit 5786a05331ec1916078c80117599869eccf0da37
Author: Etienne Chauchot <ec...@apache.org>
AuthorDate: Tue Nov 21 16:16:04 2023 +0100

    [FLINK-34137] Add a simple non-violated test rule for production and test code and simplify dependencies
---
 module-with-no-tests/pom.xml                       |  1 +
 .../apache/flink/connector/testing/SomeClass.java  |  4 +-
 ...bf549e => 09379350-830e-42a3-8b31-afde18cf1eb4} |  0
 .../25d7c950-4d90-4419-b9af-78a9001796ce           |  0
 .../2c5e2ae5-0e19-423f-9501-d00b090b9d0e           |  0
 .../3e3429f1-b715-4057-91ce-f859c4c07245           |  0
 .../662c8ab6-14a2-4f59-bacf-3e7a09427662           |  0
 .../a2f52e44-eb11-4165-8a96-418e754ac1c6           |  0
 .../b5a693ee-ab65-41b7-9764-cbe027c4ee12           |  0
 .../f3351a4e-bc84-4164-aba1-3d729855e431           |  0
 module-with-tests/archunit-violations/stored.rules | 11 +---
 module-with-tests/pom.xml                          | 19 ++++++
 .../connector/testing/SomeConnectorClass.java      |  5 +-
 ...eClassTest.java => SomeConnectorClassTest.java} |  2 +-
 ...> ConnectorProductionCodeArchitectureTest.java} | 27 ++++----
 ...java => ConnectorTestCodeArchitectureTest.java} | 25 ++++----
 pom.xml                                            | 75 ++++++++++------------
 17 files changed, 89 insertions(+), 80 deletions(-)

diff --git a/module-with-no-tests/pom.xml b/module-with-no-tests/pom.xml
index da0c156..ba65984 100644
--- a/module-with-no-tests/pom.xml
+++ b/module-with-no-tests/pom.xml
@@ -3,6 +3,7 @@
 		 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 		 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 	<modelVersion>4.0.0</modelVersion>
+	
 	<parent>
 		<groupId>org.apache.flink</groupId>
 		<artifactId>test-project-parent</artifactId>
diff --git a/module-with-tests/src/main/java/org/apache/flink/connector/testing/SomeClass.java b/module-with-no-tests/src/main/java/org/apache/flink/connector/testing/SomeClass.java
similarity index 92%
rename from module-with-tests/src/main/java/org/apache/flink/connector/testing/SomeClass.java
rename to module-with-no-tests/src/main/java/org/apache/flink/connector/testing/SomeClass.java
index f29e5e0..36da836 100644
--- a/module-with-tests/src/main/java/org/apache/flink/connector/testing/SomeClass.java
+++ b/module-with-no-tests/src/main/java/org/apache/flink/connector/testing/SomeClass.java
@@ -19,6 +19,4 @@
 package org.apache.flink.connector.testing;
 
 /** A dummy class; only exists so that the compile/packaging plugins have something to do. */
-public class SomeClass {
-    public static void main(String[] args) {}
-}
+public class SomeClass {}
diff --git a/module-with-tests/archunit-violations/1758f718-5b06-442d-8b5a-ad347bbf549e b/module-with-tests/archunit-violations/09379350-830e-42a3-8b31-afde18cf1eb4
similarity index 100%
rename from module-with-tests/archunit-violations/1758f718-5b06-442d-8b5a-ad347bbf549e
rename to module-with-tests/archunit-violations/09379350-830e-42a3-8b31-afde18cf1eb4
diff --git a/module-with-tests/archunit-violations/25d7c950-4d90-4419-b9af-78a9001796ce b/module-with-tests/archunit-violations/25d7c950-4d90-4419-b9af-78a9001796ce
deleted file mode 100644
index e69de29..0000000
diff --git a/module-with-tests/archunit-violations/2c5e2ae5-0e19-423f-9501-d00b090b9d0e b/module-with-tests/archunit-violations/2c5e2ae5-0e19-423f-9501-d00b090b9d0e
deleted file mode 100644
index e69de29..0000000
diff --git a/module-with-tests/archunit-violations/3e3429f1-b715-4057-91ce-f859c4c07245 b/module-with-tests/archunit-violations/3e3429f1-b715-4057-91ce-f859c4c07245
deleted file mode 100644
index e69de29..0000000
diff --git a/module-with-tests/archunit-violations/662c8ab6-14a2-4f59-bacf-3e7a09427662 b/module-with-tests/archunit-violations/662c8ab6-14a2-4f59-bacf-3e7a09427662
deleted file mode 100644
index e69de29..0000000
diff --git a/module-with-tests/archunit-violations/a2f52e44-eb11-4165-8a96-418e754ac1c6 b/module-with-tests/archunit-violations/a2f52e44-eb11-4165-8a96-418e754ac1c6
deleted file mode 100644
index e69de29..0000000
diff --git a/module-with-tests/archunit-violations/b5a693ee-ab65-41b7-9764-cbe027c4ee12 b/module-with-tests/archunit-violations/b5a693ee-ab65-41b7-9764-cbe027c4ee12
deleted file mode 100644
index e69de29..0000000
diff --git a/module-with-tests/archunit-violations/f3351a4e-bc84-4164-aba1-3d729855e431 b/module-with-tests/archunit-violations/f3351a4e-bc84-4164-aba1-3d729855e431
deleted file mode 100644
index e69de29..0000000
diff --git a/module-with-tests/archunit-violations/stored.rules b/module-with-tests/archunit-violations/stored.rules
index e6fc6f1..bd30533 100644
--- a/module-with-tests/archunit-violations/stored.rules
+++ b/module-with-tests/archunit-violations/stored.rules
@@ -1,10 +1,3 @@
 #
-#Mon Nov 13 16:33:48 CET 2023
-Return\ and\ argument\ types\ of\ methods\ annotated\ with\ @Public\ must\ be\ annotated\ with\ @Public.=662c8ab6-14a2-4f59-bacf-3e7a09427662
-Connector\ production\ code\ must\ not\ depend\ on\ non-public\ API\ outside\ of\ connector\ packages=3e3429f1-b715-4057-91ce-f859c4c07245
-ITCASE\ tests\ should\ use\ a\ MiniCluster\ resource\ or\ extension=f3351a4e-bc84-4164-aba1-3d729855e431
-Production\ code\ must\ not\ call\ methods\ annotated\ with\ @VisibleForTesting=a2f52e44-eb11-4165-8a96-418e754ac1c6
-Tests\ inheriting\ from\ AbstractTestBase\ should\ have\ name\ ending\ with\ ITCase=b5a693ee-ab65-41b7-9764-cbe027c4ee12
-Options\ for\ connectors\ and\ formats\ should\ reside\ in\ a\ consistent\ package\ and\ be\ public\ API.=25d7c950-4d90-4419-b9af-78a9001796ce
-Return\ and\ argument\ types\ of\ methods\ annotated\ with\ @PublicEvolving\ must\ be\ annotated\ with\ @Public(Evolving).=1758f718-5b06-442d-8b5a-ad347bbf549e
-Classes\ in\ API\ packages\ should\ have\ at\ least\ one\ API\ visibility\ annotation.=2c5e2ae5-0e19-423f-9501-d00b090b9d0e
+#Wed Nov 22 14:49:24 CET 2023
+classes\ that\ reside\ in\ a\ package\ 'org.apache.flink.connector..'\ should\ have\ simple\ name\ containing\ 'Connector'=09379350-830e-42a3-8b31-afde18cf1eb4
diff --git a/module-with-tests/pom.xml b/module-with-tests/pom.xml
index c4e6084..75b9b02 100644
--- a/module-with-tests/pom.xml
+++ b/module-with-tests/pom.xml
@@ -11,4 +11,23 @@
 
 	<artifactId>module-with-tests</artifactId>
 
+	<dependencies>
+
+		<dependency>
+			<groupId>com.tngtech.archunit</groupId>
+			<artifactId>archunit</artifactId>
+		</dependency>
+
+		<dependency>
+			<groupId>com.tngtech.archunit</groupId>
+			<artifactId>archunit-junit5</artifactId>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.flink</groupId>
+			<artifactId>flink-test-utils-junit</artifactId>
+		</dependency>
+
+	</dependencies>
+
 </project>
diff --git a/module-with-no-tests/src/main/java/org/apache/flink/connector/testing/SomeClass2.java b/module-with-tests/src/main/java/org/apache/flink/connector/testing/SomeConnectorClass.java
similarity index 92%
rename from module-with-no-tests/src/main/java/org/apache/flink/connector/testing/SomeClass2.java
rename to module-with-tests/src/main/java/org/apache/flink/connector/testing/SomeConnectorClass.java
index 8429c55..7b9d700 100644
--- a/module-with-no-tests/src/main/java/org/apache/flink/connector/testing/SomeClass2.java
+++ b/module-with-tests/src/main/java/org/apache/flink/connector/testing/SomeConnectorClass.java
@@ -19,7 +19,4 @@
 package org.apache.flink.connector.testing;
 
 /** A dummy class; only exists so that the compile/packaging plugins have something to do. */
-public class SomeClass2 {
-
-    public static void main(String[] args) {}
-}
+public class SomeConnectorClass {}
diff --git a/module-with-tests/src/test/java/org/apache/flink/connector/testing/SomeClassTest.java b/module-with-tests/src/test/java/org/apache/flink/connector/testing/SomeConnectorClassTest.java
similarity index 96%
rename from module-with-tests/src/test/java/org/apache/flink/connector/testing/SomeClassTest.java
rename to module-with-tests/src/test/java/org/apache/flink/connector/testing/SomeConnectorClassTest.java
index 57630b7..e8e11e6 100644
--- a/module-with-tests/src/test/java/org/apache/flink/connector/testing/SomeClassTest.java
+++ b/module-with-tests/src/test/java/org/apache/flink/connector/testing/SomeConnectorClassTest.java
@@ -20,7 +20,7 @@ package org.apache.flink.connector.testing;
 
 import org.junit.jupiter.api.Test;
 
-class SomeClassTest {
+class SomeConnectorClassTest {
 
     @Test
     void someTest() {}
diff --git a/module-with-tests/src/test/java/org/apache/flink/connector/testing/architecture/ProductionCodeArchitectureTest.java b/module-with-tests/src/test/java/org/apache/flink/connector/testing/architecture/ConnectorProductionCodeArchitectureTest.java
similarity index 59%
rename from module-with-tests/src/test/java/org/apache/flink/connector/testing/architecture/ProductionCodeArchitectureTest.java
rename to module-with-tests/src/test/java/org/apache/flink/connector/testing/architecture/ConnectorProductionCodeArchitectureTest.java
index 6f80e05..b7bc141 100644
--- a/module-with-tests/src/test/java/org/apache/flink/connector/testing/architecture/ProductionCodeArchitectureTest.java
+++ b/module-with-tests/src/test/java/org/apache/flink/connector/testing/architecture/ConnectorProductionCodeArchitectureTest.java
@@ -18,25 +18,30 @@
 
 package org.apache.flink.connector.testing.architecture;
 
-import org.apache.flink.architecture.ProductionCodeArchitectureBase;
-import org.apache.flink.architecture.common.ImportOptions;
-
 import com.tngtech.archunit.core.importer.ImportOption;
 import com.tngtech.archunit.junit.AnalyzeClasses;
 import com.tngtech.archunit.junit.ArchTest;
-import com.tngtech.archunit.junit.ArchTests;
+import com.tngtech.archunit.lang.ArchRule;
+import com.tngtech.archunit.library.freeze.FreezingArchRule;
+
+import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.classes;
 
-/** product code Architecture tests. */
+/** production code Architecture tests. */
 @AnalyzeClasses(
-        packages = "org.apache.flink.connector",
+        packages = "org.apache.flink.connector.testing",
         importOptions = {
             ImportOption.DoNotIncludeTests.class,
-            ImportOption.DoNotIncludeArchives.class,
-            ImportOptions.ExcludeScalaImportOption.class,
-            ImportOptions.ExcludeShadedImportOption.class
+            ImportOption.DoNotIncludeArchives.class
         })
-public class ProductionCodeArchitectureTest {
+public class ConnectorProductionCodeArchitectureTest {
 
     @ArchTest
-    public static final ArchTests COMMON_TESTS = ArchTests.in(ProductionCodeArchitectureBase.class);
+    // simple test rule that is not violated
+    public static final ArchRule SIMPLE_RULE =
+            FreezingArchRule.freeze(
+                    classes()
+                            .that()
+                            .resideInAPackage("org.apache.flink.connector..")
+                            .should()
+                            .haveSimpleNameContaining("Connector"));
 }
diff --git a/module-with-tests/src/test/java/org/apache/flink/connector/testing/architecture/TestCodeArchitectureTest.java b/module-with-tests/src/test/java/org/apache/flink/connector/testing/architecture/ConnectorTestCodeArchitectureTest.java
similarity index 63%
rename from module-with-tests/src/test/java/org/apache/flink/connector/testing/architecture/TestCodeArchitectureTest.java
rename to module-with-tests/src/test/java/org/apache/flink/connector/testing/architecture/ConnectorTestCodeArchitectureTest.java
index 5d8e4ed..ae495b5 100644
--- a/module-with-tests/src/test/java/org/apache/flink/connector/testing/architecture/TestCodeArchitectureTest.java
+++ b/module-with-tests/src/test/java/org/apache/flink/connector/testing/architecture/ConnectorTestCodeArchitectureTest.java
@@ -18,24 +18,27 @@
 
 package org.apache.flink.connector.testing.architecture;
 
-import org.apache.flink.architecture.TestCodeArchitectureTestBase;
-import org.apache.flink.architecture.common.ImportOptions;
-
 import com.tngtech.archunit.core.importer.ImportOption;
 import com.tngtech.archunit.junit.AnalyzeClasses;
 import com.tngtech.archunit.junit.ArchTest;
-import com.tngtech.archunit.junit.ArchTests;
+import com.tngtech.archunit.lang.ArchRule;
+import com.tngtech.archunit.library.freeze.FreezingArchRule;
+
+import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.classes;
 
 /** Architecture tests for test code. */
 @AnalyzeClasses(
         packages = {"org.apache.flink.connector.testing"},
-        importOptions = {
-            ImportOption.OnlyIncludeTests.class,
-            ImportOptions.ExcludeScalaImportOption.class,
-            ImportOptions.ExcludeShadedImportOption.class
-        })
-public class TestCodeArchitectureTest {
+        importOptions = {ImportOption.OnlyIncludeTests.class})
+public class ConnectorTestCodeArchitectureTest {
 
     @ArchTest
-    public static final ArchTests COMMON_TESTS = ArchTests.in(TestCodeArchitectureTestBase.class);
+    // simple test rule that is not violated
+    public static final ArchRule SIMPLE_RULE =
+            FreezingArchRule.freeze(
+                    classes()
+                            .that()
+                            .resideInAPackage("org.apache.flink.connector..")
+                            .should()
+                            .haveSimpleNameContaining("Connector"));
 }
diff --git a/pom.xml b/pom.xml
index 6fbeb01..046c5e1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,6 +24,7 @@ under the License.
 		<artifactId>flink-connector-parent</artifactId>
 		<version>1.0.0</version>
 	</parent>
+
 	<modules>
 		<module>module-with-no-tests</module>
 		<module>module-with-tests</module>
@@ -39,6 +40,8 @@ under the License.
 	<properties>
 		<flink.version>1.17.1</flink.version>
 		<japicmp.referenceVersion>1.16.0</japicmp.referenceVersion>
+		<archunit.version>1.0.0</archunit.version>
+		<slf4j.version>1.7.36</slf4j.version>
 	</properties>
 
 	<dependencies>
@@ -47,55 +50,45 @@ under the License.
 			<artifactId>flink-core</artifactId>
 			<version>${flink.version}</version>
 		</dependency>
-		<dependency>
-			<groupId>org.apache.flink</groupId>
-			<artifactId>flink-test-utils-junit</artifactId>
-			<version>${flink.version}</version>
-			<scope>test</scope>
-			<!-- for dependency convergence -->
-			<exclusions>
-				<exclusion>
-					<groupId>org.apache.commons</groupId>
-					<artifactId>commons-compress</artifactId>
-				</exclusion>
-			</exclusions>
-		</dependency>
-
-		<!-- ArchUit test dependencies -->
-		<dependency>
-			<groupId>org.apache.flink</groupId>
-			<artifactId>flink-architecture-tests-test</artifactId>
-			<version>${flink.version}</version>
-			<scope>test</scope>
-			<!-- for dependency convergence -->
-			<exclusions>
-				<exclusion>
-					<groupId>com.esotericsoftware.kryo</groupId>
-					<artifactId>kryo</artifactId>
-				</exclusion>
-				<exclusion>
-					<groupId>org.junit.platform</groupId>
-					<artifactId>junit-platform-engine</artifactId>
-				</exclusion>
-			</exclusions>
-		</dependency>
-
-		<dependency>
-			<groupId>org.apache.flink</groupId>
-			<artifactId>flink-architecture-tests-production</artifactId>
-			<version>${flink.version}</version>
-			<scope>test</scope>
-		</dependency>
-
 	</dependencies>
 
 	<dependencyManagement>
 		<dependencies>
+
 			<dependency>
 				<groupId>org.slf4j</groupId>
 				<artifactId>slf4j-api</artifactId>
-				<version>1.7.36</version>
+				<version>${slf4j.version}</version>
 			</dependency>
+
+			<dependency>
+				<groupId>org.apache.flink</groupId>
+				<artifactId>flink-test-utils-junit</artifactId>
+				<version>${flink.version}</version>
+				<scope>test</scope>
+				<!-- for dependency convergence -->
+				<exclusions>
+					<exclusion>
+						<groupId>org.apache.commons</groupId>
+						<artifactId>commons-compress</artifactId>
+					</exclusion>
+				</exclusions>
+			</dependency>
+
+			<dependency>
+				<groupId>com.tngtech.archunit</groupId>
+				<artifactId>archunit</artifactId>
+				<version>${archunit.version}</version>
+				<scope>test</scope>
+			</dependency>
+
+			<dependency>
+				<groupId>com.tngtech.archunit</groupId>
+				<artifactId>archunit-junit5</artifactId>
+				<version>${archunit.version}</version>
+				<scope>test</scope>
+			</dependency>
+
 		</dependencies>
 	</dependencyManagement>
 


(flink-connector-shared-utils) 02/09: [FLINK-34137] Update test-project parent to regular flink-connector-parent

Posted by ec...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

echauchot pushed a commit to branch ci_utils
in repository https://gitbox.apache.org/repos/asf/flink-connector-shared-utils.git

commit 4c3b7bb7dc35970c7e8a35c49596795af5d22a1b
Author: Etienne Chauchot <ec...@apache.org>
AuthorDate: Mon Nov 6 13:22:58 2023 +0100

    [FLINK-34137] Update test-project parent to regular flink-connector-parent
---
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index 7544839..a32ad20 100644
--- a/pom.xml
+++ b/pom.xml
@@ -20,9 +20,9 @@ under the License.
 	xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 
 	<parent>
-		<groupId>io.github.zentol.flink</groupId>
+		<groupId>org.apache.flink</groupId>
 		<artifactId>flink-connector-parent</artifactId>
-		<version>1.0</version>
+		<version>1.0.0</version>
 	</parent>
 
 	<modelVersion>4.0.0</modelVersion>


(flink-connector-shared-utils) 08/09: [FLINK-34137] exclude junit-platform-engine archunit transitive dep for dependency convergence

Posted by ec...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

echauchot pushed a commit to branch ci_utils
in repository https://gitbox.apache.org/repos/asf/flink-connector-shared-utils.git

commit ad16ea8211f9c28a7540b9bf98a27a92860e4b39
Author: Etienne Chauchot <ec...@apache.org>
AuthorDate: Thu Feb 29 11:06:40 2024 +0100

    [FLINK-34137] exclude junit-platform-engine archunit transitive dep for dependency convergence
---
 pom.xml | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/pom.xml b/pom.xml
index 534ef1d..2fc1e1b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -87,6 +87,13 @@ under the License.
 				<artifactId>archunit-junit5</artifactId>
 				<version>${archunit.version}</version>
 				<scope>test</scope>
+				<!-- for dependency convergence -->
+				<exclusions>
+					<exclusion>
+						<groupId>org.junit.platform</groupId>
+						<artifactId>junit-platform-engine</artifactId>
+					</exclusion>
+				</exclusions>
 			</dependency>
 
 		</dependencies>


(flink-connector-shared-utils) 09/09: [FLINK-34137] upgrade all flinks versions in CI: 1.16.x -> 1.17.x, 1.17.x -> 1.18.x

Posted by ec...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

echauchot pushed a commit to branch ci_utils
in repository https://gitbox.apache.org/repos/asf/flink-connector-shared-utils.git

commit b5ad097df25973ad05d0d6af0f988b65b0d8cd22
Author: Etienne Chauchot <ec...@apache.org>
AuthorDate: Fri Mar 1 11:23:54 2024 +0100

    [FLINK-34137] upgrade all flinks versions in CI: 1.16.x -> 1.17.x, 1.17.x -> 1.18.x
---
 .github/workflows/_testing.yml | 18 +++++++++---------
 pom.xml                        |  2 +-
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/.github/workflows/_testing.yml b/.github/workflows/_testing.yml
index f7b2534..d45b664 100644
--- a/.github/workflows/_testing.yml
+++ b/.github/workflows/_testing.yml
@@ -32,21 +32,21 @@ jobs:
   snapshot-without-archunit-tests:
     uses: ./.github/workflows/ci.yml
     with:
-      flink_version: 1.16-SNAPSHOT
+      flink_version: 1.17-SNAPSHOT
       skip_archunit_tests: true
   # we need to test the connectors against last 2 flink major versions.
-  # let's say the connector under test was built against flink 1.17.2, disable the archunit tests when tested against 1.16.2
+  # let's say the connector under test was built against flink 1.18.0, disable the archunit tests when tested against 1.17.2
   non-main-version-without-archunit-tests:
     uses: ./.github/workflows/ci.yml
     with:
-      flink_version: 1.16.2
+      flink_version: 1.17.2
       skip_archunit_tests: true
   # we need to test the connectors against last 2 flink major versions.
-  # let's say the connector under test was built against flink 1.17.2, leave the archunit tests enabled when tested against 1.17.2
+  # let's say the connector under test was built against flink 1.18.0, leave the archunit tests enabled when tested against 1.18.0
   main-version-with-archunit-tests:
     uses: ./.github/workflows/ci.yml
     with:
-      flink_version: 1.17.2
+      flink_version: 1.18.0
   flink118-java17-version:
     uses: ./.github/workflows/ci.yml
     with:
@@ -57,13 +57,13 @@ jobs:
   disable-convergence:
     uses: ./.github/workflows/ci.yml
     with:
-      flink_version: 1.16.1
+      flink_version: 1.17.2
       connector_branch: ci_utils
       run_dependency_convergence: false
   optional_maven_profile:
     uses: ./.github/workflows/ci.yml
     with:
-      flink_version: 1.16-SNAPSHOT
+      flink_version: 1.17-SNAPSHOT
       connector_branch: ci_utils
       jdk_version: 11
       optional_maven_profiles: "java11,java11-target"
@@ -71,14 +71,14 @@ jobs:
     strategy:
       matrix:
         flink_branches: [{
-          flink: 1.16.1
+          flink: 1.17.2
 #          By not specifying a branch, it should default to the branch that triggers this workflow
         }, {
           flink: 1.17.2,
 #          By specifying this branch, it should check out this specified branch
           branch: ci_utils
         }, {
-          flink: 1.16.1,
+          flink: 1.17.2,
 #          By specifying a different branch then on L49, it should check out this specified branch
           branch: test_project
         }]
diff --git a/pom.xml b/pom.xml
index 2fc1e1b..0a4d4c8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -38,7 +38,7 @@ under the License.
 	<packaging>pom</packaging>
 
 	<properties>
-		<flink.version>1.17.2</flink.version>
+		<flink.version>1.18.0</flink.version>
 		<japicmp.referenceVersion>1.16.0</japicmp.referenceVersion>
 		<archunit.version>1.0.0</archunit.version>
 		<slf4j.version>1.7.36</slf4j.version>


(flink-connector-shared-utils) 07/09: [FLINK-34137] Use flink-connector-parent v1.1.0 with surefire tests exclusions

Posted by ec...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

echauchot pushed a commit to branch ci_utils
in repository https://gitbox.apache.org/repos/asf/flink-connector-shared-utils.git

commit e9f50c1de5918f525bf913bc438f3bee9fb07b08
Author: Etienne Chauchot <ec...@apache.org>
AuthorDate: Thu Jan 18 11:42:49 2024 +0100

    [FLINK-34137] Use flink-connector-parent v1.1.0 with surefire tests exclusions
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 8de083e..534ef1d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@ under the License.
 	<parent>
 		<groupId>org.apache.flink</groupId>
 		<artifactId>flink-connector-parent</artifactId>
-		<version>1.0.0</version>
+		<version>1.1.0</version>
 	</parent>
 
 	<modules>


(flink-connector-shared-utils) 04/09: [FLINK-34137] Create a parent and 2 sub modules: one with tests, and one with no tests

Posted by ec...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

echauchot pushed a commit to branch ci_utils
in repository https://gitbox.apache.org/repos/asf/flink-connector-shared-utils.git

commit 2868ea13a2a287f11b65417ec308382d974faa81
Author: Etienne Chauchot <ec...@apache.org>
AuthorDate: Mon Nov 13 16:41:15 2023 +0100

    [FLINK-34137] Create a parent and 2 sub modules: one with tests, and one with no tests
---
 .gitignore                                                 |  4 +++-
 archunit-violations/stored.rules                           | 10 ----------
 .gitignore => module-with-no-tests/.gitignore              |  5 -----
 module-with-no-tests/pom.xml                               | 13 +++++++++++++
 .../org/apache/flink/connector/testing/SomeClass2.java     |  8 +++-----
 .gitignore => module-with-tests/.gitignore                 |  5 -----
 .../1758f718-5b06-442d-8b5a-ad347bbf549e                   |  0
 .../25d7c950-4d90-4419-b9af-78a9001796ce                   |  0
 .../2c5e2ae5-0e19-423f-9501-d00b090b9d0e                   |  0
 .../3e3429f1-b715-4057-91ce-f859c4c07245                   |  0
 .../662c8ab6-14a2-4f59-bacf-3e7a09427662                   |  0
 .../a2f52e44-eb11-4165-8a96-418e754ac1c6                   |  0
 .../b5a693ee-ab65-41b7-9764-cbe027c4ee12                   |  0
 .../f3351a4e-bc84-4164-aba1-3d729855e431                   |  0
 module-with-tests/archunit-violations/stored.rules         | 10 ++++++++++
 module-with-tests/pom.xml                                  | 14 ++++++++++++++
 .../java/org/apache/flink/connector/testing/SomeClass.java |  9 +--------
 .../org/apache/flink/connector/testing/SomeClassTest.java  |  0
 .../architecture/ProductionCodeArchitectureTest.java       |  0
 .../testing/architecture/TestCodeArchitectureTest.java     |  7 +------
 .../src}/test/resources/archunit.properties                |  0
 pom.xml                                                    |  8 ++++++--
 22 files changed, 51 insertions(+), 42 deletions(-)

diff --git a/.gitignore b/.gitignore
index d6073bc..4e77b1e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,6 +5,8 @@ scalastyle-output.xml
 .idea
 !.idea/vcs.xml
 .metadata
+module-with-no-tests/.metadata
+module-with-tests/.metadata
 .settings
 .project
 .version.properties
@@ -35,4 +37,4 @@ out/
 tools/flink
 tools/flink-*
 tools/releasing/release
-tools/japicmp-output
\ No newline at end of file
+tools/japicmp-output
diff --git a/archunit-violations/stored.rules b/archunit-violations/stored.rules
deleted file mode 100644
index 4c2eeb9..0000000
--- a/archunit-violations/stored.rules
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-#Wed Oct 11 15:35:58 CEST 2023
-Return\ and\ argument\ types\ of\ methods\ annotated\ with\ @Public\ must\ be\ annotated\ with\ @Public.=2b408df1-117c-43ee-8829-11a33f2f4c3d
-Connector\ production\ code\ must\ not\ depend\ on\ non-public\ API\ outside\ of\ connector\ packages=47150079-df0b-4320-b1a9-117804d1d2b9
-ITCASE\ tests\ should\ use\ a\ MiniCluster\ resource\ or\ extension=acfbc678-b208-4e82-b2c9-09b53dc0eec5
-Production\ code\ must\ not\ call\ methods\ annotated\ with\ @VisibleForTesting=a6ff808a-1aeb-4ff3-8fe6-3a5cb49fba71
-Tests\ inheriting\ from\ AbstractTestBase\ should\ have\ name\ ending\ with\ ITCase=06adde03-b226-46a1-880e-e3f9d0fbcfcb
-Options\ for\ connectors\ and\ formats\ should\ reside\ in\ a\ consistent\ package\ and\ be\ public\ API.=737d7692-7d8e-4a4e-94d4-61e573619ec4
-Return\ and\ argument\ types\ of\ methods\ annotated\ with\ @PublicEvolving\ must\ be\ annotated\ with\ @Public(Evolving).=61e2247d-4ef0-4327-ad7f-2dc5cd881a4d
-Classes\ in\ API\ packages\ should\ have\ at\ least\ one\ API\ visibility\ annotation.=9193bee2-f400-432f-b664-7ed218451dc9
diff --git a/.gitignore b/module-with-no-tests/.gitignore
similarity index 82%
copy from .gitignore
copy to module-with-no-tests/.gitignore
index d6073bc..78fd2bd 100644
--- a/.gitignore
+++ b/module-with-no-tests/.gitignore
@@ -4,7 +4,6 @@ scalastyle-output.xml
 .classpath
 .idea
 !.idea/vcs.xml
-.metadata
 .settings
 .project
 .version.properties
@@ -32,7 +31,3 @@ out/
 /docs/.jekyll-metadata
 *.ipr
 *.iws
-tools/flink
-tools/flink-*
-tools/releasing/release
-tools/japicmp-output
\ No newline at end of file
diff --git a/module-with-no-tests/pom.xml b/module-with-no-tests/pom.xml
new file mode 100644
index 0000000..da0c156
--- /dev/null
+++ b/module-with-no-tests/pom.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+		 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+		 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.apache.flink</groupId>
+		<artifactId>test-project-parent</artifactId>
+		<version>1.0</version>
+	</parent>
+
+	<artifactId>module-with-no-tests</artifactId>
+</project>
diff --git a/src/test/java/org/apache/flink/connector/testing/SomeClassTest.java b/module-with-no-tests/src/main/java/org/apache/flink/connector/testing/SomeClass2.java
similarity index 83%
copy from src/test/java/org/apache/flink/connector/testing/SomeClassTest.java
copy to module-with-no-tests/src/main/java/org/apache/flink/connector/testing/SomeClass2.java
index 57630b7..8429c55 100644
--- a/src/test/java/org/apache/flink/connector/testing/SomeClassTest.java
+++ b/module-with-no-tests/src/main/java/org/apache/flink/connector/testing/SomeClass2.java
@@ -18,10 +18,8 @@
 
 package org.apache.flink.connector.testing;
 
-import org.junit.jupiter.api.Test;
+/** A dummy class; only exists so that the compile/packaging plugins have something to do. */
+public class SomeClass2 {
 
-class SomeClassTest {
-
-    @Test
-    void someTest() {}
+    public static void main(String[] args) {}
 }
diff --git a/.gitignore b/module-with-tests/.gitignore
similarity index 82%
copy from .gitignore
copy to module-with-tests/.gitignore
index d6073bc..78fd2bd 100644
--- a/.gitignore
+++ b/module-with-tests/.gitignore
@@ -4,7 +4,6 @@ scalastyle-output.xml
 .classpath
 .idea
 !.idea/vcs.xml
-.metadata
 .settings
 .project
 .version.properties
@@ -32,7 +31,3 @@ out/
 /docs/.jekyll-metadata
 *.ipr
 *.iws
-tools/flink
-tools/flink-*
-tools/releasing/release
-tools/japicmp-output
\ No newline at end of file
diff --git a/archunit-violations/06adde03-b226-46a1-880e-e3f9d0fbcfcb b/module-with-tests/archunit-violations/1758f718-5b06-442d-8b5a-ad347bbf549e
similarity index 100%
rename from archunit-violations/06adde03-b226-46a1-880e-e3f9d0fbcfcb
rename to module-with-tests/archunit-violations/1758f718-5b06-442d-8b5a-ad347bbf549e
diff --git a/archunit-violations/2b408df1-117c-43ee-8829-11a33f2f4c3d b/module-with-tests/archunit-violations/25d7c950-4d90-4419-b9af-78a9001796ce
similarity index 100%
rename from archunit-violations/2b408df1-117c-43ee-8829-11a33f2f4c3d
rename to module-with-tests/archunit-violations/25d7c950-4d90-4419-b9af-78a9001796ce
diff --git a/archunit-violations/47150079-df0b-4320-b1a9-117804d1d2b9 b/module-with-tests/archunit-violations/2c5e2ae5-0e19-423f-9501-d00b090b9d0e
similarity index 100%
rename from archunit-violations/47150079-df0b-4320-b1a9-117804d1d2b9
rename to module-with-tests/archunit-violations/2c5e2ae5-0e19-423f-9501-d00b090b9d0e
diff --git a/archunit-violations/61e2247d-4ef0-4327-ad7f-2dc5cd881a4d b/module-with-tests/archunit-violations/3e3429f1-b715-4057-91ce-f859c4c07245
similarity index 100%
rename from archunit-violations/61e2247d-4ef0-4327-ad7f-2dc5cd881a4d
rename to module-with-tests/archunit-violations/3e3429f1-b715-4057-91ce-f859c4c07245
diff --git a/archunit-violations/737d7692-7d8e-4a4e-94d4-61e573619ec4 b/module-with-tests/archunit-violations/662c8ab6-14a2-4f59-bacf-3e7a09427662
similarity index 100%
rename from archunit-violations/737d7692-7d8e-4a4e-94d4-61e573619ec4
rename to module-with-tests/archunit-violations/662c8ab6-14a2-4f59-bacf-3e7a09427662
diff --git a/archunit-violations/9193bee2-f400-432f-b664-7ed218451dc9 b/module-with-tests/archunit-violations/a2f52e44-eb11-4165-8a96-418e754ac1c6
similarity index 100%
rename from archunit-violations/9193bee2-f400-432f-b664-7ed218451dc9
rename to module-with-tests/archunit-violations/a2f52e44-eb11-4165-8a96-418e754ac1c6
diff --git a/archunit-violations/a6ff808a-1aeb-4ff3-8fe6-3a5cb49fba71 b/module-with-tests/archunit-violations/b5a693ee-ab65-41b7-9764-cbe027c4ee12
similarity index 100%
rename from archunit-violations/a6ff808a-1aeb-4ff3-8fe6-3a5cb49fba71
rename to module-with-tests/archunit-violations/b5a693ee-ab65-41b7-9764-cbe027c4ee12
diff --git a/archunit-violations/acfbc678-b208-4e82-b2c9-09b53dc0eec5 b/module-with-tests/archunit-violations/f3351a4e-bc84-4164-aba1-3d729855e431
similarity index 100%
rename from archunit-violations/acfbc678-b208-4e82-b2c9-09b53dc0eec5
rename to module-with-tests/archunit-violations/f3351a4e-bc84-4164-aba1-3d729855e431
diff --git a/module-with-tests/archunit-violations/stored.rules b/module-with-tests/archunit-violations/stored.rules
new file mode 100644
index 0000000..e6fc6f1
--- /dev/null
+++ b/module-with-tests/archunit-violations/stored.rules
@@ -0,0 +1,10 @@
+#
+#Mon Nov 13 16:33:48 CET 2023
+Return\ and\ argument\ types\ of\ methods\ annotated\ with\ @Public\ must\ be\ annotated\ with\ @Public.=662c8ab6-14a2-4f59-bacf-3e7a09427662
+Connector\ production\ code\ must\ not\ depend\ on\ non-public\ API\ outside\ of\ connector\ packages=3e3429f1-b715-4057-91ce-f859c4c07245
+ITCASE\ tests\ should\ use\ a\ MiniCluster\ resource\ or\ extension=f3351a4e-bc84-4164-aba1-3d729855e431
+Production\ code\ must\ not\ call\ methods\ annotated\ with\ @VisibleForTesting=a2f52e44-eb11-4165-8a96-418e754ac1c6
+Tests\ inheriting\ from\ AbstractTestBase\ should\ have\ name\ ending\ with\ ITCase=b5a693ee-ab65-41b7-9764-cbe027c4ee12
+Options\ for\ connectors\ and\ formats\ should\ reside\ in\ a\ consistent\ package\ and\ be\ public\ API.=25d7c950-4d90-4419-b9af-78a9001796ce
+Return\ and\ argument\ types\ of\ methods\ annotated\ with\ @PublicEvolving\ must\ be\ annotated\ with\ @Public(Evolving).=1758f718-5b06-442d-8b5a-ad347bbf549e
+Classes\ in\ API\ packages\ should\ have\ at\ least\ one\ API\ visibility\ annotation.=2c5e2ae5-0e19-423f-9501-d00b090b9d0e
diff --git a/module-with-tests/pom.xml b/module-with-tests/pom.xml
new file mode 100644
index 0000000..c4e6084
--- /dev/null
+++ b/module-with-tests/pom.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+		 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+		 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.apache.flink</groupId>
+		<artifactId>test-project-parent</artifactId>
+		<version>1.0</version>
+	</parent>
+
+	<artifactId>module-with-tests</artifactId>
+
+</project>
diff --git a/src/main/java/org/apache/flink/connector/testing/SomeClass.java b/module-with-tests/src/main/java/org/apache/flink/connector/testing/SomeClass.java
similarity index 73%
rename from src/main/java/org/apache/flink/connector/testing/SomeClass.java
rename to module-with-tests/src/main/java/org/apache/flink/connector/testing/SomeClass.java
index 8285bb4..f29e5e0 100644
--- a/src/main/java/org/apache/flink/connector/testing/SomeClass.java
+++ b/module-with-tests/src/main/java/org/apache/flink/connector/testing/SomeClass.java
@@ -18,14 +18,7 @@
 
 package org.apache.flink.connector.testing;
 
-import static org.apache.flink.util.Preconditions.checkNotNull;
-
 /** A dummy class; only exists so that the compile/packaging plugins have something to do. */
 public class SomeClass {
-    public static void main(String[] args) {
-        // this call is an intended (for testing) violation of the
-        // ConnectorRules#CONNECTOR_CLASSES_ONLY_DEPEND_ON_PUBLIC_API archunit rule that was fixed
-        // in Flink 1.18
-        checkNotNull(new Object());
-    }
+    public static void main(String[] args) {}
 }
diff --git a/src/test/java/org/apache/flink/connector/testing/SomeClassTest.java b/module-with-tests/src/test/java/org/apache/flink/connector/testing/SomeClassTest.java
similarity index 100%
rename from src/test/java/org/apache/flink/connector/testing/SomeClassTest.java
rename to module-with-tests/src/test/java/org/apache/flink/connector/testing/SomeClassTest.java
diff --git a/src/test/java/org/apache/flink/connector/testing/architecture/ProductionCodeArchitectureTest.java b/module-with-tests/src/test/java/org/apache/flink/connector/testing/architecture/ProductionCodeArchitectureTest.java
similarity index 100%
rename from src/test/java/org/apache/flink/connector/testing/architecture/ProductionCodeArchitectureTest.java
rename to module-with-tests/src/test/java/org/apache/flink/connector/testing/architecture/ProductionCodeArchitectureTest.java
diff --git a/src/test/java/org/apache/flink/connector/testing/architecture/TestCodeArchitectureTest.java b/module-with-tests/src/test/java/org/apache/flink/connector/testing/architecture/TestCodeArchitectureTest.java
similarity index 86%
rename from src/test/java/org/apache/flink/connector/testing/architecture/TestCodeArchitectureTest.java
rename to module-with-tests/src/test/java/org/apache/flink/connector/testing/architecture/TestCodeArchitectureTest.java
index 7357fcc..5d8e4ed 100644
--- a/src/test/java/org/apache/flink/connector/testing/architecture/TestCodeArchitectureTest.java
+++ b/module-with-tests/src/test/java/org/apache/flink/connector/testing/architecture/TestCodeArchitectureTest.java
@@ -28,12 +28,7 @@ import com.tngtech.archunit.junit.ArchTests;
 
 /** Architecture tests for test code. */
 @AnalyzeClasses(
-        packages = {
-            "org.apache.flink.batch.connectors.cassandra",
-            "org.apache.flink.streaming.connectors.cassandra",
-            "org.apache.flink.connector.cassandra",
-            "org.apache.flink.connectors.cassandra"
-        },
+        packages = {"org.apache.flink.connector.testing"},
         importOptions = {
             ImportOption.OnlyIncludeTests.class,
             ImportOptions.ExcludeScalaImportOption.class,
diff --git a/src/test/resources/archunit.properties b/module-with-tests/src/test/resources/archunit.properties
similarity index 100%
rename from src/test/resources/archunit.properties
rename to module-with-tests/src/test/resources/archunit.properties
diff --git a/pom.xml b/pom.xml
index a32ad20..6fbeb01 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,13 +24,17 @@ under the License.
 		<artifactId>flink-connector-parent</artifactId>
 		<version>1.0.0</version>
 	</parent>
+	<modules>
+		<module>module-with-no-tests</module>
+		<module>module-with-tests</module>
+	</modules>
 
 	<modelVersion>4.0.0</modelVersion>
 
 	<groupId>org.apache.flink</groupId>
-	<artifactId>test-project</artifactId>
+	<artifactId>test-project-parent</artifactId>
 	<version>1.0</version>
-	<packaging>jar</packaging>
+	<packaging>pom</packaging>
 
 	<properties>
 		<flink.version>1.17.1</flink.version>


(flink-connector-shared-utils) 06/09: [FLINK-34137] Bump to flink 1.17.2

Posted by ec...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

echauchot pushed a commit to branch ci_utils
in repository https://gitbox.apache.org/repos/asf/flink-connector-shared-utils.git

commit e6e2136fb44c01e5ebe2e2ac57eb4361073343f2
Author: Etienne Chauchot <ec...@apache.org>
AuthorDate: Wed Nov 29 10:59:12 2023 +0100

    [FLINK-34137] Bump to flink 1.17.2
---
 .github/workflows/_testing.yml | 10 +++++-----
 pom.xml                        |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/_testing.yml b/.github/workflows/_testing.yml
index 84eb71d..f7b2534 100644
--- a/.github/workflows/_testing.yml
+++ b/.github/workflows/_testing.yml
@@ -25,7 +25,7 @@ jobs:
   specific-version:
     uses: ./.github/workflows/ci.yml
     with:
-      flink_version: 1.17.1
+      flink_version: 1.17.2
       connector_branch: ci_utils
   # we can test connectors against flink snapshots but enable archunit tests only when tested against
   # the flink version used for the connector build.
@@ -35,18 +35,18 @@ jobs:
       flink_version: 1.16-SNAPSHOT
       skip_archunit_tests: true
   # we need to test the connectors against last 2 flink major versions.
-  # let's say the connector under test was built against flink 1.17.1, disable the archunit tests when tested against 1.16.2
+  # let's say the connector under test was built against flink 1.17.2, disable the archunit tests when tested against 1.16.2
   non-main-version-without-archunit-tests:
     uses: ./.github/workflows/ci.yml
     with:
       flink_version: 1.16.2
       skip_archunit_tests: true
   # we need to test the connectors against last 2 flink major versions.
-  # let's say the connector under test was built against flink 1.17.1, leave the archunit tests enabled when tested against 1.17.1
+  # let's say the connector under test was built against flink 1.17.2, leave the archunit tests enabled when tested against 1.17.2
   main-version-with-archunit-tests:
     uses: ./.github/workflows/ci.yml
     with:
-      flink_version: 1.17.1
+      flink_version: 1.17.2
   flink118-java17-version:
     uses: ./.github/workflows/ci.yml
     with:
@@ -74,7 +74,7 @@ jobs:
           flink: 1.16.1
 #          By not specifying a branch, it should default to the branch that triggers this workflow
         }, {
-          flink: 1.17.1,
+          flink: 1.17.2,
 #          By specifying this branch, it should check out this specified branch
           branch: ci_utils
         }, {
diff --git a/pom.xml b/pom.xml
index 046c5e1..8de083e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -38,7 +38,7 @@ under the License.
 	<packaging>pom</packaging>
 
 	<properties>
-		<flink.version>1.17.1</flink.version>
+		<flink.version>1.17.2</flink.version>
 		<japicmp.referenceVersion>1.16.0</japicmp.referenceVersion>
 		<archunit.version>1.0.0</archunit.version>
 		<slf4j.version>1.7.36</slf4j.version>


(flink-connector-shared-utils) 01/09: [FLINK-34137] Setup CI and archunit for archunit tests skipping

Posted by ec...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

echauchot pushed a commit to branch ci_utils
in repository https://gitbox.apache.org/repos/asf/flink-connector-shared-utils.git

commit 30d0b106eb1df8db2875f24d2353c28920af468e
Author: Etienne Chauchot <ec...@apache.org>
AuthorDate: Mon Oct 9 16:28:45 2023 +0200

    [FLINK-34137] Setup CI and archunit for archunit tests skipping
---
 .github/workflows/_testing.yml                     | 21 ++++++++--
 .github/workflows/ci.yml                           | 10 +++++
 .../06adde03-b226-46a1-880e-e3f9d0fbcfcb           |  0
 .../2b408df1-117c-43ee-8829-11a33f2f4c3d           |  0
 .../47150079-df0b-4320-b1a9-117804d1d2b9           |  0
 .../61e2247d-4ef0-4327-ad7f-2dc5cd881a4d           |  0
 .../737d7692-7d8e-4a4e-94d4-61e573619ec4           |  0
 .../9193bee2-f400-432f-b664-7ed218451dc9           |  0
 .../a6ff808a-1aeb-4ff3-8fe6-3a5cb49fba71           |  0
 .../acfbc678-b208-4e82-b2c9-09b53dc0eec5           |  0
 archunit-violations/stored.rules                   | 10 +++++
 pom.xml                                            | 36 ++++++++++++++++-
 .../apache/flink/connector/testing/SomeClass.java  | 11 +++++-
 .../ProductionCodeArchitectureTest.java            | 42 ++++++++++++++++++++
 .../architecture/TestCodeArchitectureTest.java     | 46 ++++++++++++++++++++++
 src/test/resources/archunit.properties             | 38 ++++++++++++++++++
 16 files changed, 209 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/_testing.yml b/.github/workflows/_testing.yml
index aca4d74..84eb71d 100644
--- a/.github/workflows/_testing.yml
+++ b/.github/workflows/_testing.yml
@@ -25,13 +25,28 @@ jobs:
   specific-version:
     uses: ./.github/workflows/ci.yml
     with:
-      flink_version: 1.16.1
+      flink_version: 1.17.1
       connector_branch: ci_utils
-  snapshot-version:
+  # we can test connectors against flink snapshots but enable archunit tests only when tested against
+  # the flink version used for the connector build.
+  snapshot-without-archunit-tests:
     uses: ./.github/workflows/ci.yml
     with:
       flink_version: 1.16-SNAPSHOT
-      connector_branch: ci_utils
+      skip_archunit_tests: true
+  # we need to test the connectors against last 2 flink major versions.
+  # let's say the connector under test was built against flink 1.17.1, disable the archunit tests when tested against 1.16.2
+  non-main-version-without-archunit-tests:
+    uses: ./.github/workflows/ci.yml
+    with:
+      flink_version: 1.16.2
+      skip_archunit_tests: true
+  # we need to test the connectors against last 2 flink major versions.
+  # let's say the connector under test was built against flink 1.17.1, leave the archunit tests enabled when tested against 1.17.1
+  main-version-with-archunit-tests:
+    uses: ./.github/workflows/ci.yml
+    with:
+      flink_version: 1.17.1
   flink118-java17-version:
     uses: ./.github/workflows/ci.yml
     with:
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 418998d..bc12766 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -51,6 +51,11 @@ on:
         required: false
         type: boolean
         default: true
+      skip_archunit_tests:
+        description: "Whether to skip the archunit tests"
+        required: false
+        type: boolean
+        default: false
       connector_branch:
         description: "Branch that need to be checked out"
         required: false
@@ -101,6 +106,10 @@ jobs:
         if: ${{ inputs.optional_maven_profiles }}
         run: echo "MVN_COMMON_OPTIONS=${MVN_COMMON_OPTIONS} -P ${{ inputs.optional_maven_profiles }}" >> $GITHUB_ENV
 
+      - name: "Disable archunit tests"
+        if: ${{ inputs.skip_archunit_tests }}
+        run: echo "MVN_ARCHUNIT_TESTS=-Dtest='!*ArchitectureTest'" >> $GITHUB_ENV
+
       - name: "Determine Flink binary url"
         run: |
           binary_url=${{ inputs.flink_url }}
@@ -159,6 +168,7 @@ jobs:
             -Dscala-2.12 \
             -Prun-end-to-end-tests -DdistDir=${{ env.FLINK_CACHE_DIR }}/flink-${{ inputs.flink_version }} \
             ${{ env.MVN_DEPENDENCY_CONVERGENCE }} \
+            ${{ env.MVN_ARCHUNIT_TESTS }} \
             ${{ env.MVN_CONNECTION_OPTIONS }} \
             -Dlog4j.configurationFile=file://$(pwd)/tools/ci/log4j.properties \
             | tee ${{ env.MVN_BUILD_OUTPUT_FILE }}
diff --git a/archunit-violations/06adde03-b226-46a1-880e-e3f9d0fbcfcb b/archunit-violations/06adde03-b226-46a1-880e-e3f9d0fbcfcb
new file mode 100644
index 0000000..e69de29
diff --git a/archunit-violations/2b408df1-117c-43ee-8829-11a33f2f4c3d b/archunit-violations/2b408df1-117c-43ee-8829-11a33f2f4c3d
new file mode 100644
index 0000000..e69de29
diff --git a/archunit-violations/47150079-df0b-4320-b1a9-117804d1d2b9 b/archunit-violations/47150079-df0b-4320-b1a9-117804d1d2b9
new file mode 100644
index 0000000..e69de29
diff --git a/archunit-violations/61e2247d-4ef0-4327-ad7f-2dc5cd881a4d b/archunit-violations/61e2247d-4ef0-4327-ad7f-2dc5cd881a4d
new file mode 100644
index 0000000..e69de29
diff --git a/archunit-violations/737d7692-7d8e-4a4e-94d4-61e573619ec4 b/archunit-violations/737d7692-7d8e-4a4e-94d4-61e573619ec4
new file mode 100644
index 0000000..e69de29
diff --git a/archunit-violations/9193bee2-f400-432f-b664-7ed218451dc9 b/archunit-violations/9193bee2-f400-432f-b664-7ed218451dc9
new file mode 100644
index 0000000..e69de29
diff --git a/archunit-violations/a6ff808a-1aeb-4ff3-8fe6-3a5cb49fba71 b/archunit-violations/a6ff808a-1aeb-4ff3-8fe6-3a5cb49fba71
new file mode 100644
index 0000000..e69de29
diff --git a/archunit-violations/acfbc678-b208-4e82-b2c9-09b53dc0eec5 b/archunit-violations/acfbc678-b208-4e82-b2c9-09b53dc0eec5
new file mode 100644
index 0000000..e69de29
diff --git a/archunit-violations/stored.rules b/archunit-violations/stored.rules
new file mode 100644
index 0000000..4c2eeb9
--- /dev/null
+++ b/archunit-violations/stored.rules
@@ -0,0 +1,10 @@
+#
+#Wed Oct 11 15:35:58 CEST 2023
+Return\ and\ argument\ types\ of\ methods\ annotated\ with\ @Public\ must\ be\ annotated\ with\ @Public.=2b408df1-117c-43ee-8829-11a33f2f4c3d
+Connector\ production\ code\ must\ not\ depend\ on\ non-public\ API\ outside\ of\ connector\ packages=47150079-df0b-4320-b1a9-117804d1d2b9
+ITCASE\ tests\ should\ use\ a\ MiniCluster\ resource\ or\ extension=acfbc678-b208-4e82-b2c9-09b53dc0eec5
+Production\ code\ must\ not\ call\ methods\ annotated\ with\ @VisibleForTesting=a6ff808a-1aeb-4ff3-8fe6-3a5cb49fba71
+Tests\ inheriting\ from\ AbstractTestBase\ should\ have\ name\ ending\ with\ ITCase=06adde03-b226-46a1-880e-e3f9d0fbcfcb
+Options\ for\ connectors\ and\ formats\ should\ reside\ in\ a\ consistent\ package\ and\ be\ public\ API.=737d7692-7d8e-4a4e-94d4-61e573619ec4
+Return\ and\ argument\ types\ of\ methods\ annotated\ with\ @PublicEvolving\ must\ be\ annotated\ with\ @Public(Evolving).=61e2247d-4ef0-4327-ad7f-2dc5cd881a4d
+Classes\ in\ API\ packages\ should\ have\ at\ least\ one\ API\ visibility\ annotation.=9193bee2-f400-432f-b664-7ed218451dc9
diff --git a/pom.xml b/pom.xml
index fa1b1d6..7544839 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,7 +33,7 @@ under the License.
 	<packaging>jar</packaging>
 
 	<properties>
-		<flink.version>1.16.1</flink.version>
+		<flink.version>1.17.1</flink.version>
 		<japicmp.referenceVersion>1.16.0</japicmp.referenceVersion>
 	</properties>
 
@@ -48,7 +48,41 @@ under the License.
 			<artifactId>flink-test-utils-junit</artifactId>
 			<version>${flink.version}</version>
 			<scope>test</scope>
+			<!-- for dependency convergence -->
+			<exclusions>
+				<exclusion>
+					<groupId>org.apache.commons</groupId>
+					<artifactId>commons-compress</artifactId>
+				</exclusion>
+			</exclusions>
 		</dependency>
+
+		<!-- ArchUit test dependencies -->
+		<dependency>
+			<groupId>org.apache.flink</groupId>
+			<artifactId>flink-architecture-tests-test</artifactId>
+			<version>${flink.version}</version>
+			<scope>test</scope>
+			<!-- for dependency convergence -->
+			<exclusions>
+				<exclusion>
+					<groupId>com.esotericsoftware.kryo</groupId>
+					<artifactId>kryo</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>org.junit.platform</groupId>
+					<artifactId>junit-platform-engine</artifactId>
+				</exclusion>
+			</exclusions>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.flink</groupId>
+			<artifactId>flink-architecture-tests-production</artifactId>
+			<version>${flink.version}</version>
+			<scope>test</scope>
+		</dependency>
+
 	</dependencies>
 
 	<dependencyManagement>
diff --git a/src/main/java/org/apache/flink/connector/testing/SomeClass.java b/src/main/java/org/apache/flink/connector/testing/SomeClass.java
index 36da836..8285bb4 100644
--- a/src/main/java/org/apache/flink/connector/testing/SomeClass.java
+++ b/src/main/java/org/apache/flink/connector/testing/SomeClass.java
@@ -18,5 +18,14 @@
 
 package org.apache.flink.connector.testing;
 
+import static org.apache.flink.util.Preconditions.checkNotNull;
+
 /** A dummy class; only exists so that the compile/packaging plugins have something to do. */
-public class SomeClass {}
+public class SomeClass {
+    public static void main(String[] args) {
+        // this call is an intended (for testing) violation of the
+        // ConnectorRules#CONNECTOR_CLASSES_ONLY_DEPEND_ON_PUBLIC_API archunit rule that was fixed
+        // in Flink 1.18
+        checkNotNull(new Object());
+    }
+}
diff --git a/src/test/java/org/apache/flink/connector/testing/architecture/ProductionCodeArchitectureTest.java b/src/test/java/org/apache/flink/connector/testing/architecture/ProductionCodeArchitectureTest.java
new file mode 100644
index 0000000..6f80e05
--- /dev/null
+++ b/src/test/java/org/apache/flink/connector/testing/architecture/ProductionCodeArchitectureTest.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.connector.testing.architecture;
+
+import org.apache.flink.architecture.ProductionCodeArchitectureBase;
+import org.apache.flink.architecture.common.ImportOptions;
+
+import com.tngtech.archunit.core.importer.ImportOption;
+import com.tngtech.archunit.junit.AnalyzeClasses;
+import com.tngtech.archunit.junit.ArchTest;
+import com.tngtech.archunit.junit.ArchTests;
+
+/** product code Architecture tests. */
+@AnalyzeClasses(
+        packages = "org.apache.flink.connector",
+        importOptions = {
+            ImportOption.DoNotIncludeTests.class,
+            ImportOption.DoNotIncludeArchives.class,
+            ImportOptions.ExcludeScalaImportOption.class,
+            ImportOptions.ExcludeShadedImportOption.class
+        })
+public class ProductionCodeArchitectureTest {
+
+    @ArchTest
+    public static final ArchTests COMMON_TESTS = ArchTests.in(ProductionCodeArchitectureBase.class);
+}
diff --git a/src/test/java/org/apache/flink/connector/testing/architecture/TestCodeArchitectureTest.java b/src/test/java/org/apache/flink/connector/testing/architecture/TestCodeArchitectureTest.java
new file mode 100644
index 0000000..7357fcc
--- /dev/null
+++ b/src/test/java/org/apache/flink/connector/testing/architecture/TestCodeArchitectureTest.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.connector.testing.architecture;
+
+import org.apache.flink.architecture.TestCodeArchitectureTestBase;
+import org.apache.flink.architecture.common.ImportOptions;
+
+import com.tngtech.archunit.core.importer.ImportOption;
+import com.tngtech.archunit.junit.AnalyzeClasses;
+import com.tngtech.archunit.junit.ArchTest;
+import com.tngtech.archunit.junit.ArchTests;
+
+/** Architecture tests for test code. */
+@AnalyzeClasses(
+        packages = {
+            "org.apache.flink.batch.connectors.cassandra",
+            "org.apache.flink.streaming.connectors.cassandra",
+            "org.apache.flink.connector.cassandra",
+            "org.apache.flink.connectors.cassandra"
+        },
+        importOptions = {
+            ImportOption.OnlyIncludeTests.class,
+            ImportOptions.ExcludeScalaImportOption.class,
+            ImportOptions.ExcludeShadedImportOption.class
+        })
+public class TestCodeArchitectureTest {
+
+    @ArchTest
+    public static final ArchTests COMMON_TESTS = ArchTests.in(TestCodeArchitectureTestBase.class);
+}
diff --git a/src/test/resources/archunit.properties b/src/test/resources/archunit.properties
new file mode 100644
index 0000000..07b2ea7
--- /dev/null
+++ b/src/test/resources/archunit.properties
@@ -0,0 +1,38 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# This controls if the violation store is writable
+freeze.store.default.allowStoreUpdate=true
+
+# Enable this if a new rule was added or the description of an existing rule has changed.
+# It is needed to record future violations of this rule.
+# If omitted, future violations of the rule will not be considered as violations as the initial store was not created for this rule.
+#freeze.store.default.allowStoreCreation=true
+
+# Enable this to record the current state of violations.
+# This can make sense, because current violations are consciously accepted and should be added to the store
+# By default we allow removing existing violations, but fail when new violations are added
+# NOTE: Adding new violations should be avoided when possible. If the rule was correct to flag a new
+#       violation, please try to avoid creating the violation. If the violation was created due to a
+#       shortcoming of the rule, file a JIRA issue so the rule can be improved.
+#freeze.refreeze=true
+
+freeze.store.default.path=archunit-violations
+
+# To allow all rules to be evaluated without checking any classes you can set the following property
+archRule.failOnEmptyShould = false


(flink-connector-shared-utils) 03/09: [FLINK-34137] Use additionalExcludes property to exclude archunit tests

Posted by ec...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

echauchot pushed a commit to branch ci_utils
in repository https://gitbox.apache.org/repos/asf/flink-connector-shared-utils.git

commit 866c7b426506a30f1cdc11a6e0c9d247c2eb06d1
Author: Etienne Chauchot <ec...@apache.org>
AuthorDate: Mon Nov 6 17:22:52 2023 +0100

    [FLINK-34137] Use additionalExcludes property to exclude archunit tests
---
 .github/workflows/ci.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index bc12766..462dade 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -108,7 +108,7 @@ jobs:
 
       - name: "Disable archunit tests"
         if: ${{ inputs.skip_archunit_tests }}
-        run: echo "MVN_ARCHUNIT_TESTS=-Dtest='!*ArchitectureTest'" >> $GITHUB_ENV
+        run: echo "MVN_ARCHUNIT_TESTS=-DadditionalExcludes=**/*ArchitectureTest.java" >> $GITHUB_ENV
 
       - name: "Determine Flink binary url"
         run: |