Repository navigation
Fixes 35005: Search tasks about an entity and filter mentions by entity - #34819
Conversation
The entity Activity feed lists the tasks about one entity through GET /v1/tasks?aboutEntity=…, which had no search, and its Mentions view needs the mentions about that entity only. - GET /v1/tasks takes `q`, the same task search the scoped task lists use (name, displayName, payload reason, about displayName / FQN). The five `q` parameters share one description constant. - GET /v1/activity/mentions takes an optional `entityLink`; it matches the entity the way /v1/activity/about does (aboutFqnHash of the link's entity) and is authorized like /about. The mention subquery, domain filter and ordering are shared constants across the four MySQL/Postgres variants.
❌ 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 |
|
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! |
|
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! |
…earch A free-text `q` can't narrow rows through an index, so the name-ordered page walked task_entity_name_index and checked every task until it filled a page. With `q`, the task list now selects rows through the other filters (e.g. aboutEntity) and sorts only those: MySQL ignores the name index, Postgres materializes the matches first. Postgres also gets a text_pattern_ops index on task_entity.aboutfqnhash: the plain btree can't serve the aboutEntity `LIKE 'hash.%'` prefix under a non-C collation, so every aboutEntity list and count seq-scanned the table. EXPLAIN ANALYZE on 1M tasks (page query, old -> new): - MySQL, service-level aboutEntity + q: ~27s -> ~0.3s; one table + q: ~1ms -> <0.1ms - Postgres, one table + q: ~900ms -> 0.2ms; service + q: ~380ms -> ~110ms - q with no other filter: ~25s/12s -> one full pass (~7s/2s); no index can serve it
…ity-mentions # Conflicts: # bootstrap/sql/migrations/native/2.1.0/postgres/schemaChanges.sql
Main now builds the generic list and count conditions through ListFilter.getConditionForEntity(table) (#34785). Use the same entry point in the task search overrides so their page and the count can't drift apart.
|
The Java checkstyle failed. Please run You can install the pre-commit hooks with |
Code Review ✅ Approved🔴 High risk · Adding entity-level view authorization to filtered mention feeds changes access decisions and could block callers who previously retrieved those mentions. Adds a free-text OptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
🚦 Removed from the merge queue —
|
🚦 Removed from the merge queue —
|



Fixes #35005
Describe your changes:
Backend for the entity Activity feed (the Inbox's Activity and Tasks views on an entity page; the UI comes in a separate PR). That view lists the tasks about one entity, and its Mentions view shows only the mentions about that entity. Two small API additions, no schema change and no migration.
GET /v1/taskstakesq/visible,/assigned,/owned, …) already use: name, displayName, the payload's reason, and the about-entity's displayName / FQN.aboutEntityit searches one entity's tasks;aboutEntityalready matches by FQN prefix, so a table's column-level tasks are included.qparameters now share one description constant.GET /v1/activity/mentionstakes an optionalentityLinkGET /v1/activity/aboutmatches it (aboutFqnHashof the link's entity).entityLinkis given, the caller must be able to view that entity (authorizeEntityLinkView, as/aboutdoes).GET /v1/conversationstakesincludeFields(defaultfalse)entityLink, also lists the conversations about the entity's fields: a table link returns the table's and its columns' conversations (about = link OR about LIKE '<link without >>::%', wildcards escaped, inside the existingaboutFqnHashmatch). A column link stays that column's.Type of change:
Tests:
Backend integration tests
ActivityResourceIT#test_mentionsFeedFiltersByEntity: a mention on one table is returned for its link, a mention on another table is not, and withoutentityLinkthe feed still has every mention.TaskResourceIT#testListEndpointSearchesWithinEntity:aboutEntity+qreturns the matching task on the entity, not a non-matching task on it nor a matching task on another entity.ConversationResourceIT#testListingIncludesFieldConversationsOnRequest: without the flag a table link returns only the table's conversation; with it, the table's and its column's; a column link with it returns only the column's.ConversationFilterTestcovers the predicate and the escaped prefix.Checklist:
Fixes <issue-number>: <short explanation>🤖 Generated with Claude Code