Skip to content

Fixes #37164: Show held glossary terms when the same user approves the term again in a session - #38589

Merged
yan-3005 merged 1 commit into
mainfrom
fix/37164-approve-after-consolidated-deprecate
Nov 24, 2026
Merged

yan-3005 merged 1 commit into
mainfrom
fix/37164-approve-after-consolidated-deprecate

Conversation

@yan-3005

Copy link
Copy Markdown
Contributor

Follow-up to #38239. Fixes #37164.

Problem

Edits one user makes to a glossary term within a session are consolidated into one version, and postUpdate then gets the version from before the session as original. If the same user deprecates a term and approves it again within the session, original is Approved and updated is Approved, so postUpdate sees no status change. The labels held while the term was deprecated stay hidden until the next restart's sweep.

Fix

GlossaryTermRepository.postUpdate also treats the status as changed when the request's own incrementalChangeDescription records an entityStatus change (changesStatus). No extra query.

Tests

  • New IT GlossaryTermApprovedTaggingIT.approvingAgainInTheSameSessionShowsWhatWasHeldMeanwhile: deprecate (same admin), create a table with the term (held), approve again in the same session, expect the term shown.
    • Without the fix: fails with ConditionTimeout (the term never shows).
    • With the fix: passes.
  • GlossaryTermApprovedTaggingIT 33 / 0, GlossaryTermResourceIT 351 / 0 (23 skipped by design), unit (GlossaryTermRepository*Test, ApprovedGlossaryTermGuardTest) 33 / 0. MySQL + Elasticsearch, local.

The same fix is already in the 2.0 backport #38507. The 2.1 backport comes from the To release label.

…e term again in a session

One user's edits to a glossary term within a session are consolidated into one
version, and postUpdate then receives the version before the session as the
original. A term deprecated and approved again by the same user looked
unchanged, so the labels held while it was deprecated stayed hidden until the
next restart's sweep. postUpdate now also counts the status as changed when
the request's own change description records it.
@yan-3005
yan-3005 requested a review from a team as a code owner November 24, 2026 11:02
@yan-3005
yan-3005 requested a review from harshach November 24, 2026 11:02
@yan-3005 yan-3005 added the To release Will cherry-pick this PR into the release branch label Nov 24, 2026
Copilot AI balanced review requested due to automatic review settings November 24, 2026 11:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@gitar-bot

gitar-bot Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk

Treating request-level status changes as approvals may reveal previously held glossary labels when a term is reapproved within one session.

Postupdate now treats a glossary term as status-changed when the request's own incrementalChangeDescription records an entityStatus change, so held tags surface when the same user deprecates and re-approves within a session. 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 5dad4d9 into main Nov 24, 2026
52 checks passed
@yan-3005
yan-3005 deleted the fix/37164-approve-after-consolidated-deprecate branch November 24, 2026 11:42
@github-actions

Copy link
Copy Markdown
Contributor

🤖 Backport to 2.1 is under way. It is built from openmetadata-collate, which holds the credentials needed to open a PR here, and it will comment again with the result — nothing is needed from you unless it reports otherwise.

@github-actions

Copy link
Copy Markdown
Contributor

🤖 Backport to 2.0 is under way. It is built from openmetadata-collate, which holds the credentials needed to open a PR here, and it will comment again with the result — nothing is needed from you unless it reports otherwise.

@gh-bot-collate

Copy link
Copy Markdown

🤖 Not backported to 2.1. Claude looked at the conflict and declined to resolve it:

Backport aborted: PR #38589 onto 2.1

Source PR: #38589 — "Fixes #37164: Show held glossary terms when the same user approves the
term again in a session"
Merge commit: 5dad4d9

Why this can't be backported as-is

PR #38589 is a narrow bug fix on top of the "held/pending glossary term labels" feature: labels
applied to an asset while a glossary term is deprecated/under review are hidden, then revealed
(GlossaryTermPendingLabels.showWhenApproved) or dropped
(GlossaryTermPendingLabels.dropRejected) once the term is approved or rejected, via a
postUpdate override in GlossaryTermRepository. The bug it fixes: when one user deprecates and
then re-approves a term within the same edit session, the two edits get consolidated into a
single version, so postUpdate's original is the pre-session version and the status looks
unchanged — the fix adds a changesStatus() check against the request's own
ChangeDescription to catch that case too.

That base feature does not exist on 2.1. Checked directly on this branch:

  • GlossaryTermRepository.java on 2.1 has no postUpdate override at all (confirmed via
    git show HEAD:...GlossaryTermRepository.java | grep -i postUpdate — no match), and no
    reference anywhere in the tree to GlossaryTermPendingLabels, showWhenApproved, or
    dropRejected (grep -rn across all .java files found nothing outside the conflicted
    cherry-pick hunk itself). Only the unrelated PostCommitActionQueue utility class exists.
  • GlossaryTermApprovedTaggingIT.java on 2.1 is a real but much earlier/smaller version of the
    main file. The cherry-pick's conflict in that file spans main's lines 525–895 (the bulk of the
    file) against 2.1's much shorter equivalent — the entire "held labels" IT suite (assertHeld,
    pendingTargets, deprecatedTerm, etc.) referenced by this PR's new test
    (approvingAgainInTheSameSessionShowsWhatWasHeldMeanwhile) is absent on 2.1.

In other words, this PR patches a session-consolidation edge case in a feature whose prerequisite
plumbing (postUpdate hook, GlossaryTermPendingLabels, the held-labels IT helpers) was never
itself backported to 2.1. Applying just this fix would mean inventing that entire feature from
scratch on 2.1, which is far outside the scope of "port this change and nothing else" and risks
introducing unrelated/untested behavior on a stable branch.

Recommendation

  • If the held/pending-labels feature is wanted on 2.1, backport its originating PR(s) first
    (the ones that introduced GlossaryTermRepository.postUpdate, GlossaryTermPendingLabels, and
    the corresponding IT suite), then re-run this backport on top of that.
  • Otherwise, skip this backport — there is nothing on 2.1 for this fix to apply to.

State left behind

The cherry-pick of 5dad4d96f8c21fb359862b5d948b2e47374c063d is still in progress with unresolved
conflicts in:

  • openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/GlossaryTermApprovedTaggingIT.java
  • openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/GlossaryTermRepository.java

No files were staged or committed. git cherry-pick --abort was attempted to clean up but was
blocked by the session's destructive-action guard; whoever picks this up should run
git cherry-pick --abort to restore the tree before deciding next steps.

resolver run

@gh-bot-collate

Copy link
Copy Markdown

🤖 Not backported to 2.0. Claude looked at the conflict and declined to resolve it:

Backport aborted: PR #38589 does not apply to 2.0

Source PR

Fixes #37164: Show held glossary terms when the same user approves the term again
in a session (#38589), merge commit 5dad4d96f8c21fb359862b5d948b2e47374c063d.

Why this cannot be backported

The fix patches GlossaryTermRepository.postUpdate so that, when a term is
deprecated and then re-approved within the same edit session (so the
original/updated diff looks unchanged), the repository still notices the
status moved and re-triggers GlossaryTermPendingLabels.showWhenApproved(...)
/ dropRejected(...) — the mechanism that releases tag labels that were
held while the term was not Approved.

That "hold tags while the term is unapproved, then release them when it is
approved" feature does not exist on 2.0. 2.0 implements glossary-term
approval gating with a different, older design, ApprovedGlossaryTermGuard
(from #37689, "Only Approved glossary terms can be applied through the API"):
it rejects a write that newly applies a non-Approved glossary term
outright — see the guard's own doc comment, rejects any glossary term requested applies that is not Approved: nothing is held
(ApprovedGlossaryTermGuard.java:83). There is no pending/held tag state, no
GlossaryTermPendingLabels class, and no "show when approved" sweep anywhere
in 2.0's jdbi3 package or OpenMetadataApplication wiring:

  • GlossaryTermRepository.postUpdate on 2.0 only closes approval tasks
    (closeApprovalTask) on IN_REVIEW → APPROVED/REJECTED transitions; it never
    calls anything resembling showWhenApproved/dropRejected.
  • GlossaryTermApprovedTaggingIT.java on 2.0 has no assertHeld,
    pendingTargets, or Awaitility-based "eventually becomes visible"
    assertions that the source PR's new test (approvingAgainInTheSameSessionShowsWhatWasHeldMeanwhile)
    depends on.
  • A separate, newer port of the "hold tags, release on approval" feature
    (commit 5e0f8a27a6, "port of Fixes #37164: Hold glossary terms that are not Approved as pending until approved #38239 to 2.0") exists in this repository's
    history but is not an ancestor of 2.0 (git merge-base --is-ancestor 5e0f8a27a6 HEAD fails) — it was never actually merged into 2.0.

Since the bug this PR fixes ("held" labels staying hidden until a restart
sweep) can only occur in a design that holds labels in the first place, and
2.0 has no such design, there is nothing to adapt the fix onto. Forcing the
changesStatus(...) check into 2.0's closeApprovalTask-based
postUpdate, or copying the new test's assertHeld/pendingTargets
helpers, would reference behavior and test fixtures that don't exist on this
branch and wouldn't fix anything real here.

Recommendation

Do not backport #38589 to 2.0 on its own. If the held/pending-label feature
(#38239) is ever backported to 2.0 as a follow-up, this fix should be
re-evaluated for backport at that time.

State left in the working tree

The cherry-pick of 5dad4d96f8c21fb359862b5d948b2e47374c063d is left
in-progress with conflict markers still present in:

  • openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/GlossaryTermApprovedTaggingIT.java
  • openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/GlossaryTermRepository.java

No resolution was staged or committed.

resolver run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

To release Will cherry-pick this PR into the release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Enforce consistent glossary term tagging rules between API and UI

3 participants