You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "rkhachatryan (via GitHub)" <gi...@apache.org> on 2025/07/04 14:44:39 UTC

Re: [PR] [FLINK-37985][conf] Refactor public config options from StreamConfig to JobConfiguration [flink]

rkhachatryan commented on code in PR #26713:
URL: https://github.com/apache/flink/pull/26713#discussion_r2185523234


##########
flink-runtime/src/test/java/org/apache/flink/streaming/util/AbstractStreamOperatorTestHarness.java:
##########
@@ -290,7 +290,7 @@ private AbstractStreamOperatorTestHarness(
 
         Configuration underlyingConfig = env.getTaskConfiguration();
         this.config = new StreamConfig(underlyingConfig);
-        this.config.setCheckpointingEnabled(true);
+        // todo ? check the CI result if removing this.config.setCheckpointingEnabled(true);

Review Comment:
   Should this be removed now?:)



##########
flink-architecture-tests/flink-architecture-tests-production/src/main/java/org/apache/flink/architecture/rules/CheckpointingConfigurationAccessRules.java:
##########
@@ -0,0 +1,140 @@
+/*
+ * 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.architecture.rules;
+
+import com.tngtech.archunit.base.DescribedPredicate;
+import com.tngtech.archunit.core.domain.JavaFieldAccess;
+import com.tngtech.archunit.core.domain.JavaMethodCall;
+import com.tngtech.archunit.junit.ArchTest;
+import com.tngtech.archunit.lang.ArchRule;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.noClasses;
+
+/**
+ * Architecture rules to prevent direct access to certain checkpointing configuration options. These
+ * rules help ensure that helper methods with proper validation logic are used instead of direct
+ * Configuration.get() or getOptional() calls.
+ */
+public class CheckpointingConfigurationAccessRules {
+
+    private static final String CHECKPOINTING_OPTIONS_CLASS =
+            "org.apache.flink.configuration.CheckpointingOptions";
+
+    // Prohibited configuration fields that should not be used with Configuration.get() or
+    // Configuration.getOptional()
+    private static final Set<String> PROHIBITED_CONFIG_FIELDS =
+            new HashSet<>(
+                    Arrays.asList(
+                            "ENABLE_UNALIGNED",
+                            "CHECKPOINTING_CONSISTENCY_MODE",
+                            "ENABLE_UNALIGNED_INTERRUPTIBLE_TIMERS"));

Review Comment:
   It seems possible to use code constants here (and for class names), right?
   
   So that renaming doesn't make this test a no_op



-- 
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