Skip to content

fix(domain): tasks follow the pick except on an asset, and more fixes from the domain filter retest - #37825

Merged
sonika-shah merged 33 commits into
mainfrom
fix/domain-filter-retest-findings
Nov 16, 2026
Merged

sonika-shah merged 33 commits into
mainfrom
fix/domain-filter-retest-findings

Conversation

@sonika-shah

@sonika-shah sonika-shah commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #37846

Companion Collate PR: https://github.com/open-metadata/openmetadata-collate/pull/8572

Follow-up to #36483. Fixes what the end-to-end retest of the navbar domain pick found, in both AI and Classic mode, across admin, DataConsumer, DataSteward and domain-only users.

  • Tasks follow the pick, except on an asset. Home "My Tasks", the inbox and the bell listed every domain's tasks while a user's Tasks tab hid them, and an asset's Tasks tab showed "Open (2)" over an empty list when the asset was outside the pick. Work-queue lists now follow the pick; a list about given assets (aboutEntity, aboutEntityIds, dataset) never does, so an opened asset shows all its tasks and its count matches its list. Decision record updated (v3).
  • A parent pick includes its sub-domains on Data Quality test cases / suites / incidents (search lists and the SQL incident lists) and on task lists. These matched the picked domain exactly.
  • /metrics/hierarchy no longer returns 400 when the picked domain has no metrics.
  • An asset's Activity tab is not narrowed by the pick, like its Tasks tab: a Beta table opened under an Alpha pick shows its history. The activity feed is still scoped, and viewing an asset's activity still needs permission to view the asset.
  • Classifications and tags follow the pick. The Tags page shows the picked domain's classifications and those with no domain; system-provided ones (Tier, PII, Certification) always stay, even if given a domain. Tag pickers are unchanged. Decision record v4.
  • A glossary's term count follows the pick, so the Terms badge matches the list.
  • A 403 on a table, service or data product page shows the permission placeholder instead of "No Data Product found", an empty page or a blank /403 in Classic mode.
  • Picker fixes: re-picking the active domain keeps it; search finds domains outside the active one (prefix search returned nothing); a user locked to one domain no longer gets a chip "×" that does nothing; switching domain reopens a list on its first page.
  • Smaller fixes: the Data Products list "Domains" column shows the domain's colour and icon; a Context Center article shows the "belongs to another domain" banner.
Details

Tasks

  • The backend already honours an explicit domain on /tasks, /tasks/assigned, /tasks/visible and /tasks/count, and keeps task out of the server-side pick (DomainFilterExclusions), so this is a UI change: withDomainFilter scopes /tasks GETs like other lists, and skips requests carrying aboutEntity / aboutEntityIds / dataset. ActivityFeedProvider and ActivityFeedTab no longer add the domain themselves, which is what made the asset tab list and its badge disagree.
  • TaskRepository.addDomainFilter now expands each domain to its sub-domains (EntityUtil.domainAndSubDomainIds, made public).
  • Tasks with no domain are hidden under a pick, as on other strict lists.

Sub-domains

  • SearchListFilter.getDomainCondition: the explicit domains filter now uses the same term-or-prefix clause as the navbar pick (only the DQ resources set it).
  • TestCaseResolutionStatusResource binds the domain plus its sub-domains; ListFilter.testCaseInDomainCondition matches fromId IN (...). The nearest-level-decides rule is unchanged.

Other backend

  • MetricRepository.groupInDomainPick skips the batch relationship lookup when there are no picked metrics (@BindList rejects an empty list).
  • GlossaryRepository term counts apply the navbar filter with the glossary as parent scope, as the term list does. New overload EntityUtil.addNavbarDomainFilter(ListFilter, type, parent) reads the request's selection; bot and background threads have none.

UI

  • useSwitchActiveDomain drops currentPage / cursorType / cursorValue from the URL before reloading.

Not in this PR: search aggregates (Explore facet counts, Home "By connector") still count every domain under a pick, deferred as a follow-up since it changes every aggregate screen; the Context Center article tree still shows other domains' articles (filtering a tree can orphan an article whose parent is in another domain; needs a decision); /403 rendering blank in Classic mode for the other detail pages that still redirect there.

Type of change:

  • Bug fix

Tests:

  • Backend unit tests: SearchListFilterTest, ListFilterTest, MetricRepositoryTest (new tests fail without the fix); EntityUtilTest, DomainNavFilterTest still green.
  • IT: UserResourceIT.test_glossaryTermsFollowTheirEffectiveDomain now asserts the term count.
  • UI jest: withDomainFilter, ActivityFeedProvider, DomainSelect, DomainFilterChip, useSwitchActiveDomain, DataProductsPage, TableDetailsPageV1, ServiceDetailsPage, domainFieldRenderers, KnowledgePageDetailComponent; each new test fails without its fix.
  • Task behaviour checked against a live stack: with a pick, /tasks/assigned|visible|count and /tasks?aboutEntity= return the expected rows with and without domain.

Checklist:

  • I have read the CONTRIBUTING document.
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no new actionable issue was established.

Summary

Makes task queues follow the selected domain while keeping an asset’s own tasks and activity visible.

  • Task queues follow the domain pick, while asset task tabs stay complete.
  • Data Quality lists include test cases and incidents from sub-domains.
  • Tag and classification lists follow the pick but keep shared system labels.
  • Glossary term counts follow the picked domain.
  • Metric hierarchy loads when a picked domain has no metrics.
  • The domain picker can find, keep, and switch domains cleanly.
  • Forbidden detail pages show a permission message in place.
  • Data Products show each domain with its own color and icon.
  • Context Center articles show when they belong to another domain.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[GET request] --> B{About a specific asset?}
  B -->|Tasks or activity| C[Remove domain pick]
  B -->|No| D{Domain selected?}
  D -->|Yes| E[Apply domain pick]
  D -->|No| F[Keep request unchanged]
  C --> G[Server checks access]
  E --> G
  F --> G
Loading

Reviews (6) · Last reviewed commit: "Domain filter: ADR v5 records the in-pla..." · Reviewed by Greptile

Home "My Tasks", the inbox and the bell listed tasks from every domain under a
pick, while a user's Tasks tab hid them, and an asset's Tasks tab counted its
tasks but listed none when the asset was outside the pick.

The withDomainFilter interceptor now scopes task requests like any other list,
and leaves a request about given assets (aboutEntity, aboutEntityIds, dataset)
unscoped, so an opened asset shows all its tasks and its count matches its list.
Callers no longer add the domain to task requests themselves. Decision record
updated (v3).
…in has no metrics

GET /v1/metrics/hierarchy under a pick whose domain holds no metrics returned
400 ("argument is null or empty") from a batch lookup given an empty id list.
…icked domain

Test cases, test suites and incident searches filtered by a domain matched it
exactly, so under a parent pick the items of its sub-domains were missing. The
domain filter now matches the domain and its sub-domains, as the navbar pick does.
The Incident Manager lists and groups matched only the named domain, so under a
parent pick incidents on test cases in its sub-domains were missing.
A task list filtered by a domain matched only that domain, so under a parent pick
the tasks of its sub-domains were hidden from Home and the inbox.
… list

Under a pick the Terms tab listed only the terms in the picked domain but its
badge counted every term of the glossary.
…t-found or a redirect

A domain-only user opening another domain's data product, service or table got
"No Data Product found", an empty page, or a redirect to /403 (blank in Classic).
Render the in-place permission placeholder these pages already use for missing
view access.
/search/aggregate only got an ignored domain= param on GET and nothing on POST,
so under a pick the Explore Domains facet still offered other domains and the
Home "By connector" breakdown counted the whole catalog. Add the same domain
clause /search/query gets, to the GET q filter and the POST body query.
The Domains column drew a plain globe and name, so a styled domain lost its
colour and icon there. Render it with DomainTags, which resolves the style by
domain id like every other domain chip.
The drawer stays mounted when closed, so selecting an asset, closing and
reopening still showed "1 selected". Reset the selection and the failure and
dry-run state when it closes.
An article from another domain opened with no "belongs to another domain"
banner, unlike data asset pages. Render DomainMismatchAlert with the article's
domains, which the page already fetches.
@sonika-shah
sonika-shah requested review from a team as code owners November 15, 2026 13:22
@sonika-shah
sonika-shah requested review from ShaileshParmar11 and manerow and a balanced review from Copilot November 15, 2026 13:22
@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This 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 skip-pr-checks label.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

Search aggregates now follow the navbar pick, but the lineage graph shows
every domain's nodes, so its filter dropdowns must offer their values too.
Lineage quick filters send the skip-domain-filter header.
Copilot AI balanced review requested due to automatic review settings November 15, 2026 17:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

Under a pick each classification's tag count reused a fresh navbar filter, so
the picked domain's sub-domains were looked up once per row. The batch now
resolves it once and every count shares it.
Copilot AI balanced review requested due to automatic review settings November 16, 2026 05:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

The asset Activity tab list (and several asset count helpers) passed the pick
explicitly, so only the count call ignored it and the tab showed a count over an
empty list. The interceptor now removes a domain from any request about one
asset (its tasks, its data access requests, its activity), whoever set it.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviews are paused until your billing migration is complete. Open billing settings to continue.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

…vice

A 403 keeps the previously viewed service's details, so the placeholder named
that service. It now names the service the URL asks for.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@gitar-bot

gitar-bot Bot commented Nov 16, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk 6 closed / 6 findings

Reworking domain filtering across task, activity, tag, and data-quality lists could expose records beyond the intended selection or hide expected results.

Domain filter retest fixes make work-queue task lists follow the navbar pick while asset-scoped task lists and Activity tabs stay unfiltered, extend sub-domain matching to DQ and task lists, and make classifications, tags and glossary term counts follow the pick. Resolved this session: explicit domain REST params now match sub-domains, search aggregates follow the domain pick, the asset Activity tab exemption is covered, unquoted requestedDomainId no longer produces empty task lists, and the classification list no longer runs a subtree lookup plus count per row. No open issues found.

✅ 6 closed
✅ Quality: Explicit domain REST params now match sub-domains; no ADR records it

📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TaskRepository.java:259-266 📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TestCaseResolutionStatusRepository.java:1145-1151 📄 openmetadata-service/src/main/java/org/openmetadata/service/search/SearchListFilter.java:158-165 📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/ListFilter.java:1013-1021 📄 docs/decisions/2026-10-29-mostly-global-lists-keep-unassigned-items-under-a-domain-pick.md:46-57
This PR changes what an explicit domain filter means on three public endpoints. TaskRepository.addDomainFilter binds requestedDomainId to domainAndSubDomainIds. The incident list endpoints (domain) now go through resolveDomainFilterIds, and SearchListFilter.getDomainCondition (domains) uses domainSubtreeCondition. Before, each of these matched the named domain only. API clients and the Python SDK depend on this, so it is a REST parameter contract. The description says it in prose ("A parent domain pick includes its sub-domains on Data Quality test cases, suites and incidents, and on task lists"). The ADR v3 revision only covers whether task lists follow the pick. It even says "the endpoints narrow only on an explicit domain" without saying that the explicit filter now includes sub-domains. Add a record (or a v4 bullet) that states: "An explicit domain/domains filter on task, incident and DQ search list endpoints matches the domain and all its sub-domains, the same as the navbar pick." Name the guard tests (ListFilterTest.incidentDomainFilterMatchesEveryGivenDomainId, SearchListFilterTest).

✅ Quality: Search aggregates now follow the domain pick; no ADR records it

📄 openmetadata-ui/src/main/resources/ui/src/hoc/withDomainFilter.tsx:210-224 📄 openmetadata-ui/src/main/resources/ui/src/hoc/withDomainFilter.tsx:286-300
withDomainFilter now rewrites every /search/aggregate request under a pick. On a GET it adds the domain clause to q, and on a POST to the body's query. Unscoped indexes are skipped, and a plain-text q is left unscoped on purpose. The description notes that this changes "every aggregate under a pick … including Home totals, tag usage counts and Explore tree counts". That is a cross-screen judgment call (which counts narrow, and that plain-text aggregates silently stay global), but it exists nowhere in the tree. The ADR v3 revision covers only task lists. Add a record such as: "Under a navbar domain pick, the UI scopes every /search/aggregate request (GET q, POST query) to the picked domain and its sub-domains, except unscoped indexes; a plain-text aggregate query is left unscoped."

✅ Bug: Classification tag count ignores the pick, so it won't match the tag list

📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/DomainFilterExclusions.java:60-72 📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/DomainNavFilter.java:131-133
This commit puts tags under the navbar pick: DomainNavFilter.apply now adds domainId, domainAccessControl and domainKeepsSystemProvided to tag lists. The classification termCount is computed separately and doesn't use the pick. ClassificationRepository.batchFetchTermCounts calls classificationDAO().bulkGetTermCounts(hashes), and the fallback getTermCount builds a plain ListFilter with only parent. Neither gets the navbar domain filter.

On the Tags page with a domain picked, a classification that has user-provided tags assigned to other domains will show a tag-count badge larger than the number of tags listed. Glossaries had the same mismatch, and this PR fixed it in GlossaryRepository with EntityUtil.addNavbarDomainFilter(filter, type, parent).

Fix: apply the same navbar filter (entity type tag, the classification as parent) to the term-count path. The simplest way is to count with tagDAO().listCount(filter) whenever a selection is active. Add an IT that checks the count under a pick.

✅ Quality: Asset Activity tab exemption from the pick is not in the ADR

📄 openmetadata-ui/src/main/resources/ui/src/hoc/withDomainFilter.tsx:38-43 📄 openmetadata-ui/src/main/resources/ui/src/hoc/withDomainFilter.tsx:221 📄 docs/decisions/2026-10-29-mostly-global-lists-keep-unassigned-items-under-a-domain-pick.md:46-57
This commit adds a second exemption from the navbar domain pick: withDomainFilter no longer adds domain= to /activity/entity/... GETs (isAboutOneAsset), while the /activity feed is still scoped. The PR description states this rule: "An asset's Activity tab is not narrowed by the pick, like its Tasks tab ... The activity feed is still scoped, and viewing an asset's activity still needs permission to view the asset." docs/decisions/2026-10-29-mostly-global-lists-keep-unassigned-items-under-a-domain-pick.md v3 covers only task lists about assets (aboutEntity/aboutEntityIds/dataset), and its Consequences section says that changing what a list shows under a pick needs a new revision. Because the repo squash-merges, the rule will exist only in this interceptor. Add a revision line saying: "An asset's own activity (/activity/entity/{type}/{id} and /activity/entity/{type}/name/{fqn}, its Activity tab and count) is not narrowed by the pick; the cross-asset activity feed (/activity) is. Access still requires view permission on the asset (authorizeTargetView)." List withDomainFilter.test.tsx as its guard.

✅ Bug: Unquoted requestedDomainId never intersects quoted role scope: empty task lists

📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TaskRepository.java:259-266 📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TaskRepository.java:284-290 📄 openmetadata-service/src/main/java/org/openmetadata/service/util/EntityUtil.java:1129-1131
requestedDomainId used to come from getCommaSeparatedIdsFromRefs, which quotes each id ('uuid'). It now comes from domainAndSubDomainIds, which returns bare ids (uuid,uuid). For a domain-only user, applyDomainQueryParam still sets domainId with quoted ids, and applyTaskDomainFilter passes both strings to intersectDomainIds. That method compares the trimmed tokens as exact strings, so uuid never equals 'uuid'. The intersection is always empty, domainId becomes NULL_PARAM, and the query gets NO_MATCH_DOMAIN_ID.

This PR also makes withDomainFilter add domain= to every work-queue task list under a pick (Home My Tasks, inbox, bell, the profile Tasks tab). So a domain-only user with a pick now gets an empty task list and a zero count. EntityUtilTest covers only the scope params, not this intersection.

The fix is to strip quotes from both sides before comparing, or to quote the sub-domain ids when building requestedDomainId. A test should also run applyTaskDomainFilter with a quoted domainId, domainAccessControl=true and an explicit domain.

...and 1 more closed from earlier reviews

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

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.

Navbar domain pick: work queues, counts and asset pages don't follow the selected domain

4 participants