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
Deduplicate tree building. #2059
Deduplicate tree building. #2059
Conversation
4999cdd
to
7f5b293
Compare
a65f256
to
b601e16
Compare
This pull request is not mergeable. Please rebase and repush. |
b601e16
to
8cc7351
Compare
ping @skateman: just rebased with your changes |
|
||
def try_build_tree(tree_symbol) | ||
method_name = "build_#{tree_symbol}_tree" | ||
return unless respond_to?(method_name, true) |
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.
I'm a little bit afraid that someone might try to remove the build_*_tree
methods as they might seem unused after a grepping. Maybe it's over-engineering, but I'd rather keep a list of these methods here and check against. What do you think?
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.
Well I prefer not. I'd like to unify it a bit further and then remove the build_*tree methods calling directly the tree builder.
There's no value and little information in the build_*tree methods
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.
Good enough for me 👍
@martinpovolny try to add a new catalog item, it will fail with:
I think you forgot to add the optional argument for some of these |
Going to add a spec for that and then fix it... Thx, @skateman ! |
416b048
to
9f9c89b
Compare
@martinpovolny it seems like the tree isn't reloading at all. I opened a catalog item and tried to remove using the toolbar menu, but the tree has not been reloaded and it still displays the removed node. |
5ab1f1f
to
bff0d2f
Compare
I am not going to fix the CC issue.
|
|
bff0d2f
to
991e878
Compare
@skateman : I have fixed the fist problem + added specs. |
@skateman : can you be more specific about the RBAC tree problem? I have created an user w/o any issues. What are you doing? Do you really mean the tree of users, groups and roles, when you say "RBAC tree"? |
@skateman: on RBAC tree: The tree is reloading on add/remove user. After excensive testing my working hypotesis is that the initial state of the tree is our of sync between client and server. The server thinks that Users are not expanded and Groups + Roles are. The client has Users and Groups expanded and Roles collapsed. So the update does not bring the newly created data to the client. Thus it seems the tree did not rebuild but it did. If you click around expand/collapse, things get in sync and everything works. So the problem you are seeing can be seen the first time you get there. Login and go directly to adding or removing an user. Seems unrelated. I'll retest on master. I have found more bugs in that area :-( |
The tree unsync issue is a heisenbug. Now I have everything just fine on master or my branch. Don't know what are the conditions for getting the tree out of sync. Might have to do with some reloading and restarting servers while switching branches. Cannot see how it could be related to my changes. I am only changing how the tree building is called and that works. |
991e878
to
7e9e929
Compare
Checked commits martinpovolny/manageiq-ui-classic@bb585ab~...7e9e929 with ruby 2.3.3, rubocop 0.47.1, and haml-lint 0.20.0 |
I just recreated the issue on master when adding a Role. Thus confirming it's not related to this PR. |
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.
deduplicate tree building, unifying some differences
next step should be removing all the
build_*_tree
methods and calling theTreeBuilder
subclass directly