-
Notifications
You must be signed in to change notification settings - Fork 712
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
Apply filters from current view to details panel #1904
Conversation
Before: Where the app curler and system curler were launched respectively as:
|
wow, that turned out to be much easier than I expected. |
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.
Nice! Works really well on container topo.
There's a small issue w/ cross-topo stuff as the options get mixed up: (e.g. when on the processes topo clicking the relatives to load up the weavescope container in the details panel).
/api/topology/containers/ 404
/api/topology/containers/?&unconnected=hide 404 (processes topo options)
/api/topology/containers/?&system=system&stopped=running&pseudo=hide 200
We could change the UI a bit more to send the correct topo options for the node type but maybe we wanna use the topo options to filter the contents of the requested node rather than the node itself?
Sent topo options now correspond to node type being requested. BE filtering is still a bit tight: if containers.topoOptions = 'application', you are unable to view 'weavescope' in the details panel. |
This is a change of behavior since no filtering was applied before, but I see it as correct and reasonable. |
By clicking through details panels you can get to the host and then to the scope container (e.g. app-curler > host > weavescope ), which will return 404 since system containers are not viewable through the filters. This one's tricky. I see two options:
|
Ah, so that is why this PR has so little code! I do rather think we need that. |
btw, that does not (necessarily) mean that this PR cannot be merged w/o that. I haven't got the time to play with this to form an opinion. Please consult others in the team. |
I wouldn't merge this PR as is. To get this in now we could
|
I've fixed this by never filtering out the target node if it exists.
On top of my change, we could do this when getting information about topologies other than the one in view (i.e. instead of basing it on the stacking depth). It requires a minimal modification in the backend and it avoids applying filters unrelated to the current view (which is confusing). Sounds good? |
@@ -10,6 +10,30 @@ import ( | |||
"github.com/weaveworks/scope/report" | |||
) | |||
|
|||
// PreciousNodeRenderer ensures a node is never filtered out by decorators |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This reverts commit 699fe45.
This should be ready to go. @paulbellamy / @foot please take a final look. |
@fons please summarise what the behaviour is. |
The filters in the topology in view are applied to the details shown for any node in that topology. However, the filter is not applied to the existente of the node itself to ensure no broken links are found between topologies or if the state of the node changes (I.e. a container from running to stopped). No filters are applied to the details of nodes out of the topology in view (that would make filters from other topologies global, which would be confusing for the end user). Note that pseudo nodes are attributed to the topology in view. |
From testing, this statement doesn't seem true. |
Can you provide specific evidence? |
Code LGTM and seems to work okay for internet node + other topos. |
Expected behaviour: No containers are shown in the details panel children table. |
That's an edge case, in which the filter change (your step 4) makes the node disappear from view. Admittedly it should behave like you state but I don't see a simple way to solve this with the current rendering code. |
Discussed offline with @paulbellamy and he didn't find any other problems except the corner case commented above, merging. |
Fixes #1864