-
Notifications
You must be signed in to change notification settings - Fork 11
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
improvement(ViewDashboard): Per-widget item filtering #574
base: master
Are you sure you want to change the base?
Conversation
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.
few comments
frontend/Views/ViewDashboard.svelte
Outdated
}; | ||
|
||
const filterViewForWidget = async function (widget) { | ||
if (!widget.settings.filter) { |
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.
isn't in js that anempty array (filter=[]
) evaluates to true
(not like in the python)?
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.
Fixed
const test = tests[item.id] ?? {}; | ||
return ["id", "release_id", "group_id"].some((key) => widget.settings.filter.includes(test[key])); | ||
}); | ||
return viewCopy; |
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 way we return view object in case of no filters and view copy in case of filters present.
Maybe we should align it to not cause future issues?
Or even to add new filteredTests
attribute which would be used in widgets?
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.
Yes, I was deliberating whether or not always return a copy, so I think for safety we should always return a copy here. Fixed
This commit implements per-widget entitity filtering for views, allowing users to select which tests/groups/releases they want shown on the widget in a specific view. To facilitate this, stat fetching has been modified to accept widget id (position) of a view and then filter tests accordingly. On the frontend side to facilitate conflict-free stat fetching (for example from two TestDashboards) a hashmap has been introduced to handle multiple stat objects and to dispatch them correctly to each widget. Caveats: * Release Planner views in general are not supported and contain several unwanted interactions: * If test dashboard is modified to filter anything, release planner stat bar will be gray (since there's no more anchor for it to get the stats from) * Anything version related will conflict * TestDashboard has a setting for a specific ScyllaVersion filter preset - this is not compatible and will make that filter set only output that version, which might be undesirable. * Aside from TestDashboard, currently no other widgets implement stat fetch, so filtering for them might not be interesting. However the widget will now receive filtered set of tests, which should make the performance summaries automatically support this feature. Fixes scylladb#393
73d1b64
to
e51d93c
Compare
I tested it locally with summary widget - it does not filter tests there (but at least does not break anything) |
This commit implements per-widget entitity filtering for views,
allowing users to select which tests/groups/releases they want shown on
the widget in a specific view. To facilitate this, stat fetching has
been modified to accept widget id (position) of a view and then filter
tests accordingly. On the frontend side to facilitate conflict-free stat
fetching (for example from two TestDashboards) a hashmap has been
introduced to handle multiple stat objects and to dispatch them
correctly to each widget.
Caveats:
several unwanted interactions:
planner stat bar will be gray (since there's no more anchor
for it to get the stats from)
preset - this is not compatible and will make that filter set only
output that version, which might be undesirable.
stat fetch, so filtering for them might not be interesting.
However the widget will now receive filtered set of tests, which
should make the performance summaries automatically support this
feature.
Fixes #393