Repository navigation
fix(ui): show tag suggestions by reading suggestedValue - #37398
Conversation
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.
Code Review ✅ Approved🟡 Medium risk · Parsing tag suggestions from suggestedValue lets users accept them, but unexpected parsed values could apply unintended tags to entities. Fixes tag suggestion cards on entity pages showing 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 |
|
| Count | Rule |
|---|---|
| 1 | openmetadata-imports/no-api-calls-in-iteration |
All findings
| Location | Rule | Message | |
|---|---|---|---|
| 🟡 | src/rest/suggestionsAPI.ts:263:11 |
openmetadata-imports/no-api-calls-in-iteration |
Avoid issuing one API request per item. Fetch at the data owner, use a bulk endpoint, or use useQueries with an intentional concurrency policy. |
Fix locally (fast - only checks files changed in this branch):
make ui-checkstyle-changed…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]>
Describe your changes:
Tracked in open-metadata/openmetadata-collate#7393 (no separate OSS issue, hence
skip-pr-checks).Tag suggestion cards on entity pages showed
--instead of the proposed tags, and accepting one briefly cleared the column's tags in the UI until a refetch.taskToSuggestionread tag suggestions only frompayload.tagsToAdd. Every producer ofSuggestiontasks —createSuggestionin this same file, the AI agent tool, the v200 migration — sends the tags as a JSON string inpayload.suggestedValue, soSuggestion.tagLabelswas alwaysundefined. That fedSuggestionsAlertan emptyTagsViewer, madeSchemaTable/TableDetailsPageV1publish{ tags: undefined }on accept, and made accept-all sendnewValue: undefined. The backend already applied the tags correctly (TaskWorkflowHandlerreadstagsToAdd, thensuggestedValue).suggestionsAPI.ts: forTagsuggestions, parsesuggestedValueintotagLabels.tagsToAddstill wins when present, matching the backend's order. Unparsable or non-array values leavetagLabelsunset.SuggestionsSliderPermissions.spec.ts: drop thetagsToAddkey from the mocked payload. No real producer sends it, and it hid this bug.Type of change:
High-level design:
N/A — small change.
Tests:
Use cases covered
newValue.suggestedValueleavetagLabelsunset.Unit tests
src/rest/suggestionsAPI.test.ts: 3 new tests; 12/12 pass. The two positive tests fail against the previous mapper.Backend integration tests
Ingestion integration tests
Playwright (UI) tests
SuggestionsSliderPermissions.spec.ts: mock payload corrected. Not run locally (pending); the spec's tag assertions now depend on this fix.Manual testing performed
Suggestiontask (fieldPath: columns.customer_email.tags, tags only insuggestedValue) on a local server.--.UI screen recording:
Recorded locally against the same backend and the same seeded column tag
Suggestiontask, whose payload carries onlysuggestedValue(the shape real producers send). Before = current build; after = this branch served by Vite.--After accept, the tags land on the column instead of the cell going blank:
Accept flow on this branch:
Checklist:
Fixes <issue-number>: <short explanation>— no OSS issue; tracked in the Collate issue above.Fixes #<issue-number>above.