Skip to content

[2.0] Fixes #35913: remove tags a resolved TagUpdate leaves out - #37724

Merged
yan-3005 merged 1 commit into
2.0from
backport/2.0/pr-36008
Nov 13, 2026
Merged

yan-3005 merged 1 commit into
2.0from
backport/2.0/pr-36008

Conversation

@yan-3005

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #35913

Backport of #36008 to 2.0. 2.0 has diverged from main, so this is a hand port, not a cherry-pick. The behaviour is the same.

When a TagUpdate task is approved, the UI sends newValue = the task's currentTags minus tagsToRemove plus tagsToAdd. The server dropped tagsToRemove and only added. As a result:

  • A Replace inside a mutually exclusive classification left the column unchanged while the task showed Approved: the mutual-exclusivity error was logged and swallowed.
  • A Remove left the removed tag in place.

Now the approved list replaces what the task saw (its currentTags snapshot plus tagsToRemove). Tags added to the target after the task was filed stay, unless an approved tag from the same mutually exclusive classification displaces them. A task without a snapshot only removes its tagsToRemove.

What differs from main: 2.0 has no EntityFieldPath. The target's tags are read through TaskTagTarget.isEntityLevel and FieldPathUtils.findField(entity, TaskTagTarget.locatablePath(fieldPath)), the same lookup 2.0's patchFieldTags already uses. The tests carry only #36008's additions, not the main-only tests around them.

Type of change:

  • Bug fix

Tests:

  • TaskResourceIT#testApproveColumnTag*: 4 ITs that resolve TagUpdate tasks the way the UI does. They cover a Replace within a mutually exclusive classification, a Remove with a tag added after the task, a concurrent swap, and an Add without a snapshot.
  • TaskWorkflowHandlerTest: the 5 unit tests from Fixes #35913: remove tags a resolved TagUpdate leaves out #36008.
  • Results on this branch: TaskWorkflowHandlerTest 19/19 (5 new); TaskResourceIT#testApproveColumnTag* 4/4 on mysql-elasticsearch and 4/4 on postgres-opensearch; spotless clean.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • I have added tests around the new logic.

🤖 Generated with Claude Code

Backport of #36008 (7f84d27) to 2.0, ported by hand: 2.0 has no
EntityFieldPath, so the target tags are read through TaskTagTarget and
FieldPathUtils.findField, the lookup patchFieldTags already uses.
@yan-3005
yan-3005 requested a review from a team as a code owner November 13, 2026 06:37
@yan-3005 yan-3005 added safe to test Add this label to run secure Github workflows on PRs To release Will cherry-pick this PR into the release branch labels Nov 13, 2026
@yan-3005
yan-3005 requested review from harshach and removed request for a team November 13, 2026 06:37
@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.

@gitar-bot

gitar-bot Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved 🔴 High risk

Changing approved TagUpdate resolution rewrites stored entity tags and could remove valid classifications or leave stale labels, affecting metadata integrity.

Approved TagUpdate resolution now replaces the target's tags with the approved list, so a Replace within a mutually exclusive classification and a Remove both take effect instead of being silently dropped. Tags added after the task was filed are preserved. No issues found.

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

@yan-3005
yan-3005 merged commit ed8aa8e into 2.0 Nov 13, 2026
59 of 71 checks passed
@yan-3005
yan-3005 deleted the backport/2.0/pr-36008 branch November 13, 2026 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs To release Will cherry-pick this PR into the release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants