Skip to content

fix(governance): keep the workflow's own status move out of approval task previews - #35972

Merged
yan-3005 merged 2 commits into
mainfrom
fix/approval-preview-workflow-status
Oct 22, 2026
Merged

yan-3005 merged 2 commits into
mainfrom
fix/approval-preview-workflow-status

Conversation

@yan-3005

@yan-3005 yan-3005 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

A newly created glossary term's approval task showed Proposed Changes: Entity Status Draft → In Review and nothing else.

GlossaryApprovalWorkflow runs SetGlossaryTermStatusToInReview right before ApproveGlossaryTerm, so when the task is opened the entity's latest change description is that workflow write. ChangePreviewUtils.buildProposedChangesPayload builds the preview from it, and the reviewer sees the workflow's own bookkeeping as the requester's proposal.

On the path that reads the entity's change description (no change-request revision), the preview now drops entityStatus, including any carried over from a prior task's payload. When the task reviews a change request, the pending revision is still shown as-is, because a status edit there is something the requester asked for.

Lifecycle approvals already avoid this by showing a lifecycleMove instead of field diffs (CreateTask.approvalPayload). This covers the non-lifecycle approval workflows.

Trade-off: if an approval workflow that does not hold changes (no change request) fires on a user's own status edit, that status change no longer appears in the preview.

Type of change:

  • Bug fix

High-level design:

N/A — small change.

Tests:

Use cases covered

  • New glossary term with a reviewer: the approval task has no proposedChanges when the only change is the workflow's Draft → In Review.
  • Edit with a status move in the same change description: only the edited field is listed, and a stale entityStatus entry carried from a prior task is dropped.
  • Change-request revision with a status edit: entityStatus is still listed.

Unit tests

  • I added unit tests for the new/changed logic.
  • Files added/updated: ChangePreviewUtilsTest (3 new tests), CreateTaskLifecycleMoveTest (its non-lifecycle case asserted the status chip; it now uses a description edit).
  • ChangePreviewUtilsTest + CreateTaskLifecycleMoveTest: 51 run, 0 failures. Without the fix, the two new entity-path tests fail (expected: <[tags]> but was: <[entityStatus, tags]>, and a non-empty preview).

Backend integration tests

  • Not applicable (no backend API changes).

Playwright (UI) tests

  • Not applicable (no UI changes).

Manual testing performed

Reproduced the bug on a local server (before this fix): a glossary with a reviewer, a term created by a non-reviewer. The term went to v0.2 with incrementalChangeDescription = entityStatus Draft → In Review (impersonated by governance-bot), and the GlossaryTermApprovalWorkflow task payload was {"proposedChanges":{"entityStatus":{"added":["In Review"],"removed":["Draft"]}}}. The result was the same with the lifecycle and change-approval workflows suspended.

Verified the fix on the same server, restarted with the fixed ChangePreviewUtils (that file was otherwise identical to main in the running build) and all glossary workflows active:

Task Case Proposed Changes
Gross Margin new term, after the fix none (payload {})
Customer Lifetime Value tag added to an In Review term, after the fix Tags: PII.Sensitive only
Net Revenue Retention new term, created before the fix Entity Status Draft → In Review

The terms are in the same state in every case (v0.2, last change entityStatus Draft → In Review by governance-bot); only the task preview differs. Payloads already stored on open tasks are not rewritten.

After the fix, new term: no Proposed Changes section.

After the fix: new term's approval task has no Proposed Changes

After the fix, tag edit: only the tag is listed.

After the fix: tag edit lists only the tag

Before the fix, new term: the workflow's status move shown as the proposal.

Before the fix: Entity Status Draft to In Review shown as the proposal

UI screen recording:

Not applicable — backend-only change to the task payload.

Checklist:

  • I have read the CONTRIBUTING document.
  • I have added tests around the new logic.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

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

Summary

The PR removes entityStatus from approval previews built from an entity's saved changes, including entries carried from an earlier task.

  • Approval previews leave workflow-made status moves out of proposed edits.

No new actionable issues were found.

Reviews (2) · Last reviewed commit: "docs(decisions): record that approval pr..." · Reviewed by Greptile

…task previews

The glossary approval workflow sets a new term to In Review right before it
opens the approval task, so the task's Proposed Changes listed only
"Entity Status: Draft -> In Review" instead of anything the requester did.

The preview built from the entity's own change description now leaves out
entityStatus. A change request's pending revision is unaffected, since a
status edit there is something the requester asked for.
@yan-3005
yan-3005 requested a review from a team as a code owner October 22, 2026 12:45
@yan-3005
yan-3005 requested review from harshach and a balanced review from Copilot October 22, 2026 12:45

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 reached their quota limit.

@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.

@github-actions github-actions Bot added backend safe to test Add this label to run secure Github workflows on PRs labels Oct 22, 2026
…n status move

Supersedes Decision 3 of ADR:2026-10-15-a-lifecycle-approval-names-the-stage-move-it-gates
and records the trade-off for approvals that do not hold changes.
Copilot AI balanced review requested due to automatic review settings October 22, 2026 14:11

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 reached their quota limit.

@gitar-bot

gitar-bot Bot commented Oct 22, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 1 closed / 1 findings

🟡 Medium risk · Filtering entityStatus from non-change-request approval previews could hide a user's status edit from reviewers; change-request revisions remain visible.

Keeps the workflow's own Draft → In Review status move out of approval task previews for non-lifecycle workflows, so new glossary terms no longer show a spurious Proposed Changes section. Change-request revisions still show status edits. Resolved the finding that contradicted the accepted ADR on status in non-lifecycle approvals; no open issues remain.

✅ 1 closed
✅ Quality: Contradicts Accepted ADR: non-lifecycle approvals no longer list status

📄 openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/util/ChangePreviewUtils.java:246-250 📄 openmetadata-service/src/test/java/org/openmetadata/service/governance/workflows/elements/nodes/userTask/CreateTaskLifecycleMoveTest.java:55-63
ADR:2026-10-15-a-lifecycle-approval-names-the-stage-move-it-gates (Accepted) says in Decision 3: "Approvals without it [lifecycleMove] — glossary approval, data access requests, change requests — keep listing proposed changes exactly as before." This PR changes that for every non-change-request approval: buildProposedChangesPayload now always drops entityStatus, including one carried in a prior task's payload. The PR also rewrites the non-lifecycle case in CreateTaskLifecycleMoveTest, which the ADR names as its guard and which asserted the entityStatus chip. So the guard test was edited to match the new behavior while the record it protects still says the old rule.

The fix is not the problem. A superseding record is needed, and the old record's Status should name it. The new record would say something like: "On approval tasks that read the entity's change description (no change-request revision), proposedChanges never lists entityStatus, because the workflow writes that field itself. A change-request revision still lists a status edit, because the requester asked for it." It should also record the trade-off from the PR description: "if an approval workflow that does not hold changes (no change request) fires on a user's own status edit, that status change no longer appears in the preview." Right now that sentence lives only in the PR description, and the repo squash-merges, so it will be lost.

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 enabled auto-merge October 22, 2026 14:16
@yan-3005
yan-3005 added this pull request to the merge queue Oct 22, 2026
Merged via the queue into main with commit 0889505 Oct 22, 2026
81 of 85 checks passed
@yan-3005
yan-3005 deleted the fix/approval-preview-workflow-status branch October 22, 2026 18:07
@yan-3005 yan-3005 self-assigned this Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants