You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zeppelin.apache.org by GitBox <gi...@apache.org> on 2021/10/02 05:55:31 UTC

[GitHub] [zeppelin] zjffdu opened a new pull request #4240: [ZEPPELIN-5547] Rename note doesn't change the name field in file json

zjffdu opened a new pull request #4240:
URL: https://github.com/apache/zeppelin/pull/4240


   ### What is this PR for?
   
   This PR would update note file if the file name is changed. Otherwise the `name` field in note json would be inconsistent with note file name. They would become consistent when user do save note operation afterwards. 
   
   ### What type of PR is it?
   [Bug Fix ]
   
   ### Todos
   * [ ] - Task
   
   ### What is the Jira issue?
   * https://issues.apache.org/jira/browse/ZEPPELIN-5547
   
   ### How should this be tested?
   * CI pass
   
   ### Screenshots (if appropriate)
   
   ### Questions:
   * Does the licenses files need update? No
   * Is there breaking changes for older versions? No
   * Does this needs documentation? No
   


-- 
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: dev-unsubscribe@zeppelin.apache.org

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



[GitHub] [zeppelin] asfgit closed pull request #4240: [ZEPPELIN-5547] Rename note doesn't change the name field in file json

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #4240:
URL: https://github.com/apache/zeppelin/pull/4240


   


-- 
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: dev-unsubscribe@zeppelin.apache.org

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



[GitHub] [zeppelin] zjffdu commented on a change in pull request #4240: [ZEPPELIN-5547] Rename note doesn't change the name field in file json

Posted by GitBox <gi...@apache.org>.
zjffdu commented on a change in pull request #4240:
URL: https://github.com/apache/zeppelin/pull/4240#discussion_r721321093



##########
File path: zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/NoteManager.java
##########
@@ -246,6 +246,13 @@ public void moveNote(String noteId,
 
     // update notebookrepo
     this.notebookRepo.move(noteId, notePath, newNotePath, subject);
+
+    // save note if note name is changed, because we need to update the note field in note json.
+    String oldNoteName = getNoteName(notePath);
+    String newNoteName = getNoteName(newNotePath);
+    if (!oldNoteName.equalsIgnoreCase(newNoteName)) {

Review comment:
       Good point, Fixed

##########
File path: zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/NotebookTest.java
##########
@@ -78,7 +80,7 @@
 
   private Notebook notebook;
   private NoteManager noteManager;
-  private NotebookRepo notebookRepo;
+  private VFSNotebookRepo notebookRepo;

Review comment:
       Fixed




-- 
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: dev-unsubscribe@zeppelin.apache.org

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



[GitHub] [zeppelin] zjffdu commented on pull request #4240: [ZEPPELIN-5547] Rename note doesn't change the name field in file json

Posted by GitBox <gi...@apache.org>.
zjffdu commented on pull request #4240:
URL: https://github.com/apache/zeppelin/pull/4240#issuecomment-934017566


   Will merge if no more comment


-- 
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: dev-unsubscribe@zeppelin.apache.org

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



[GitHub] [zeppelin] Reamer commented on a change in pull request #4240: [ZEPPELIN-5547] Rename note doesn't change the name field in file json

Posted by GitBox <gi...@apache.org>.
Reamer commented on a change in pull request #4240:
URL: https://github.com/apache/zeppelin/pull/4240#discussion_r721279604



##########
File path: zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/NotebookTest.java
##########
@@ -78,7 +80,7 @@
 
   private Notebook notebook;
   private NoteManager noteManager;
-  private NotebookRepo notebookRepo;
+  private VFSNotebookRepo notebookRepo;

Review comment:
       Why is this necessary? I think we should work with the interface.

##########
File path: zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/NoteManager.java
##########
@@ -246,6 +246,13 @@ public void moveNote(String noteId,
 
     // update notebookrepo
     this.notebookRepo.move(noteId, notePath, newNotePath, subject);
+
+    // save note if note name is changed, because we need to update the note field in note json.
+    String oldNoteName = getNoteName(notePath);
+    String newNoteName = getNoteName(newNotePath);
+    if (!oldNoteName.equalsIgnoreCase(newNoteName)) {

Review comment:
       I think it would be good to use StringUtils.equalsIgnoreCase(..) to be null safe.




-- 
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: dev-unsubscribe@zeppelin.apache.org

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