Repository navigation
fix: honor the global domain filter on glossary, metric, classification and tag list endpoints - #31180
fix: honor the global domain filter on glossary, metric, classification and tag list endpoints#31180sonika-shah wants to merge 4 commits into
Conversation
…dpoint GET /v1/glossaries ignored the `domain` query parameter that the UI's global domain filter appends, so the Govern -> Glossary left panel listed glossaries from every domain regardless of the selected domain. Resolve the domain name/FQN and apply it as the ListFilter `domainId` condition, matching the existing DataProductResource#list pattern. Adds GlossaryResourceIT#test_listWithDomainFilter asserting cross-domain isolation (fails without the fix).
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
|
The Java checkstyle failed. Please run You can install the pre-commit hooks with |
There was a problem hiding this comment.
Pull request overview
This PR fixes the backend GET /api/v1/glossaries list endpoint to honor the UI’s global Domain selection by adding a domain query parameter and translating it into the existing ListFilter domain scoping (domainId → ListFilter.getDomainCondition). It also adds an integration test to prevent regressions.
Changes:
- Add
@QueryParam("domain")toGlossaryResource.list()and apply the resolveddomainIdfilter before callinglistInternal. - Reuse the established domain-filtering pattern already used by service and data product list endpoints.
- Add an integration test validating that
?domain=<fqn>returns only glossaries assigned to that domain.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| openmetadata-service/src/main/java/org/openmetadata/service/resources/glossary/GlossaryResource.java | Adds domain query param handling and maps it to ListFilter domain scoping for glossary listing. |
| openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/GlossaryResourceIT.java | Adds an IT verifying glossary list results are correctly scoped by the requested domain. |
| @Parameter( | ||
| description = "Filter glossaries by domain name or fully qualified name", | ||
| schema = @Schema(type = "string", example = "Engineering")) | ||
| @QueryParam("domain") |
… list endpoints Extend the glossary domain-filter fix to the other REST list endpoints that silently dropped the `domain` query param appended by the UI's global domain filter: MetricResource, ClassificationResource and TagResource. Same pattern as glossary and DataProductResource -- resolve the domain name/FQN and apply it as the ListFilter `domainId` condition. Adds test_listWithDomainFilter to Metric/Classification/Tag ResourceIT covering cross-domain isolation (fails without the fix).
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.
Suppressed comments (4)
openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/TagResourceIT.java:226
- The test creates new Domain entities but does not register them with TestNamespace cleanup. On shared/external clusters this can accumulate leftover domains across runs and slow down subsequent tests/reindexing. Track the created domain as a root entity via ns.trackRoot so it is hard-deleted in AfterEach cleanup.
private Domain createTestDomain(TestNamespace ns, String suffix) {
CreateDomain createDomain =
new CreateDomain()
.withName(ns.prefix(suffix))
.withDescription("Test domain " + suffix)
.withDomainType(DomainType.AGGREGATE);
return SdkClients.adminClient().domains().create(createDomain);
}
openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/MetricResourceIT.java:198
- The test creates new Domain entities but does not register them with TestNamespace cleanup. On shared/external clusters this can accumulate leftover domains across runs and slow down subsequent tests/reindexing. Track the created domain as a root entity via ns.trackRoot so it is hard-deleted in AfterEach cleanup.
private Domain createTestDomain(TestNamespace ns, String suffix) {
CreateDomain createDomain =
new CreateDomain()
.withName(ns.prefix(suffix))
.withDescription("Test domain " + suffix)
.withDomainType(DomainType.AGGREGATE);
return SdkClients.adminClient().domains().create(createDomain);
}
openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/GlossaryResourceIT.java:608
- The test creates new Domain entities but does not register them with TestNamespace cleanup. On shared/external clusters this can accumulate leftover domains across runs and slow down subsequent tests/reindexing. Track the created domain as a root entity via ns.trackRoot so it is hard-deleted in AfterEach cleanup.
private Domain createTestDomain(TestNamespace ns, String suffix) {
CreateDomain createDomain =
new CreateDomain()
.withName(ns.prefix(suffix))
.withDescription("Test domain " + suffix)
.withDomainType(DomainType.AGGREGATE);
return SdkClients.adminClient().domains().create(createDomain);
}
openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/ClassificationResourceIT.java:199
- The test creates new Domain entities but does not register them with TestNamespace cleanup. On shared/external clusters this can accumulate leftover domains across runs and slow down subsequent tests/reindexing. Track the created domain as a root entity via ns.trackRoot so it is hard-deleted in AfterEach cleanup.
private Domain createTestDomain(TestNamespace ns, String suffix) {
CreateDomain createDomain =
new CreateDomain()
.withName(ns.prefix(suffix))
.withDescription("Test domain " + suffix)
.withDomainType(DomainType.AGGREGATE);
return SdkClients.adminClient().domains().create(createDomain);
}
…on domain filter Add OpenMetadata UI Playwright specs verifying the global (navbar) Domain filter scopes the Glossary, Metrics and Classifications list pages. The glossary spec also exercises the DomainOnlyAccessRole paths so the global filter and the RBAC filter are told apart.
❌ UI Checkstyle Failed❌ Playwright - ESLint + Prettier + Organise ImportsOne or more Playwright test files have linting or formatting issues. Affected files
Fix locally (fast - only checks files changed in this branch): make ui-checkstyle-changed |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.
Suppressed comments (7)
openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/GlossaryResourceIT.java:607
- Domains created here are not registered with TestNamespace for post-test cleanup. TestNamespaceExtension only deletes roots tracked via ns.trackRoot(...), so this will leave domain entities behind on shared/external clusters and can bloat subsequent tests/reindexing.
return SdkClients.adminClient().domains().create(createDomain);
openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/MetricResourceIT.java:197
- Domains created here are not registered with TestNamespace for post-test cleanup. TestNamespaceExtension only deletes roots tracked via ns.trackRoot(...), so this will leave domain entities behind on shared/external clusters and can bloat subsequent tests/reindexing.
return SdkClients.adminClient().domains().create(createDomain);
openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/ClassificationResourceIT.java:198
- Domains created here are not registered with TestNamespace for post-test cleanup. TestNamespaceExtension only deletes roots tracked via ns.trackRoot(...), so this will leave domain entities behind on shared/external clusters and can bloat subsequent tests/reindexing.
return SdkClients.adminClient().domains().create(createDomain);
openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/TagResourceIT.java:225
- Domains created here are not registered with TestNamespace for post-test cleanup. TestNamespaceExtension only deletes roots tracked via ns.trackRoot(...), so this will leave domain entities behind on shared/external clusters and can bloat subsequent tests/reindexing.
return SdkClients.adminClient().domains().create(createDomain);
openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/MetricDomainFilter.spec.ts:45
- The waitForResponse matcher requires a literal
?in the URL. Some callers can hit/api/v1/metricswithout a query string, which would make this step hang/flaky. Match the path without enforcing a query separator (consistent with other e2e specs that useincludes('/api/v1/...')).
response.url().includes('/api/v1/metrics?') &&
openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/ClassificationDomainFilter.spec.ts:60
- The waitForResponse matcher requires a literal
?in the URL. If the request is made without query params (/api/v1/classifications), this will hang/flaky. Prefer matching the path only.
response.url().includes('/api/v1/classifications?') &&
openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/GlossaryDomainFilter.spec.ts:100
- The waitForResponse matcher requires a literal
?in the URL. If the request is made without query params (/api/v1/glossaries), this will hang/flaky. Prefer matching the path only.
response.url().includes('/api/v1/glossaries?') &&
🔴 Playwright Results — workflow failedValidated commit ✅ 1086 passed · ❌ 2 failed · 🟡 5 flaky · ⏭️ 1 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 53m 40s ⏱️ Max setup 3m 5s · max shard execution 19m 5s · max shard-job elapsed before upload 22m 59s · reporting 9s 🌐 202.52 requests/attempt · 2.29 app boots/UI scenario · 14.15% common-shard skew Optimization targets still in progress:
Genuine Failures (failed on all attempts)❌
|
| Include include) { | ||
| ListFilter filter = new ListFilter(include); | ||
| if (!nullOrEmpty(domain)) { | ||
| EntityReference domainReference = |
There was a problem hiding this comment.
do we need this call agian? why are we not passing FQN for filtering?
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.
Suppressed comments (6)
openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/MetricDomainFilter.spec.ts:45
waitForMetricListwaits forGET /api/v1/metrics?..., but the Metrics list page is search-backed (it queriesGET /api/v1/search/query?index=metric...). This will likely time out and make the spec fail even when the domain filter works.
const waitForMetricList = (page: Page) =>
page.waitForResponse(
(response) =>
response.request().method() === 'GET' &&
response.url().includes('/api/v1/metrics?') &&
openmetadata-service/src/main/java/org/openmetadata/service/resources/glossary/GlossaryResource.java:163
- Setting
domainIdhere can get overwritten for DomainOnlyAccessRole users:EntityResource#listInternalunconditionally callsEntityUtil.addDomainQueryParam(...), andFilter#addQueryParamoverwrites existing keys. As a result,?domain=won’t actually narrow results for domain-restricted users (it will be replaced with the user’s assigned domainIds), which also makes the new domain-filter E2E coverage for DomainOnlyAccess users likely to fail.
if (!nullOrEmpty(domain)) {
EntityReference domainReference =
Entity.getEntityReferenceByName(Entity.DOMAIN, domain, Include.NON_DELETED);
filter.addQueryParam("domainId", String.format("'%s'", domainReference.getId()));
}
openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/GlossaryResourceIT.java:607
- This domain is created via the SDK but never registered with
TestNamespace#trackRoot, so it won’t be cleaned up byTestNamespaceExtensionand can accumulate on shared clusters across test runs.
return SdkClients.adminClient().domains().create(createDomain);
openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/MetricResourceIT.java:197
- This domain is created via the SDK but never registered with
TestNamespace#trackRoot, so it won’t be cleaned up byTestNamespaceExtensionand can accumulate on shared clusters across test runs.
return SdkClients.adminClient().domains().create(createDomain);
openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/ClassificationResourceIT.java:198
- This domain is created via the SDK but never registered with
TestNamespace#trackRoot, so it won’t be cleaned up byTestNamespaceExtensionand can accumulate on shared clusters across test runs.
return SdkClients.adminClient().domains().create(createDomain);
openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/TagResourceIT.java:225
- This domain is created via the SDK but never registered with
TestNamespace#trackRoot, so it won’t be cleaned up byTestNamespaceExtensionand can accumulate on shared clusters across test runs.
return SdkClients.adminClient().domains().create(createDomain);
|
|
Updated approach - #31538 |
Code Review ✅ ApprovedAdds domain query parameter support to glossary, metric, classification, and tag endpoints to correctly honor global domain filters, accompanied by comprehensive integration and E2E tests. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |



Describe your changes:
Fixes #31173
Several REST
list()endpoints did not honor the global Domain filter. The UI'swithDomainFilterinterceptor appends?domain=<fqn>to non-searchGETs, but an endpoint only applies it if itslist()declares@QueryParam("domain")and maps it into theListFilterdomainIdcondition. Endpoints that didn't silently dropped the param and returned entities from every domain regardless of the domain selected in the navbar.Reported for the Glossary left panel (by a customer). Verified the same gap on a running 2.0 instance for other domain-scoped catalog entities:
?domain=before/glossaries/metrics/classifications/tags/dataProductsThis adds the
domainquery parameter toGlossaryResource,MetricResource,ClassificationResourceandTagResource, resolving it into theListFilterdomainIdcondition — the same pattern already used byDataProductResource#listand the service resources. The condition flows through the entity-agnosticListFilter.getDomainCondition(matchingentity_relationshiprows withrelation=10), so it scopes each list to the selected domain. TheDomainOnlyAccessRolefilter applied insidelistInternalstill runs afterwards, so the navbar selection can never widen a restricted user's scope.Type of change:
Tests
Backend integration tests —
test_listWithDomainFilteradded toGlossaryResourceIT,MetricResourceIT,ClassificationResourceITandTagResourceIT: entities assigned to domain A are returned for?domain=Aand absent for?domain=B, and vice-versa. Each fails without the fix.Playwright E2E (
playwright/e2e/Pages/) —GlossaryDomainFilter.spec.ts,MetricDomainFilter.spec.ts,ClassificationDomainFilter.spec.ts: selecting a domain in the navbar scopes the Glossary / Metrics / Classifications list pages. The glossary spec additionally covers theDomainOnlyAccessRolepaths (single-domain isolation for two users, and a multi-domain user narrowing within assigned domains) so the global filter and the RBAC filter are told apart.Checklist: