-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[ZEPPELIN-1190] [WIP] Visit Notebook Revision #1304
Conversation
@corneadoug thanks for taking care of this! #1308 is merged and instead of |
@khalidhuseynov that doesn't solve anything, I can't work with Revision, it needs to be RevisionId. All you have is the revisitionId and not the other informations, which means I can't make a call to get the Notebook content unless I get the list of Revisions first. |
@corneadoug thanks for clarification. in this case, how do you think it would look like if I believe @bzz had this point in the comments here
and here
So let's nail down this question here, and maybe together in the same thread, we can come up with much better solution :) |
Great point @khalidhuseynov ! Let's do exactly as you say, as this may be a good overriding argument in our previous design discussions that you mention. To avoid the confusion, could you guys please quickly bring me up to speed with, what As far as I understood, we are talking in this PR about adding a new page on the frontend under URL |
The front-end needs to be able to get the Notebook's revision and show it. To do that, there is a websocket event that originally looked like that: After using it, it seemed that this websocket event was not well defined on front-end side and that instead of Which look like that:
Now, unless there is a whole object to save, there should not be any reason for the front-end to send a full object to the back-end so that it can understand which revision I want. That's precisely what revisionId should be for, especially if I want to have a custom URL that allows loading that revision. Furthermore, in order for me to send a full revision description object, it would mean that I need to get the list of Revisions before I'm able to make any call to load the Notebook revision. |
@khalidhuseynov are we really sure about sending IMO it is not a good idea, if you ask for a resource, you need to call it by his Unique Identifier (A unique identifier (ID) is a numeric or alphanumeric string that is associated with a single entity within a given system. IDs make it possible to address that entity, so that it can be accessed and interacted with). I never saw in my hole life a complex object as ID, but i can be wrong (i dont use hipster api) but to me it looks like it is not the way to go. I would rather have a simple String/Int as a ID than a weird object, like we have for notebook, you call it with is Id eg: |
@corneadoug thank you for explaining! So we are talking about WS API to fetch full notebook state from the history by it's revision? Wich on client-side looks like websocketMsgSrv.getNoteRevision($routeParams.noteId, $routeParams.revisionId); And on the back-end is a NOTE_REVISION event in @khalidhuseynov I think first of all, there is a bit of confusion here: this event is handled by Then, it makes perfect sense to change the Notebook.getNoteRevision() API, both, function name AND a signature, as that is the place where actual work of retrieving the Note is done, to something like: getNoteByRevisionId(String noteId, String revisionId, AuthenticationInfo subject) And this necessity, that comes from API client, at least for me, is an overriding argument in our discussion: you were right and we should adjust NotebookRepo.get interface and follow your design from #1254 (and close #1277). What do you think? |
@bzz exactly, that's the point i was trying to make in #1254. |
@corneadoug please let us know if there still are any troubles, after #1254 got merged! |
8512381
to
e5f28e9
Compare
any ETA on this one, so that can plan accordingly? |
8d5deee
to
340f0f1
Compare
@khalidhuseynov However there is some errors on Zeppelin server: To reproduce, you can visit a revision form the dropdown. Then try running a paragraph (for example), this happen for all the Notebook websocket event (Run, Save etc...) The backend seems to be using a NotebookSocket param that isn't initiated in our case (which is good). However since the function are not checking the parameter, it generates a NPE |
@corneadoug thanks for letting me know, i'll look into that and get back to you. |
@@ -685,6 +678,19 @@ angular.module('zeppelinWebApp').controller('NotebookCtrl', function($scope, $ro | |||
} | |||
}; | |||
|
|||
$scope.visitRevision = function(revision) { | |||
if (revision.id) { | |||
if (revision.id === "Head") { |
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.
could you change it here to single quotes,jscs
complaining
console.log('We got the revisions %o', data); | ||
$scope.noteRevisions = data.revisionList; | ||
$scope.noteRevisions.splice(0, 0, { | ||
id: "Head", |
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.
this and below line as well
@corneadoug I've just tried the scenario you have, and it was running correctly (without np) when you switch to different revisions. the only thing is that it was running the |
2e9e4a3
to
34c8a64
Compare
this have been stale for quite a while, so I'll start looking into it |
I think this can be closed |
close #83 close #86 close #125 close #133 close #139 close #146 close #193 close #203 close #246 close #262 close #264 close #273 close #291 close #299 close #320 close #347 close #389 close #413 close #423 close #543 close #560 close #658 close #670 close #728 close #765 close #777 close #782 close #783 close #812 close #822 close #841 close #843 close #878 close #884 close #918 close #989 close #1076 close #1135 close #1187 close #1231 close #1304 close #1316 close #1361 close #1385 close #1390 close #1414 close #1422 close #1425 close #1447 close #1458 close #1466 close #1485 close #1492 close #1495 close #1497 close #1536 close #1545 close #1561 close #1577 close #1600 close #1603 close #1678 close #1695 close #1739 close #1748 close #1765 close #1767 close #1776 close #1783 close #1799
What is this PR for?
A few sentences describing the overall goals of the pull request's commits.
First time? Check out the contributing guide - https://github.com/apache/zeppelin/blob/master/CONTRIBUTING.md
What type of PR is it?
To visit the Notebook Revision after selecting it from the dropdown
Todos
What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-1190
How should this be tested?
You need to add this config in
conf/zeppelin-env.sh
export ZEPPELIN_NOTEBOOK_STORAGE="org.apache.zeppelin.notebook.repo.GitNotebookRepo"
Questions: