Skip to content

Conversation

@KishoreKicha14
Copy link
Contributor

@KishoreKicha14 KishoreKicha14 commented Nov 10, 2025

Description

This PR introduces WLM Group visibility in the Top Queries UI. A new “WLM Group” column is added to the table, along with full support for filtering and sorting. The implementation is backwards-compatible with existing Top Queries records that do not contain a WLM group field.

CASE 1: when WLM is available:

Screenshot 2025-11-24 at 5 33 37 PM Screenshot 2025-11-24 at 5 33 53 PM

Navigation from wlm group to TopNQueries

Screenshot 2025-11-24 at 5 33 58 PM Screenshot 2025-11-24 at 5 34 07 PM

After Movie workload group is deleted it show "-" and as a text

Screenshot 2025-11-24 at 5 34 43 PM

CASE 2: when WLM is not available:

It will not show link to navigate to WLM detail page

Issues Resolved

Closes [#153]

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Kishore Kumaar Natarajan <[email protected]>
Kishore Kumaar Natarajan added 12 commits November 13, 2025 13:26
Signed-off-by: Kishore Kumaar Natarajan <[email protected]>
Signed-off-by: Kishore Kumaar Natarajan <[email protected]>
Signed-off-by: Kishore Kumaar Natarajan <[email protected]>
Signed-off-by: Kishore Kumaar Natarajan <[email protected]>
Signed-off-by: Kishore Kumaar Natarajan <[email protected]>
Signed-off-by: Kishore Kumaar Natarajan <[email protected]>
Signed-off-by: Kishore Kumaar Natarajan <[email protected]>
Signed-off-by: Kishore Kumaar Natarajan <[email protected]>
Signed-off-by: Kishore Kumaar Natarajan <[email protected]>
Signed-off-by: Kishore Kumaar Natarajan <[email protected]>
Signed-off-by: Kishore Kumaar Natarajan <[email protected]>
Signed-off-by: Kishore Kumaar Natarajan <[email protected]>
@KishoreKicha14 KishoreKicha14 changed the title TopNQueries - WLM Intergation [Feature] TopNQueries - WLM Intergation Nov 25, 2025
Copy link
Member

@ansjcy ansjcy left a comment

Choose a reason for hiding this comment

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

Overall looks good, I found some small bugs and also have concerns on backward compatibilties.
After resolving the comments, could you also make sure validate and attach screenshots on MDS support? Especially using this dashboards in 3.4 and connect to 2.19, 3.1, 3.3 data sources.

types/types.ts Outdated
task_resource_usages: Task[];
id: string;
group_by: string;
wlm_group_id: string;
Copy link
Member

Choose a reason for hiding this comment

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

could this be null or undefined? if WLM is disabled, or especially when we query on old top queries indices that do not have this field defined yet

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Update code to handle null or undefined

useEffect(() => {
const checkWlmSupport = async () => {
try {
const { getVersionOnce, isVersion33OrHigher } = await import('../../utils/version-utils');
Copy link
Member

Choose a reason for hiding this comment

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

why do we need to do dynamic import here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

now we have static import

const res = await core.http.get(API_ENDPOINTS.WLM_WORKLOAD_GROUP, { query: httpQuery });
return res && typeof res === 'object' && Array.isArray(res.workload_groups);
} catch (e) {
return false;
Copy link
Member

Choose a reason for hiding this comment

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

are there any specific errors we care about? Currently we silently swallows all errors without logging

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated to log the errors

name: WLM_GROUP,
render: (wlmGroupId: string, q: SearchQueryRecord) => {
if (q.group_by === 'SIMILARITY') return '-';
const groupId = wlmGroupId || 'DEFAULT_WORKLOAD_GROUP';
Copy link
Member

Choose a reason for hiding this comment

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

Consider using a constant for DEFAULT_WORKLOAD_GROUP since you are using it multiple times in this PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

add constant to constant.ts

field: WLM_GROUP_FIELD as keyof SearchQueryRecord,
name: WLM_GROUP,
render: (wlmGroupId: string, q: SearchQueryRecord) => {
if (q.group_by === 'SIMILARITY') return '-';
Copy link
Member

Choose a reason for hiding this comment

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

do we want to also wrap this in <span></span> instead of raw string?


// Get wlmGroupId from URL parameters
const urlParams = new URLSearchParams(location.search);
const wlmGroupIdFromUrl = urlParams.get('wlmGroupId');
Copy link
Member

Choose a reason for hiding this comment

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

Let's add some unit tests for this logic too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated unit test

return Array.from(set).map((v) => ({ value: v, name: v, view: v.replaceAll('_', ' ') }));
}, [queries]);

const wlmGroupOptions = useMemo(() => {
Copy link
Member

Choose a reason for hiding this comment

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

Please add some comments on what this helper function do

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added comment


// Set initial WLM group filter from URL
useEffect(() => {
if (wlmGroupIdFromUrl && !selectedWlmGroups.includes(wlmGroupIdFromUrl)) {
Copy link
Member

Choose a reason for hiding this comment

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

When navigating from WLM to Top queries page but will this also update the table filter UI? I see on your screenshot it is not updated.

field: WLM_GROUP_FIELD as keyof SearchQueryRecord,
name: WLM_GROUP,
render: (wlmGroupId: string, q: SearchQueryRecord) => {
if (q.group_by === 'SIMILARITY') return '-';
Copy link
Member

Choose a reason for hiding this comment

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

if group by is enabled, should we dynamically hide this column?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

but for the mixed type when both are selected or none selected the query list has both the types then we will see this column for group

render: (wlmGroupId: string, q: SearchQueryRecord) => {
if (q.group_by === 'SIMILARITY') return '-';
const groupId = wlmGroupId || 'DEFAULT_WORKLOAD_GROUP';
const displayName =
Copy link
Member

Choose a reason for hiding this comment

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

There's a bug on this logic. If connected to data sources < 3.3, in which backend records does not have this wlmgroupid defined, we are still showing DEFAULT_WORKLOAD_GROUP for these records. Ideally they should be -.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated the logic to handle the below 3.3

Kishore Kumaar Natarajan added 5 commits December 1, 2025 11:18
Signed-off-by: Kishore Kumaar Natarajan <[email protected]>
Signed-off-by: Kishore Kumaar Natarajan <[email protected]>
Signed-off-by: Kishore Kumaar Natarajan <[email protected]>
Signed-off-by: Kishore Kumaar Natarajan <[email protected]>
Signed-off-by: Kishore Kumaar Natarajan <[email protected]>
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.

2 participants