-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[ZEPPELIN-1257] storage - fix get note revision api #1254
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-1257] storage - fix get note revision api #1254
Conversation
|
/cc @corneadoug @bzz for review |
|
@khalidhuseynov The CI is fully red |
|
@khalidhuseynov care to elaborate on CI failure reason? (preferably, before the review) Also, could you please explain why do you think this API change is valuable and what benefits does it bring for a user? (i.e does it consider other possible versioned storage i.e IPFS, BitTorrent and other future ones, where just an ID might not be enough? or it might be not String) Right now I'm under impression that narrowing public API of NotebokRepo to String vs generic Revision interface that any client is free to implement is not something very usefull or generic enough. I would prefer no making such changes to the public API for merele the sake of change, without a strong reason (which might very well exist but may be I'm missing here). |
|
@bzz CI failure was due to test, fixed now. Further, regarding the flexibility and narrowing scope. Revision class is implemented here and as you can see currently when implementing your own NotebookRepo you reuse same class (without implementing your own one). Implementing your own revision class is a good idea which is not supported yet (it should be handled properly in frontend as well). The point of this PR was not to send unnecessary info in the Revision object since only thing to identify the revision is supposed to be its revisionId and it being String seems at least intuitive since noteId, and paragraphId are identified in the same way by String id. So having noteId, revisionId should uniquely identify the revision. Can you give some example of ID that's more than one element and not presented as string? |
|
@khalidhuseynov glad to hear. But CI is red again, could you please post here the reason of failure? This will save time for the reviewers. And thank you for kind for the explanation!
This is exactly what I meant by "changes for the sake of changes". Revision class implementation that you point out looks good to me - it represents clearly defined interface with it's own responsibilities. But String does the contrary. May be this class is even big enough to deserve his own file. And other clients may choose to replace it with their own implementations. I would understand if you suggest to extract it to the interface - this will bring even more flexibility (but increase verbosity). But replacing it with the After some thinking - may be I lack verbal skills to convey the message about obejct-oriented design approach. If that is the case, please check |
|
@bzz regarding the CI issue, I keep getting the following: filed an issue here Regarding this pr, I'll consider your comments on using OO way here and open new pr with a fix. Also separating Revision is a valid point and might be addressed there. |
|
@khalidhuseynov thank you! |
|
@bzz i believe we decided not to merge it for now. I'll revise it and let you know |
|
Got it! Thank you for clarification. |
|
@khalidhuseynov |
f14c15a to
6ead891
Compare
|
@bzz rebased and addressed comments |
|
ping |
|
Thank you for friendly ping. Will review and get back to you ASAP |
| } | ||
|
|
||
| public Note getNoteRevision(String noteId, Revision revision, AuthenticationInfo subject) | ||
| public Note getNoteRevision(String noteId, String revisionId, AuthenticationInfo subject) |
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.
Do you think we it's better to keep this and to change to getNoteByRevision ?
|
@khalidhuseynov CI is green and changes looks great to me, modulo one naming case noted above. Please let me know if you want to address that one as well. After that I will be happy to mered it to master, if there is no further discussion |
|
Great! Merging to master, if there is no further discussion. |
|
@bzz can you merge it asap? i need this change if i want to continue my work |
What is this PR for?
Getting revision of note requires only unique revision id and the whole revision object isn't required. This PR is to fix the issue.
What type of PR is it?
Bug Fix | Improvement
Todos
What is the Jira issue?
ZEPPELIN-1257
How should this be tested?
Storage layer tests should pass, green CI
Screenshots (if appropriate)
Questions: