Skip to content

Fixes #37588: Task created notifications link to the task page - #37589

Merged
manerow merged 3 commits into
mainfrom
fix/task-created-notification-link
Nov 18, 2026
Merged

manerow merged 3 commits into
mainfrom
fix/task-created-notification-link

Conversation

@manerow

@manerow manerow commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

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 generic system-notification-entity-created. That template links with buildEntityUrl, which builds /{entityType}/{fqn} for any type it does not know, and it did not know task. 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:

  1. buildEntityUrl knows tasks. A task links to /tasks/{taskId}, the task detail page, and ignores the tasks/all feed view, since that page has no feed tabs. This fixes the link in every template that links a task, including custom templates.
  2. Adds 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:

  • Bug fix

High-level design:

N/A, small bug fix.

Tests:

Use cases covered

  • A workflow approval task email links to /tasks/TASK-xxxxx and to the table, and lists the proposed tag change and the assignees.
  • A task with no asset, payload or assignees still renders, falling back to the event's user.
  • buildEntityUrl for a task returns /tasks/{taskId}, with or without a feed view.

Unit tests

  • I added unit tests for the new/changed logic.
  • Added TaskEntityCreatedTemplateTest (3 tests). Updated BuildEntityUrlHelperTest (2 new tests) and SystemTemplateParityTest (the new template is now in its list).
  • Coverage: not measured with JaCoCo. Each of the 3 changed lines in BuildEntityUrlHelper is covered by a test that fails when the line is reverted.
  • Every unit test in the full impact plan passes locally: BuildEntityUrlHelperTest, SystemTemplateParityTest, TaskEntityCreatedTemplateTest, TaskEntityUpdatedTemplateTest, HandlebarsHelperExampleTest, NotificationTemplateHelperAdvancedTest (66 tests, 0 failures).

Backend integration tests

  • Not applicable (no backend API changes).
  • Pending: the full plan lists 70 integration test classes in the alerting and seed-data areas. They were not run locally and run in the merge queue.

Local Java test run: PASSED

  • Commit: 89e23847a339 (base origin/main)
  • Finished: 2026-11-11 14:31 UTC · 1.5 min
  • Scope: focused; merge readiness is not established. Broader steps deferred: 4 (run --scope full).
Step Scope Classes Tests Failed Skipped Min Result
unit openmetadata-service (3 classes) 3 20 0 0 1.5 passed

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Not applicable (no UI changes).

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 CreateTask stores carries about, createdBy, assignees and payload.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 (the pr-checklist skill runs it) and fixed every 🔴 finding, or answered it on the line below.

    • Reviewed 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.

@manerow
manerow requested a review from a team as a code owner November 11, 2026 15:14
@manerow
manerow requested a review from TeddyCr November 11, 2026 15:14
@manerow

manerow commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

Local Java test run: PASSED — details

  • Commit: 89e23847a339 (base origin/main)
  • The summary is in the PR description.

Tests run locally

  • unit · openmetadata-service (3 classes): BuildEntityUrlHelperTest (14 passed), SystemTemplateParityTest (3 passed), TaskEntityCreatedTemplateTest (3 passed)

Broader coverage not executed by this focused run

  • mvn -B package -pl openmetadata-service -am -Dspring-boot.repackage.skip=true -Dtest=BuildEntityUrlHelperTest,HandlebarsHelperExampleTest,NotificationTemplateHelperAdvancedTest,SystemTemplateParityTest,TaskEntityCreatedTemplateTest,TaskEntityUpdatedTemplateTest -Dsurefire.failIfNoSpecifiedTests=false
  • mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pmysql-elasticsearch -DintegrationTests.lane=parallel '-Dit.test=<67 classes>' -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false
  • mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pmysql-elasticsearch -DintegrationTests.lane=global-state -Dit.test=ConversationSchemaMigrationIT,MetricMigrationIT -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false
  • mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pcache-tests -DintegrationTests.lane=parallel -Dit.test=AlertStateIT -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false
Commands
mvn -B package -pl openmetadata-service -am -Dspring-boot.repackage.skip=true -Dtest=BuildEntityUrlHelperTest,SystemTemplateParityTest,TaskEntityCreatedTemplateTest -Dsurefire.failIfNoSpecifiedTests=false

@github-actions

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.

@gitar-bot

gitar-bot Bot commented Nov 13, 2026 •

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

Task 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 /tasks/{taskId} instead of the nonexistent /task/TASK-xxxxx route, and a new system-notification-task-entity-created template names the task creator, type, asset, description, proposed changes and assignees. A previously flagged proposedChanges payload key mismatch in the Proposed changes section was resolved. No open issues found.

✅ 1 closed
✅ Bug: 'Proposed changes' section reads a payload key no task ever has

📄 openmetadata-service/src/main/resources/json/data/notifications/templates/system-notification-task-entity-created.json:8 📄 openmetadata-service/src/test/java/org/openmetadata/service/alerting/content/template/TaskEntityCreatedTemplateTest.java:94-101 📄 openmetadata-service/src/test/java/org/openmetadata/service/alerting/content/template/TaskEntityCreatedTemplateTest.java:127-128
The new template renders {{#each entity.payload.proposedChanges}} with added/removed lists under each field key. Nothing in the repo (Java, JSON schemas or task form schemas) produces a proposedChanges key. task.json declares payload as a free-form object that is validated by the per-type TaskFormSchema, and none of those schemas has this shape. So for real approval or update-request tasks this section never renders. The PR says the notification should explain what change is proposed, so that part doesn't actually happen.

TaskEntityCreatedTemplateTest.approvalTask() builds the payload by hand in this made-up shape, so the test passes even though production code never sends it. To fix this, point the template at the payload fields the task types actually carry (for example, whatever CreateTask or the update-request flow writes into payload), and build the test fixture from a real task payload. If no such field exists yet, drop the section.

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

@manerow
manerow merged commit 144bbc5 into main Nov 18, 2026
57 of 58 checks passed
@manerow
manerow deleted the fix/task-created-notification-link branch November 18, 2026 07:35
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.

Task created notifications link to /task/TASK-xxxxx, a page that does not exist

3 participants