fix(ui): match Tier/Certification tag FQNs by prefix, not substring#27700
fix(ui): match Tier/Certification tag FQNs by prefix, not substring#27700
Conversation
…27689) Closes #27689 `getTagAssetsQueryFilter` used `fqn.includes('Tier.')` / `.includes('Certification.')` to pick which index field to query, so any tag whose classification name *ended* with "Tier" or "Certification" (e.g. `DataTier.Bronze`) was routed to the `tier.tagFQN` / `certification.tagLabel.tagFQN` fields and returned no assets. Anchor the check to the start of the FQN using `FQN_SEPARATOR_CHAR` so only the built-in Tier and Certification classifications hit the special fields.
|
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 incorrect routing in getTagAssetsQueryFilter where classifications whose names merely contained Tier. / Certification. were treated as the built-in Tier/Certification classifications, causing asset lookups to return empty results.
Changes:
- Switch Tier/Certification detection from substring matching to prefix matching using
FQN_SEPARATOR_CHAR. - Ensure non-built-in classifications (e.g.,
DataTier.*,DataCertification.*) fall back totags.tagFQN. - Add regression tests covering the two failing cases.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| openmetadata-ui/src/main/resources/ui/src/utils/TagsUtils.tsx | Anchors Tier/Certification detection to the start of the FQN to select the correct ES field. |
| openmetadata-ui/src/main/resources/ui/src/utils/TagsUtils.test.tsx | Adds regression tests ensuring custom classifications ending with Tier/Certification use the common tag field. |
🔴 Playwright Results — 10 failure(s), 27 flaky✅ 3936 passed · ❌ 10 failed · 🟡 27 flaky · ⏭️ 86 skipped
Genuine Failures (failed on all attempts)❌
|
Code Review ✅ ApprovedUpdates the UI logic to match Tier and Certification tag FQNs using a prefix-based comparison instead of substrings. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
|



Summary
getTagAssetsQueryFilterusedfqn.includes('Tier.')/.includes('Certification.')to pick which index field to query, so any classification whose name ended withTierorCertification(e.g.DataTier.Bronze,DataCertification.Gold) was routed totier.tagFQN/certification.tagLabel.tagFQNand returned no assets.FQN_SEPARATOR_CHAR, so only the built-in Tier and Certification classifications hit the special fields; all others fall back totags.tagFQN.TagsUtils.test.tsxcoveringDataTier.BronzeandDataCertification.Gold.Closes #27689
Test plan
yarn test src/utils/TagsUtils.test.tsx— 10/10 pass, including two new casesDataTier, tag an asset withDataTier.Bronze, open the tag page and confirm the asset appears🤖 Generated with Claude Code