Repository navigation
Fixes #37588: Task created notifications link to the task page (backport 2.0 #37589) - #38090
Conversation
Code Review ✅ Approved 🟡 Medium riskTask-created notifications now link to the related asset’s Tasks or Issues tab; an incorrect mapping could send recipients to the wrong context. Adds a task-created email template that links to the asset's Tasks tab on 2.0, since no task detail page exists there, and lists proposed changes, lifecycle stage and assignees. No issues found. 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 |
| private String buildTaskUrl(Map<String, Object> entityMap) { | ||
| if (!(entityMap.get(KEY_ABOUT) instanceof Map<?, ?> aboutObj)) { | ||
| LOG.debug("Task missing about reference"); | ||
| return null; | ||
| } | ||
| Map<String, Object> about = (Map<String, Object>) aboutObj; | ||
| String aboutType = getTrimmed(about, KEY_TYPE).orElse(""); | ||
| String aboutFqn = getTrimmed(about, KEY_FQN).orElse(""); | ||
| if (aboutType.isEmpty() || aboutFqn.isEmpty()) { | ||
| LOG.debug("Task about reference missing type or FQN"); | ||
| return null; | ||
| } | ||
| return buildEntityUrl(aboutType, aboutFqn, about, "tasks"); |
There was a problem hiding this comment.
New helper breaks Java rules.
buildTaskUrl adds two early returns, checks strings with .isEmpty(), and leaves unchanged local variables and its parameter non-final. The repository’s Java guide requires one trailing return, nullOrEmpty(...) for string checks, and final for values that do not change. Apply those requirements to the new helper.
Context Used: CLAUDE.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Describe your changes:
Backport of #37589 to
2.0. Fixes #37588.A task-created email linked to
/task/TASK-xxxxx, a page the UI does not have, so the link gave a 404. There was no task-created template, so the generic entity-created one was used. This addssystem-notification-task-entity-created, which links the task and the asset, and lists the proposed changes, the lifecycle stage move and the assignees.How this differs from #37589.
2.0has no task page:ROUTES.TASK_DETAILexists, but no route renders it, so/tasks/{taskId}would also 404. So on2.0:buildEntityUrlsends ataskto the Tasks tab of the asset it is about (/{type}/{fqn}/activity_feed/tasks, or the Issues tab for a test case). This is wheresystem-notification-task-entity-updatedalready links on2.0.aboutasset shows its id as plain text instead of an empty link.2.0'snotifications.templatepackage, and theSystemTemplateParityTestline is dropped, since that test does not exist on2.0.Type of change:
Tests:
Unit tests
TaskEntityCreatedTemplateTest(from Fixes #37588: Task created notifications link to the task page #37589, asserting the asset's Tasks tab instead of/tasks/{id}, plus a no-asset case) andBuildEntityUrlHelperTest(task to a table, task to a test case, task with no asset). WithTaskEntityUpdatedTemplateTeston2.0: 22 passed.Backend integration tests
UI screen recording:
Not applicable: backend-only change.
Checklist:
Fixes #<issue-number>above.REVIEW.md; no findings.2.0task-updated template.Meet the Java requirements in
buildTaskUrlbefore merging.Findings
Summary
Adds a task-created notification that links to the asset’s Tasks tab, or Issues tab for test cases, instead of a missing task page.
The new Java helper needs to follow the repository’s coding rules before merging.
Reviews (1) · Last reviewed commit: "Fixes #37588: Task created notifications..." · Reviewed by Greptile