Fixes #26970: fix bot name search on the Bots page#27365
Fixes #26970: fix bot name search on the Bots page#27365siddhiguptas wants to merge 28 commits intoopen-metadata:mainfrom
Conversation
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
There was a problem hiding this comment.
Pull request overview
Fixes bot search behavior on the UI Bots page by making client-side filtering consistently case-insensitive (and normalized) across both the user’s search input and the bot fields being searched, addressing issue #26970.
Changes:
- Added a shared
filterBotsBySearchTermhelper to centralize bot search matching logic. - Updated
BotListV1to use the shared helper instead of inline filtering logic. - Added regression unit tests to cover display name/name matching and email-style identifier matching.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| openmetadata-ui/src/main/resources/ui/src/utils/BotsUtils.tsx | Introduces shared bot filtering helper with consistent normalization across searched fields. |
| openmetadata-ui/src/main/resources/ui/src/utils/BotsUtils.test.tsx | Adds unit tests validating case-insensitive and email-style bot search matching. |
| openmetadata-ui/src/main/resources/ui/src/components/Settings/Bot/BotListV1/BotListV1.component.tsx | Switches Bots page filtering to use the shared helper and removes now-unneeded inline normalization. |
|
@siddhiguptas we need to implement api search here and not client side search, please make changes accordingly |
🔴 Playwright Results — 1 failure(s), 19 flaky✅ 3953 passed · ❌ 1 failed · 🟡 19 flaky · ⏭️ 86 skipped
Genuine Failures (failed on all attempts)❌
|
…l lookup with robust partial email matching
…nd hardening glossary/tag and cleanup flows
|
@harsh-vador fixed |
|
@siddhiguptas there is a failing playwright check, can you please fix it? |
|
@harsh-vador I’ve narrowed the changes to bot-only scope. I kept updates in |
|
@siddhiguptas try to run the Bots.spec.ts on your local and test your bot related changes, because the spec was failing |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
openmetadata-ui/src/main/resources/ui/playwright/utils/bot.ts:105
createBotnow assertsrevoke-button,center-panel, andtoken-expirywithout navigating to the bot details page. Those elements are rendered on the bot details view (as implied by the existinggetCreatedBothelper and by subsequent steps likeupdateBotDetails), so this helper will be brittle/fail if the create flow returns to the listing page. Consider restoring the explicit navigation (click the created bot link or route to/bots/{fqn}) before asserting details-page controls.
// Verify bot is getting added in the bots listing page
await expect(
page.getByTestId(`bot-link-${BOT_DETAILS.botName}`)
).toBeVisible();
await expect(
page.getByRole('cell', { name: BOT_DETAILS.description })
).toBeVisible();
await expect
.poll(async () => page.getByTestId('revoke-button').count(), {
timeout: 30000,
})
.toBeGreaterThan(0);
await expect(page.getByTestId('revoke-button')).toContainText('Revoke token');
await expect(page.getByTestId('center-panel')).toContainText(
`${BOT_DETAILS.JWTToken} Token`
);
await expect(page.getByTestId('token-expiry')).toBeVisible();
…bot cleanup assertions in Playwright
|
hey @harsh-vador I tried to fix things but that one Playwright tests is still falling. I tired to look into the logs and the test is failing for the files we haven't touched. |
|
@siddhiguptas can you please update the PR description with screen recording? |
@harsh-vador updated |
…licate bot user mapping logic
|
Hi @harsh-vador, I investigated the latest CI run and found two tracks: for the bot flow, the timeout appears tied to the new shared search helper predicate being too strict around search API matching, and for the rest, the failures look out-of-scope to this PR ( |
Code Review ✅ Approved 11 resolved / 11 findingsBot name search is now optimized with direct lookups, a deduplicated enrichment process, and corrected result handling. These updates resolve N+1 API call patterns, race conditions, and pagination loops identified in the previous implementation. ✅ 11 resolved✅ Edge Case: lodash lowerCase strips special chars, broadening search
✅ Performance: N+1 API calls: getBotByName called individually per matched user
✅ Bug: Stale search results from race condition in handleSearch
✅ Quality: Duplicated bot-user enrichment logic in two functions
✅ Performance: getBotsByBotUserNames scans all bots instead of direct lookup
...and 6 more resolved from earlier reviews OptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
|



Describe your changes:
Fixes #26970
This change replaces client-side bot filtering on the Bots page with API-driven search so bot name and bot email searches both work reliably.
I worked on this because bot search should be consistent and accurate for both bot names and email-like identifiers, and API search is the expected behavior for this page.
Changes made:
BotListV1and switched search flow to APIgetBotByNameinbotsAPI.tsand used it to resolve matched bot users into bot entitiessearchQuery(SearchIndex.USER+isBot:true)BotsUtils.tsxandBotsUtils.test.tsxplaywright/e2e/Pages/Bots.spec.tsplaywright/utils/bot.tsTesting:
git diff --checkyarn lint:base src/components/Settings/Bot/BotListV1/BotListV1.component.tsx src/rest/botsAPI.ts src/utils/BotsUtils.tsx src/utils/BotsUtils.test.tsxyarn lint:base playwright/e2e/Pages/Bots.spec.ts playwright/utils/bot.tsyarn pretty:base --check src/components/Settings/Bot/BotListV1/BotListV1.component.tsx src/rest/botsAPI.ts src/utils/BotsUtils.tsx src/utils/BotsUtils.test.tsx playwright/e2e/Pages/Bots.spec.ts playwright/utils/bot.tsyarn test src/components/Settings/Bot/BotListV1/BotListV1.component.test.tsx --watch=falseyarn test src/utils/BotsUtils.test.tsx --watch=falseNote:
make ui-checkstyle-src-changedcould not be completed in this environment due missingantlr4binary in PATH during UI postinstall/build-check.Type of change:
Checklist:
Fixes <issue-number>: <short explanation>Not applicable. This PR only updates UI/API search behavior and related tests; there is no schema or migration impact.
Screen Recording - https://drive.google.com/file/d/1HisqYIXrGDWtM9-nFI-urc2FXB2S58vk/view?usp=drive_link
Summary by Gitar
searchFromSearchInputandupdateSearchInputAndWaitincommon.tsto handle standardized search input with API response waiting.verifyBotSearchutility to validate bot searching by name and email inbot.ts.verifyBotSearchinto the mainBots.spec.tstest suite.This will update automatically on new commits.