Skip to content
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-1142] Zeppelin allows two users to simultaneously edit the notebook permissions #1393

Conversation

kavinkumarks
Copy link
Contributor

What is this PR for?

This is about storing the owner information on creating a note so when the same user tries to edit the permissions of the note he could do it successfully.

What type of PR is it?

Improvement

Todos

NA

What is the Jira issue?

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

How should this be tested?

Check the below cases via the web application or REST API calls and the owner information should be persisted properly.

  • Create note
  • Clone note
  • Import note

Screenshots (if appropriate)

Questions:

  • Does the licenses files need update? No
  • Is there breaking changes for older versions? No
  • Does this needs documentation? No

AuthenticationInfo subject = new AuthenticationInfo("user1");
Note note = notebook.createNote(subject);

Notebook notebook = new Notebook(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why creating new notebook instance here? can just reused previous one, isn't it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The notebook instance is different from note where the former holds the collection of the latter.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah that's true, but the question is why you instantiate notebook with new Notebook on line 218 if you already used different instance of it to create note on line 216. you can reuse same instance and just delete instantiation at line 218 , isn't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that was correct.Sorry for missing them out. I have made the changes and pushed them.

@khalidhuseynov
Copy link
Contributor

@kavinkumarks thanks for improvement and it makes sense indeed to assign owner when creating note. just need to address above minor comments as well as restart CI, some profiles are failing.

@kavinkumarks kavinkumarks force-pushed the zeppelin-1142-simultaneous-note-permission-error branch from d794a2a to 4412692 Compare September 6, 2016 07:34
@kavinkumarks
Copy link
Contributor Author

@khalidhuseynov thanks for the review! I have replied to the comments and the CI build is in progress.

@kavinkumarks
Copy link
Contributor Author

Reopening to trigger the CI build.

@kavinkumarks kavinkumarks reopened this Sep 6, 2016
@kavinkumarks
Copy link
Contributor Author

Found an build test failure, working on it.

@kavinkumarks kavinkumarks force-pushed the zeppelin-1142-simultaneous-note-permission-error branch from 85af4e6 to 5a45c9e Compare September 7, 2016 07:19
@kavinkumarks
Copy link
Contributor Author

Fixed the build test failure and the CI build is in progress.

@kavinkumarks
Copy link
Contributor Author

The CI build is green.

@khalidhuseynov
Copy link
Contributor

LGTM

@kavinkumarks
Copy link
Contributor Author

Thanks @khalidhuseynov ! Can we get this merged?

-Kavin
MailTo: kavin.kumar@imaginea.com

@khalidhuseynov
Copy link
Contributor

@kavinkumarks i believe some of the committers or pmcs will take a look into this pr before merging

@kavinkumarks
Copy link
Contributor Author

Could someone else have a look at this and merge if everything is okay?

Thanks,
Kavin
MailTo: kavin.kumar@imaginea.com

@Leemoonsoo
Copy link
Member

Thanks @kavinkumarks for the contribution.
This changes not only resolving race condition described in ZEPPELIN-1142 but also changes user experience. i.e.

Before, owner is not defined when creating note.
After, owner is set to current user when creating note. (when authentication is enabled)

Especially with code changes such as #1330, user will experience bigger behavior changes.

But i think having current user as a owner when creating note is natural behavior that most people can think, even though it brings some UX changes.

LGTM and merge if there're no further discussions.

@kavinkumarks
Copy link
Contributor Author

Thanks @Leemoonsoo for reviewing this! Could you please merge this?

@asfgit asfgit closed this in 294eef1 Sep 15, 2016
pedrozatta pushed a commit to pedrozatta/zeppelin that referenced this pull request Oct 27, 2016
…notebook permissions

### What is this PR for?
This is about storing the owner information on creating a note so when the same user tries to edit the permissions of the note he could do it successfully.

### What type of PR is it?
Improvement

### Todos
NA

### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-1142

### How should this be tested?
Check the below cases via the web application or REST API calls and the owner information should be persisted properly.
* Create note
* Clone note
* Import note

### Screenshots (if appropriate)

### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No

Author: Kavin <kavin.kumar@imaginea.com>

Closes apache#1393 from kavinkumarks/zeppelin-1142-simultaneous-note-permission-error and squashes the following commits:

5a45c9e [Kavin] Ensure that the authentication instance is created only when the input prinicipal is not null.
7642f63 [Kavin] Removed the duplicate instance of notebook variable and reused the existing one.
e1b8b08 [Kavin] Store owner information on creating a note and added integration test cases for the relevant scenarios.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants