-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Rest Apis to export/import with common code base #614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thanks @swakrish for the contribution! |
|
I added them |
|
Thank you for improvement! Reconciling the exisiting GUI import/export features to use this API may be a good idea too, otherwise we'll have different code doing the same job. What do you think? Buy the way, could you also please check that your code formated accodring to the project styleguide? |
|
@bzz thanks for your comments. I did look at the UI functions, it doesnt have an import I guess and export is more or less similar. Let me know your thoughts I also formatted it for google style. |
|
I think maybe import should be a POST? In REST, PUT should be modifying an existing object? |
|
@felixcheung Yes makes sense, I changed it to http POST. Please review and let me know your comments |
|
@felixcheung , @bzz Does it make sense to have a separate PR for making UI import use REST API? |
|
Right, it would make sense that both WebSocketAPI and REST API use the same function for Import. |
|
Just to clarify, the UI should not use the REST API, the WebsocketAPI and the REST API should rely on the same code to do the import on the backend |
|
@corneadoug thanks for the comments, Just to clarify, I would be touchig the notebook.java to create a import/export method which can then be leveraged by Notebookserver.java for UI right? Please correct me if im wrong |
|
@swakrish Right exactly, that method would be used in both Websocket and REST API case :) |
|
@corneadoug I moved the code to common notebook.java. Please review and let me know. Thanks |
|
Shouldn't the REST API send back an error response when something goes bad? |
|
@corneadoug I added a id not found for export too now, so it should return HTTP 500 too |
|
@corneadoug i donno why travis is failing. it looks like its failing on lots of PRs. Let me know if something else is missing for my commit too |
|
There are couple of interesting things in logs:
Each of them looks very strange to me, never seen any of them before and each worth further investigation. |
|
@bzz |
|
@swakrish I assume that you, as an author, should know better. Usually the mindset we try to share here is - CI must be green for anything to be merged. If it's not - then dedicated effort worth putting is - try to fix it i.e by collaborating with more experienced members, asking for help, etc. If you have some spare cycles you could spend them creating a separate issues, investigating these failures and pinging the people who touched particular code before - that would be very appreciated and of the great help to the project. Otherwise best bet is to wait until somebody takes care of this one day, so you can rebase on top of that work, but this might take some time. |
|
@bzz thanks for your comments, i just wanted to confirm since when i run test suite it doesnt break any of my changes :) I will take a look at those failures you mentioned to see why those are happening. Again those doesnt seem to happen in local builds |
|
Sorry for a delay. Will review this today. |
|
thanks @bzz |
|
@swakrish sorry, may be I did not make it clear last time, overall your code looks good, except for having 2 code paths for same function (for importing\exporting notebooks) in different APIs (WS\REST) in the same project does not look as a good idea to me.
I did, and both of them are called exactly once, in the This brings us back to the question asked before:
As far as I can tell such place does not exist, right now. This makes concerns, expressed by me and @corneadoug in this PR not addressed. Please let me know if I'm missing something here. If you have a plan on how to converge these API's code paths (yours and one from the Websocket) - why not to do it in this PR? I think that way it would be even greater contribution, reducing number of possible bugs, etc. What do you think? |
|
@bzz Yes i was thinking of opening a different PR for that since this address just REST calls. I have a tested code base for modifying web socket too } |
|
@bzz I merged the websocket import to use the common code.So now both REST/UI import uses same code. |
|
@bzz can you review this? |
|
@swakrish import code looks great. Just to double-check, I think it's good to ask original author of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sourceJSON -> sourceJson
|
Tested this PR, both newer and existing functionality works fine. |
|
@prabhjyotsingh , thanks for checking this so quickly and your comments. |
|
@prabhjyotsingh @bzz , please review |
|
@prabhjyotsingh @bzz is there any other change needed on this PR? |
|
@prabhjyotsingh thanks for prompt reply! Looks great to me, will merge if there is no more discussion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggest noteId + " not found" for extra space
|
@felixcheung pleasereview, i think travis is stuck :) |
|
looks good |
add keyboard shortcut for toggling run paragraph
|
@felixcheung thanks for reviewing, looks like travis finally passed |
|
@swakrish could you assign a JIRA issues to yourself please? Or let me know your JIRA id and I can do that for you. |


https://issues.apache.org/jira/browse/ZEPPELIN-590