fix: node group filter uses exact match and drops empty filter entries - #3131
Merged
arunjaindev merged 8 commits intoAug 3, 2026
Merged
Conversation
…ilter entries The Nodes page node group filter used a substring (includes) match instead of an exact match, so filtering by e.g. "presto-gateway" also matched a distinct node group like "presto-gateway-2". Additionally, a blank/empty filter value could get appended alongside a real node group selection (e.g. via nodes with no node group, or a stray entry making it into the query string), which silently neutralized the filter since an empty value always "matches" via includes(). - utils.tsx: isItemASearchMatchForNodeListing now compares the node group value with strict equality instead of includes(). - utils.tsx: getNodeSearchKeysOptionsList no longer adds a node-group option for nodes that have no node group value. - NodeListSearchFilter.tsx: handleSearchFilterChange strips falsy-value entries before persisting filters to the query string, and the FilterChips display filters out falsy values consistently across all three filter categories. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ALUMzuWmSoDrXv4nANo6ZD
… chore/sync-main-3-8
chore: sync main 3/8/26
vivek-devtron
previously approved these changes
Aug 3, 2026
arunjaindev
previously approved these changes
Aug 3, 2026
arunjaindev
dismissed stale reviews from vivek-devtron and themself
August 3, 2026 09:35
The base branch was changed.
… fix/node-group-filter-exact-match-and-empty-entry
…ttps://github.com/devtron-labs/dashboard into fix/node-group-filter-exact-match-and-empty-entry
vivek-devtron
approved these changes
Aug 3, 2026
|
arunjaindev
approved these changes
Aug 3, 2026
arunjaindev
deleted the
fix/node-group-filter-exact-match-and-empty-entry
branch
August 3, 2026 09:38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Requested by Pawan Mehta · Slack thread
Description
Fixes two bugs in the Resource Browser → Nodes page "Node Groups" filter:
presto-gateway) also matched nodes from a distinct, similarly-named node group (e.g.presto-gateway-2), because the match used.includes()instead of exact equality..some()across the comma-separated filter values, and every string "includes" the empty string, one blank entry caused the whole filter to match every node — with no obvious indication in the UI.Related Issue(s)
Fixes devtron-labs/devtron#6997
Before / After
Before
presto-gatewayalso showed nodes belonging topresto-gateway-2.After
presto-gatewayshows only nodes whose node group is exactlypresto-gateway.Root cause
src/components/ResourceBrowser/ResourceList/utils.tsx—isItemASearchMatchForNodeListingcompared the node group value withString(item[objectKey] ?? '').includes(trimmedText)instead of exact equality, and iterated comma-separated filter values with.some(), so a single empty value always matched.src/components/ResourceBrowser/ResourceList/utils.tsx—getNodeSearchKeysOptionsListadded a node-group option for every row without checking whethercurr.data.nodeGroupwas actually set, so nodes without a node group (e.g. control-plane nodes) contributed a blank/invisible option to the filter dropdown.src/components/ResourceBrowser/ResourceList/NodeListSearchFilter.tsx—handleSearchFilterChangewrote whatever options were selected straight into the query string without filtering out falsy values.What changed
utils.tsx:isItemASearchMatchForNodeListingnow uses strict equality (===) for the node group comparison instead of.includes().utils.tsx:getNodeSearchKeysOptionsListskips building a node-group option whencurr.data.nodeGroupis falsy.NodeListSearchFilter.tsx:handleSearchFilterChangefilters out falsy-value entries before persisting filters to the query string (applies to all three filter categories: node group, label, k8s version).NodeListSearchFilter.tsx: theFilterChipsfilterConfignow consistently filters out falsy values for all three categories (previously only node group was defensively filtered for display).Type of change
How Has This Been Tested?
npx tsc --noEmit— clean, no errors.npx eslinton both changed files with--max-warnings 0— clean.Manually traced the matching logic (
isItemASearchMatchForNodeListing) against sample node group values (presto-gatewayvspresto-gateway-2, and a blank entry alongside a real one) to confirm the exact-match fix and the empty-entry stripping resolve both reported symptoms.Typecheck (
tsc --noEmit)Lint (
eslint --max-warnings 0on changed files)Checklist: