You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "eskabetxe (via GitHub)" <gi...@apache.org> on 2024/08/28 20:56:51 UTC

[PR] [FLINK-36009] Architecture tests refactor and fixes [flink-connector-jdbc]

eskabetxe opened a new pull request, #140:
URL: https://github.com/apache/flink-connector-jdbc/pull/140

   - Created the module flink-connector-jdbc-architecture to have all tests, we need to add the modules as dependency to validate that module..
   - Created the package "org.apache.flink.connector.jdbc.core.util" to have classes of flink that are Internal and fails on architecture (could be discussed)
   -- Precondition for Preconditions
   -- VisibleForTest for VisibleForTesting
   -- Other under evaluation, we still have 91 offends on "Connector production code must depend only on public API when outside of connector packages"
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-36009] Architecture tests refactor and fixes [flink-connector-jdbc]

Posted by "RocMarshal (via GitHub)" <gi...@apache.org>.
RocMarshal commented on PR #140:
URL: https://github.com/apache/flink-connector-jdbc/pull/140#issuecomment-2401103241

   > @RocMarshal thanks for your review..
   > 
   > I think I could change this to 2 PRs... one with the new architecture module and another with changes to fix the "Connector production code must depend only on public API when outside of connector packages" What do you think?
   
   good idea. Make sense to me~ 
   BTW, The first PR could be done first, and it might be better to start the second task after we have some results from the discussion ?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-36009] Architecture tests refactor and fixes [flink-connector-jdbc]

Posted by "RocMarshal (via GitHub)" <gi...@apache.org>.
RocMarshal commented on code in PR #140:
URL: https://github.com/apache/flink-connector-jdbc/pull/140#discussion_r1792677288


##########
flink-connector-jdbc-core/src/main/java/org/apache/flink/connector/jdbc/core/util/VisibleForTest.java:
##########
@@ -0,0 +1,20 @@
+package org.apache.flink.connector.jdbc.core.util;
+
+import org.apache.flink.annotation.PublicEvolving;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+
+/**
+ * This annotations declares that a function, field, constructor, or entire type, is only visible
+ * for testing purposes.
+ *
+ * <p>This annotation is typically attached when for example a method should be {@code private}
+ * (because it is not intended to be called externally), but cannot be declared private, because
+ * some tests need to have access to it.
+ */
+@Documented
+@Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD, ElementType.CONSTRUCTOR})
+@PublicEvolving
+public @interface VisibleForTest {}

Review Comment:
   Thx for the comment.
   Maybe there’s no rush to modify anything before we reaching a conclusion.
   
   I'm not familiar with the entire testing framework and the use of annotations in Flink, so I couldn't make useful ideas.
   If we decide to change the relevant annotations and utility classes to `non-internal`, we should confirm what impact this will have on the main Flink repository. If the impact is minimal, maybe we can initiate a discussion.
   
   Hi, @MartijnVisser could you help give some ideas about it? Many thanks~ :)
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-36009] Architecture tests fixes [flink-connector-jdbc]

Posted by "eskabetxe (via GitHub)" <gi...@apache.org>.
eskabetxe commented on PR #140:
URL: https://github.com/apache/flink-connector-jdbc/pull/140#issuecomment-2401637907

   Created another PR only with new module for architecture change [here](https://github.com/apache/flink-connector-jdbc/pull/143/files)
   This is keeped to allow the discussion about the fixes, and will be simplified so the other PR is merged.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-36009] Architecture tests refactor and fixes [flink-connector-jdbc]

Posted by "eskabetxe (via GitHub)" <gi...@apache.org>.
eskabetxe commented on PR #140:
URL: https://github.com/apache/flink-connector-jdbc/pull/140#issuecomment-2322095949

   @RocMarshal @1996fanrui can you check when have time


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-36009] Architecture tests fixes [flink-connector-jdbc]

Posted by "eskabetxe (via GitHub)" <gi...@apache.org>.
eskabetxe closed pull request #140: [FLINK-36009] Architecture tests fixes
URL: https://github.com/apache/flink-connector-jdbc/pull/140


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-36009] Architecture tests refactor and fixes [flink-connector-jdbc]

Posted by "RocMarshal (via GitHub)" <gi...@apache.org>.
RocMarshal commented on code in PR #140:
URL: https://github.com/apache/flink-connector-jdbc/pull/140#discussion_r1792677288


##########
flink-connector-jdbc-core/src/main/java/org/apache/flink/connector/jdbc/core/util/VisibleForTest.java:
##########
@@ -0,0 +1,20 @@
+package org.apache.flink.connector.jdbc.core.util;
+
+import org.apache.flink.annotation.PublicEvolving;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+
+/**
+ * This annotations declares that a function, field, constructor, or entire type, is only visible
+ * for testing purposes.
+ *
+ * <p>This annotation is typically attached when for example a method should be {@code private}
+ * (because it is not intended to be called externally), but cannot be declared private, because
+ * some tests need to have access to it.
+ */
+@Documented
+@Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD, ElementType.CONSTRUCTOR})
+@PublicEvolving
+public @interface VisibleForTest {}

Review Comment:
   Maybe there’s no rush to modify anything before we reaching a conclusion.
   
   I'm not familiar with the entire testing framework and the use of annotations in Flink, so I couldn't make useful ideas.
   If we decide to change the relevant annotations and utility classes to `non-internal`, we should confirm what impact this will have on the main Flink repository. If the impact is minimal, maybe we can initiate a discussion.
   
   Hi, @MartijnVisser could you help give some ideas about it?
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org