Repository navigation
Fixes #37588: Task created notifications link to the task page - #37589
Conversation
|
Local Java test run: PASSED — details
Tests run locally
Broader coverage not executed by this focused run
Commandsmvn -B package -pl openmetadata-service -am -Dspring-boot.repackage.skip=true -Dtest=BuildEntityUrlHelperTest,SystemTemplateParityTest,TaskEntityCreatedTemplateTest -Dsurefire.failIfNoSpecifiedTests=false |
❌ 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 |
Code Review ✅ Approved 🟡 Medium risk 1 closed / 1 findingsTask notification links and content now render task, asset, and proposed-change details; incorrect template data could misdirect recipients or misstate approval context. Task created notifications now link to the task detail page at ✅ 1 closed✅ Bug: 'Proposed changes' section reads a payload key no task ever has
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. 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 #37588
When a task is created, a Task alert sends a message whose only link points to
/task/TASK-xxxxx. The UI has no page there, so it opens Page Not Found. The message also does not say which asset the task is about or who must act.Why it happens: notification templates are picked by name,
system-notification-{entityType}-{eventType}. Tasks have a template for updates (system-notification-task-entity-updated) but not for creation, so a new task falls back to the genericsystem-notification-entity-created. That template links withbuildEntityUrl, which builds/{entityType}/{fqn}for any type it does not know, and it did not knowtask. In 1.13 a task was a thread, and the thread template had a task branch with the type, asset and assignees. That branch stopped being reached when tasks became their own entity.This PR:
buildEntityUrlknows tasks. A task links to/tasks/{taskId}, the task detail page, and ignores thetasks/allfeed view, since that page has no feed tabs. This fixes the link in every template that links a task, including custom templates.system-notification-task-entity-created. It names who opened the task, the task type, the task (linked), the asset (linked), the description, the proposed changes stored on approval tasks (for example "tags: added X; removed Y") and the assignees.No migration: missing system templates are created at startup, and alerts on the default template pick the new one up.
Backports: 2.1 has the
/tasks/{taskId}page, so the change applies as is. 2.0 has no task detail page, so the 2.0 backport will link to the asset's Tasks tab instead, as the task-updated template already does.Type of change:
High-level design:
N/A, small bug fix.
Tests:
Use cases covered
/tasks/TASK-xxxxxand to the table, and lists the proposed tag change and the assignees.buildEntityUrlfor a task returns/tasks/{taskId}, with or without a feed view.Unit tests
TaskEntityCreatedTemplateTest(3 tests). UpdatedBuildEntityUrlHelperTest(2 new tests) andSystemTemplateParityTest(the new template is now in its list).BuildEntityUrlHelperis covered by a test that fails when the line is reverted.BuildEntityUrlHelperTest,SystemTemplateParityTest,TaskEntityCreatedTemplateTest,TaskEntityUpdatedTemplateTest,HandlebarsHelperExampleTest,NotificationTemplateHelperAdvancedTest(66 tests, 0 failures).Backend integration tests
Local Java test run: PASSED
89e23847a339(baseorigin/main)--scope full).Ingestion integration tests
Playwright (UI) tests
Manual testing performed
Not run on a live server. The unit tests render the template through the production Handlebars helpers. I checked by reading the code that the event
CreateTaskstores carriesabout,createdBy,assigneesandpayload.proposedChanges.UI screen recording:
Not applicable: backend notification template and link fix.
Checklist:
I have read the CONTRIBUTING document.
My PR title is
Fixes <issue-number>: <short explanation>My PR is linked to a GitHub issue via
Fixes #<issue-number>above.I have commented on my code, particularly in hard-to-understand areas.
For JSON Schema changes: not applicable, no schema change.
For a UI feature or feature task: not applicable.
I have added tests (unit / integration / Playwright as applicable) and listed them above.
Self-review: I reviewed the final diff against
REVIEW.md(thepr-checklistskill runs it) and fixed every 🔴 finding, or answered it on the line below.89e23847a339: no 🔴. One 🟡 nit (the test Javadoc tells the story of the bug) left as is.Decision check: no record needed. The new template follows the existing
system-notification-{entityType}-{eventType}naming.I have added a test that covers the exact scenario we are fixing.