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

improvement(ViewDashboard): Per-widget item filtering #574

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

k0machi
Copy link
Collaborator

@k0machi k0machi commented Jan 20, 2025

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 #393

@k0machi k0machi self-assigned this Jan 20, 2025
@k0machi k0machi requested review from fruch and soyacz January 20, 2025 09:06
@k0machi
Copy link
Collaborator Author

k0machi commented Jan 20, 2025

UI demo:

image

@k0machi k0machi requested a review from roydahan January 20, 2025 15:01
Copy link
Collaborator

@soyacz soyacz left a comment

Choose a reason for hiding this comment

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

few comments

};

const filterViewForWidget = async function (widget) {
if (!widget.settings.filter) {
Copy link
Collaborator

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)?

Copy link
Collaborator Author

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;
Copy link
Collaborator

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?

Copy link
Collaborator Author

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
@k0machi k0machi force-pushed the views-per-widget-filtering branch from 73d1b64 to e51d93c Compare January 23, 2025 12:02
@soyacz
Copy link
Collaborator

soyacz commented Jan 24, 2025

I tested it locally with summary widget - it does not filter tests there (but at least does not break anything)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Views - Per Widget job filter
2 participants