Skip to content

fix(ui): show tag suggestion tasks as tags, not a description - #38073

Merged
Rohit0301 merged 9 commits into
mainfrom
Rohit0301/8554-issue-fix
Nov 18, 2026
Merged

Rohit0301 merged 9 commits into
mainfrom
Rohit0301/8554-issue-fix

Conversation

@Rohit0301

@Rohit0301 Rohit0301 commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes open-metadata/openmetadata-collate#8554 (the OpenMetadata UI part)

An AI automation proposes tags as a Suggestion task with payload.suggestionType: "Tag" and the tag labels as a JSON string in payload.suggestedValue. The task views showed that JSON as a Suggested Description, so a reviewer could not see which tags they were accepting.

There were two causes:

  1. Wrong form schema. DescriptionSuggestion and TagSuggestion share the same task type and category (Suggestion / MetadataUpdate). resolveTaskFormSchema looks them up by those two values with limit: 1, so it always got DescriptionSuggestion. Suggestion tasks now resolve their schema by name (${suggestionType}Suggestion), using the existing GET /taskFormSchemas/name/{fqn}.
  2. Only TagUpdate was treated as a tag task. isTagsTaskType now takes the whole task and also covers Tag suggestions. Payload normalization, the feed card, the task tab, TagsTaskFromTask and the Inbox detail all use it.

The TagSuggestion schema's tagSelector widget edits a list of tag labels. getEditableTaskPayload turns the JSON string into that list, and getTaskResolutionNewValue turns it back into the JSON string the server applies (TaskWorkflowHandler.applySuggestion).

Not in this PR:

  • The table's "Suggested Tags" view: already fixed on main by fix(ui): show tag suggestions by reading suggestedValue #37398. It needs a backport to 2.0.
  • "Success · No changes" on the AI Automations list: that's in the Collate repo (lastRunStatus.tsx never reads impact.pending).
  • The schema's field title "Suggested Tags (JSON)": it comes from the seeded TagSuggestion.json, and seeding doesn't update rows that already exist.

Screenshots

Entity → Activity Feeds & Tasks: the card and the task panel show tag chips

Entity task view

Inbox task detail: the suggestion is shown as a tags change

Inbox task detail

Playwright: TagSuggestionTask.spec.ts passed (local run)

Playwright pass

Type of change:

  • Bug fix

Tests:

Use cases covered

  • A Tag suggestion task renders its tags, not JSON and not "Suggested Description", in the feed card, the task panel and the Inbox detail.
  • Accepting it applies the tags to the column.
  • A Description suggestion still renders as a description.

Unit tests

  • TaskPayloadUtils.test.ts: a Tag suggestion gives suggestedTags and no newDescription. A Description suggestion is unchanged.
  • TaskFormSchemaUtils.test.ts: the schema name comes from suggestionType. The editable payload parses the tags, and the resolution value turns them back into the JSON string.
  • taskDetail.utils.test.ts: in the Inbox, a Tag suggestion shows a tags change and no JSON box.
  • Updated mocks in TaskTabNew.component.test.tsx and TaskDetailPanel.test.tsx. I removed a module-wide isTagsTaskType → true mock, which now leaked into payload handling.

Local Jest: 64 suites, 952 tests passed. tsc, ESLint and Prettier are clean on the changed files.

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • playwright/e2e/Features/Tasks/TagSuggestionTask.spec.ts: creates a Tag suggestion on a column. It checks that the card and the panel show the tag (no JSON, no "Suggested Description"), approves it, and verifies the column has the tag.
    • Ran locally with --project=chromium --no-deps against a 2.0.0-SNAPSHOT server: passed. yarn lint:playwright has 0 errors.

Visual regression baselines

  • Not applicable. Only Tag suggestion tasks render differently, and no baseline covers them.

Manual testing performed

Created a Tag suggestion task with POST /api/v1/tasks (type: Suggestion, payload.suggestionType: Tag). I checked the entity's Activity Feeds & Tasks tab and /tasks/<taskId>: both screenshots above are from that check.

Checklist:

  • I have read the CONTRIBUTING document.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • I have added a test that covers the exact scenario we are fixing.

🤖 Generated with Claude Code


Summary by Gitar

  • Tag suggestion form schema:
    • Suggestion tasks now resolve their form schema by name via getTaskFormSchemaByName
  • Tag suggestion rendering:
    • Tag suggestions render as tag chips in the feed card, task panel, and Inbox detail
  • Tag suggestion merge:
    • Suggested tags are added to current tags and deduplicated by tagFQN via uniqBy
  • Schema decision record:
    • Added ADR documenting that suggestion schemas are named after their suggestionType
  • Playwright coverage:
    • Added TagSuggestionTask.spec.ts covering card, panel, and accept flow
  • Impact map:
    • Registered the new TagSuggestionTask spec in impact-map.generated.json

This will update automatically on new commits.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no new blocking issues were found.

Summary

Tag suggestion tasks now show tags instead of raw JSON across the feed, task panel, and Inbox.

  • Tag suggestions appear as tags across task views.

No new actionable issues were found in the latest changes. The earlier findings are addressed in the current code.

Reviews (6) · Last reviewed commit: "test(ui): clean up the table even when t..." · Reviewed by Greptile

A Suggestion task with suggestionType Tag carries its tag labels as a JSON
string in suggestedValue. The task views only treated TagUpdate as a tag
task, and the form schema lookup by type and category always returned
DescriptionSuggestion, so reviewers saw "Suggested Description: [json]".

- isTagsTaskType takes the task and covers Tag suggestions; payload
  normalization, the feed card, the task tab and TagsTaskFromTask use it
- suggestion tasks resolve their form schema by name (TagSuggestion /
  DescriptionSuggestion) instead of the first type+category match
- the tag selector edits the parsed tags and resolution sends them back as
  the JSON string the server applies
- the Inbox detail shows a tag suggestion as a tags change

Refs open-metadata/openmetadata-collate#8554
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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.

Address review on #38073:

- The tagSelector widget keeps a string-typed field (TagSuggestion's
  suggestedValue) a JSON string, so the panel and Inbox approvals send a
  payload that validates against the schema (it was rejected with
  "array found, string expected")
- A Tag suggestion's tags are added to the field's current tags, matching
  how the server applies it, instead of current tags hiding the suggestion
- Tag diffs compare labels by tagFQN, so an unchanged tag no longer shows
  as removed and re-added
- Record the <suggestionType>Suggestion form schema naming as a decision
# Conflicts:
#	.github/playwright/impact-map.generated.json
#	openmetadata-ui/src/main/resources/ui/src/components/Entity/Task/TaskTab/TaskTabNew.component.test.tsx
#	openmetadata-ui/src/main/resources/ui/src/components/Entity/Task/TaskTab/TaskTabNew.component.tsx
#	openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/InboxPage/components/TaskDetailPanel.test.tsx
#	openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/InboxPage/components/TaskDetailPanel.tsx
#	openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/shared/TaskPayloadSchemaFields.test.tsx
#	openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/shared/TaskPayloadSchemaFields.tsx
#	openmetadata-ui/src/main/resources/ui/src/utils/TaskFormSchemaUtils.ts
- The Inbox tags change for a Tag suggestion lists only the tags approval
  adds; tags the field already has no longer show as additions
- TagSuggestionTask.spec no longer waits on /taskFormSchemas/name/TagSuggestion:
  the server stamps taskFormSchemaId on new suggestions, so the panel fetches
  the schema by id and the name request never happens
- TagSuggestionTask.spec creates the suggestion task in beforeAll and
  hard-deletes it in afterAll, and asserts the exact tag text
- isTagsTaskType compares against SuggestionType.Tag
- Rename the decision record to match the resolution order it describes,
  noting it documents #38061 after the fact
…t created

afterAll skips the task delete when beforeAll failed before creating it,
so the table is still deleted, and both hooks release their API session
in a finally.
@gitar-bot

gitar-bot Bot commented Nov 18, 2026

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

Tag suggestions now use tag-specific schema and payload handling, changing what reviewers see and submit and potentially affecting tags applied on approval.

Renders Tag suggestion tasks as tag chips in the feed card, task panel, and Inbox detail instead of raw JSON under "Suggested Description", and applies the tags on accept. One open minor issue: the Playwright afterAll throws on an undefined task if beforeAll fails, which skips table cleanup. Guarding the task delete with optional chaining would fix it. Resolved this session: the ${suggestionType}Suggestion schema-name derivation has no ADR.

✅ 2 closed
✅ Quality: Schema-name derivation ${suggestionType}Suggestion has no ADR

📄 openmetadata-ui/src/main/resources/ui/src/utils/TaskFormSchemaUtils.ts:78-91 📄 openmetadata-ui/src/main/resources/ui/src/utils/TaskFormSchemaUtils.ts:98 📄 openmetadata-ui/src/main/resources/ui/src/utils/TaskFormSchemaUtils.ts:107-109 📄 openmetadata-ui/src/main/resources/ui/src/rest/taskFormSchemasAPI.ts:103-109
getTaskFormSchemaName sets up a naming contract between the UI and the server's seeded task form schemas (openmetadata-service/.../taskFormSchemas/TagSuggestion.json, DescriptionSuggestion). A Suggestion task's form schema is now fetched from /taskFormSchemas/name/${suggestionType}Suggestion instead of by type and category, so any new suggestionType or renamed seed file has to follow this pattern. If it doesn't, the UI quietly falls back to the description default. The rule appears only in the PR description ("Suggestion tasks resolve their form schema by name (${suggestionType}Suggestion) instead of by task type and category"), and nothing in docs/decisions/ records it. The PR is squash-merged, so that sentence will be lost. The record should say: "The form schema for a Suggestion task is the TaskFormSchema named <payload.suggestionType>Suggestion. Type+category resolution is not used for Suggestion tasks because every suggestion schema shares the same type and category."

Closed: Edge Case: afterAll crashes on undefined task and skips table cleanup

📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/Tasks/TagSuggestionTask.spec.ts:31 📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/Tasks/TagSuggestionTask.spec.ts:55-56 📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/Tasks/TagSuggestionTask.spec.ts:61-66
If task creation in beforeAll fails (for example expect(createResponse.ok()).toBe(true) throws), task is never assigned. afterAll then throws a TypeError on task.id before it reaches table.delete and afterAction(). The table leaks, and a cleanup error gets reported on top of the real failure. Fix: guard the task delete with optional chaining so the table is always cleaned up.

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

@Rohit0301
Rohit0301 merged commit f853a82 into main Nov 18, 2026
54 of 56 checks passed
@Rohit0301
Rohit0301 deleted the Rohit0301/8554-issue-fix branch November 18, 2026 10:16
Rohit0301 added a commit that referenced this pull request Nov 18, 2026
…37398, #38061, #38073) (#38114)

* fix(ui): read tag suggestions from suggestedValue (#37398)

Suggestion tasks carry proposed tags as a JSON string in suggestedValue;
the UI only read tagsToAdd, so tag suggestion cards showed no tags and
accepting one cleared the displayed tags until a refetch.

(cherry picked from commit 3ad9990)

* Fixes #38033: Suggestion tasks render the correct form (tag vs description) (#38061)

* Fixes #38033: Suggestion tasks render the correct form (tag vs description)

* Parse JSON tag suggestions in tagSelector; keep schema fallbacks and drop stale responses

- tagSelector reads a string-typed field (TagSuggestion's suggestedValue) as
  JSON tags and writes edits back as a JSON string, so the tag form no longer
  crashes on the string payload.
- A failed fetch of the stamped schema id falls through to the name/type
  lookup instead of the built-in default.
- TaskTabNew ignores a schema response that lands after the task changed.
- Add TaskSuggestionForm.spec.ts covering both suggestion variants.

---------

Co-authored-by: detail-app[bot] <180357370+detail-app[bot]@users.noreply.github.com>
Co-authored-by: Harsh Vador <[email protected]>
(cherry picked from commit 94f6191)

* fix(ui): show tag suggestion tasks as tags, not a description (#38073)

* fix(ui): show tag suggestion tasks as tags, not a description

A Suggestion task with suggestionType Tag carries its tag labels as a JSON
string in suggestedValue. The task views only treated TagUpdate as a tag
task, and the form schema lookup by type and category always returned
DescriptionSuggestion, so reviewers saw "Suggested Description: [json]".

- isTagsTaskType takes the task and covers Tag suggestions; payload
  normalization, the feed card, the task tab and TagsTaskFromTask use it
- suggestion tasks resolve their form schema by name (TagSuggestion /
  DescriptionSuggestion) instead of the first type+category match
- the tag selector edits the parsed tags and resolution sends them back as
  the JSON string the server applies
- the Inbox detail shows a tag suggestion as a tags change

Refs open-metadata/openmetadata-collate#8554

* fix(ui): keep tag suggestion payloads valid and additive

Address review on #38073:

- The tagSelector widget keeps a string-typed field (TagSuggestion's
  suggestedValue) a JSON string, so the panel and Inbox approvals send a
  payload that validates against the schema (it was rejected with
  "array found, string expected")
- A Tag suggestion's tags are added to the field's current tags, matching
  how the server applies it, instead of current tags hiding the suggestion
- Tag diffs compare labels by tagFQN, so an unchanged tag no longer shows
  as removed and re-added
- Record the <suggestionType>Suggestion form schema naming as a decision

* chore(playwright): add TagSuggestionTask spec to the impact map

* fix(ui): list only added tags in the Inbox and drop the schema-name wait

- The Inbox tags change for a Tag suggestion lists only the tags approval
  adds; tags the field already has no longer show as additions
- TagSuggestionTask.spec no longer waits on /taskFormSchemas/name/TagSuggestion:
  the server stamps taskFormSchemaId on new suggestions, so the panel fetches
  the schema by id and the name request never happens

* chore(ui): address review on tag suggestion task test and record

- TagSuggestionTask.spec creates the suggestion task in beforeAll and
  hard-deletes it in afterAll, and asserts the exact tag text
- isTagsTaskType compares against SuggestionType.Tag
- Rename the decision record to match the resolution order it describes,
  noting it documents #38061 after the fact

* test(ui): clean up the table even when the tag suggestion task was not created

afterAll skips the task delete when beforeAll failed before creating it,
so the table is still deleted, and both hooks release their API session
in a finally.

(cherry picked from commit f853a82)

* fix(ui): adapt the backported task specs and schema cache to 2.0

- TagSuggestionTask.spec uses 2.0's getTaskCard (utils/taskWorkflow, takes
  the CreatedTask) and waitForTaskResolveResponse; both specs import expect
  from @playwright/test, since 2.0's fixtures/pages exports only test
- Bound the task form schema cache (100 entries, oldest evicted), as on main

---------

Co-authored-by: Anujkumar Yadav <[email protected]>
Co-authored-by: detail-app[bot] <180357370+detail-app[bot]@users.noreply.github.com>
Co-authored-by: Harsh Vador <[email protected]>
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.

2 participants