You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by "fuweng11 (via GitHub)" <gi...@apache.org> on 2023/04/21 08:35:13 UTC

[GitHub] [inlong] fuweng11 opened a new pull request, #7891: [INLONG-7890][Manager] Add checks for unmodifiable data_node_name and cluster_name

fuweng11 opened a new pull request, #7891:
URL: https://github.com/apache/inlong/pull/7891

   
   
   ### Prepare a Pull Request
   
   - Fixes #7890 
   
   ### Motivation
   
   Sometimes user need to modify `data_node_name` based on specific data_node information.
   However, `data_node_name` as a foreign key cannot be modified. 
   Therefore, we need to add a field that reflects data_node information.
   
   ### Modifications
   
   1.Add checks for unmodifiable data_node_name and cluster_name
   2.Add the data_node_display_name field to display node information.
   3.Add the cluster_display_name field to display cluster information.
   
   


-- 
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: commits-unsubscribe@inlong.apache.org

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


[GitHub] [inlong] vernedeng commented on a diff in pull request #7891: [INLONG-7890][Manager] Add checks for unmodifiable data_node_name and cluster_name

Posted by "vernedeng (via GitHub)" <gi...@apache.org>.
vernedeng commented on code in PR #7891:
URL: https://github.com/apache/inlong/pull/7891#discussion_r1174900261


##########
inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/node/DataNodeRequest.java:
##########
@@ -48,11 +48,11 @@ public abstract class DataNodeRequest {
     private Integer id;
 
     @ApiModelProperty(value = "Data node name")
-    @NotBlank(groups = {SaveValidation.class, UpdateByKeyValidation.class}, message = "node name cannot be blank")
-    @Length(min = 1, max = 128, message = "length must be between 1 and 128")
-    @Pattern(regexp = "^[A-Za-z0-9_-]{1,128}$", message = "only supports letters, numbers, '-', or '_'")

Review Comment:
   why delete these limitation of **_name_**



-- 
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: commits-unsubscribe@inlong.apache.org

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


[GitHub] [inlong] fuweng11 commented on a diff in pull request #7891: [INLONG-7890][Manager] Add checks for unmodifiable data_node_name and cluster_name

Posted by "fuweng11 (via GitHub)" <gi...@apache.org>.
fuweng11 commented on code in PR #7891:
URL: https://github.com/apache/inlong/pull/7891#discussion_r1173613492


##########
inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/entity/InlongClusterEntity.java:
##########
@@ -32,6 +32,7 @@ public class InlongClusterEntity implements Serializable {
 
     private Integer id;
     private String name;
+    private String clusterDisplayName;

Review Comment:
   done



##########
inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/entity/DataNodeEntity.java:
##########
@@ -31,6 +31,7 @@ public class DataNodeEntity implements Serializable {
     private static final long serialVersionUID = 1L;
     private Integer id;
     private String name;
+    private String dataNodeDisplayName;

Review Comment:
   done



-- 
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: commits-unsubscribe@inlong.apache.org

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


[GitHub] [inlong] dockerzhang merged pull request #7891: [INLONG-7890][Manager] Add checks for unmodifiable data_node_name and cluster_name

Posted by "dockerzhang (via GitHub)" <gi...@apache.org>.
dockerzhang merged PR #7891:
URL: https://github.com/apache/inlong/pull/7891


-- 
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: commits-unsubscribe@inlong.apache.org

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


[GitHub] [inlong] fuweng11 commented on a diff in pull request #7891: [INLONG-7890][Manager] Add checks for unmodifiable data_node_name and cluster_name

Posted by "fuweng11 (via GitHub)" <gi...@apache.org>.
fuweng11 commented on code in PR #7891:
URL: https://github.com/apache/inlong/pull/7891#discussion_r1174903186


##########
inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/node/DataNodeRequest.java:
##########
@@ -48,11 +48,11 @@ public abstract class DataNodeRequest {
     private Integer id;
 
     @ApiModelProperty(value = "Data node name")
-    @NotBlank(groups = {SaveValidation.class, UpdateByKeyValidation.class}, message = "node name cannot be blank")
-    @Length(min = 1, max = 128, message = "length must be between 1 and 128")
-    @Pattern(regexp = "^[A-Za-z0-9_-]{1,128}$", message = "only supports letters, numbers, '-', or '_'")

Review Comment:
   Because name should not need to be filled in by the user, the background automatically generated.



-- 
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: commits-unsubscribe@inlong.apache.org

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


[GitHub] [inlong] vernedeng commented on a diff in pull request #7891: [INLONG-7890][Manager] Add checks for unmodifiable data_node_name and cluster_name

Posted by "vernedeng (via GitHub)" <gi...@apache.org>.
vernedeng commented on code in PR #7891:
URL: https://github.com/apache/inlong/pull/7891#discussion_r1174910956


##########
inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/node/DataNodeRequest.java:
##########
@@ -48,11 +48,11 @@ public abstract class DataNodeRequest {
     private Integer id;
 
     @ApiModelProperty(value = "Data node name")
-    @NotBlank(groups = {SaveValidation.class, UpdateByKeyValidation.class}, message = "node name cannot be blank")
-    @Length(min = 1, max = 128, message = "length must be between 1 and 128")
-    @Pattern(regexp = "^[A-Za-z0-9_-]{1,128}$", message = "only supports letters, numbers, '-', or '_'")

Review Comment:
   Keep **Pattern** at least, the name can be assgined.



-- 
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: commits-unsubscribe@inlong.apache.org

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


[GitHub] [inlong] healchow commented on a diff in pull request #7891: [INLONG-7890][Manager] Add checks for unmodifiable data_node_name and cluster_name

Posted by "healchow (via GitHub)" <gi...@apache.org>.
healchow commented on code in PR #7891:
URL: https://github.com/apache/inlong/pull/7891#discussion_r1175027272


##########
inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/cluster/ClusterRequest.java:
##########
@@ -48,11 +48,12 @@ public abstract class ClusterRequest {
     private Integer id;
 
     @ApiModelProperty(value = "Cluster name")
-    @NotBlank(groups = {SaveValidation.class, UpdateByKeyValidation.class}, message = "cluster name cannot be blank")
-    @Length(min = 1, max = 128, message = "length must be between 1 and 128")
-    @Pattern(regexp = "^[a-z0-9_.-]{1,128}$", message = "only supports lowercase letters, numbers, '.', '-', or '_'")
+    @Pattern(regexp = "^[A-Za-z0-9_-]{1,128}$", message = "only supports letters, numbers, '-', or '_'")
     private String name;
 
+    @ApiModelProperty(value = "Cluster display name, just for display")
+    private String displayName;

Review Comment:
   Please add limit pattern here to avoid user input too long or other irregular characters.



-- 
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: commits-unsubscribe@inlong.apache.org

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


[GitHub] [inlong] vernedeng commented on a diff in pull request #7891: [INLONG-7890][Manager] Add checks for unmodifiable data_node_name and cluster_name

Posted by "vernedeng (via GitHub)" <gi...@apache.org>.
vernedeng commented on code in PR #7891:
URL: https://github.com/apache/inlong/pull/7891#discussion_r1173583609


##########
inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/entity/InlongClusterEntity.java:
##########
@@ -32,6 +32,7 @@ public class InlongClusterEntity implements Serializable {
 
     private Integer id;
     private String name;
+    private String clusterDisplayName;

Review Comment:
   ditto



##########
inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/entity/DataNodeEntity.java:
##########
@@ -31,6 +31,7 @@ public class DataNodeEntity implements Serializable {
     private static final long serialVersionUID = 1L;
     private Integer id;
     private String name;
+    private String dataNodeDisplayName;

Review Comment:
   No need to name dataNodeDisplayName, just call it **dispalyName**



-- 
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: commits-unsubscribe@inlong.apache.org

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


[GitHub] [inlong] fuweng11 commented on a diff in pull request #7891: [INLONG-7890][Manager] Add checks for unmodifiable data_node_name and cluster_name

Posted by "fuweng11 (via GitHub)" <gi...@apache.org>.
fuweng11 commented on code in PR #7891:
URL: https://github.com/apache/inlong/pull/7891#discussion_r1174912090


##########
inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/node/DataNodeRequest.java:
##########
@@ -48,11 +48,11 @@ public abstract class DataNodeRequest {
     private Integer id;
 
     @ApiModelProperty(value = "Data node name")
-    @NotBlank(groups = {SaveValidation.class, UpdateByKeyValidation.class}, message = "node name cannot be blank")
-    @Length(min = 1, max = 128, message = "length must be between 1 and 128")
-    @Pattern(regexp = "^[A-Za-z0-9_-]{1,128}$", message = "only supports letters, numbers, '-', or '_'")

Review Comment:
   Fix.



-- 
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: commits-unsubscribe@inlong.apache.org

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


[GitHub] [inlong] fuweng11 commented on a diff in pull request #7891: [INLONG-7890][Manager] Add checks for unmodifiable data_node_name and cluster_name

Posted by "fuweng11 (via GitHub)" <gi...@apache.org>.
fuweng11 commented on code in PR #7891:
URL: https://github.com/apache/inlong/pull/7891#discussion_r1175033106


##########
inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/cluster/ClusterRequest.java:
##########
@@ -48,11 +48,12 @@ public abstract class ClusterRequest {
     private Integer id;
 
     @ApiModelProperty(value = "Cluster name")
-    @NotBlank(groups = {SaveValidation.class, UpdateByKeyValidation.class}, message = "cluster name cannot be blank")
-    @Length(min = 1, max = 128, message = "length must be between 1 and 128")
-    @Pattern(regexp = "^[a-z0-9_.-]{1,128}$", message = "only supports lowercase letters, numbers, '.', '-', or '_'")
+    @Pattern(regexp = "^[A-Za-z0-9_-]{1,128}$", message = "only supports letters, numbers, '-', or '_'")
     private String name;
 
+    @ApiModelProperty(value = "Cluster display name, just for display")
+    private String displayName;

Review Comment:
   done



-- 
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: commits-unsubscribe@inlong.apache.org

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