Skip to content

feat(governance): request a lifecycle exit such as Deprecated from the asset's status - #37901

Open
yan-3005 wants to merge 25 commits into
mainfrom
feat/lifecycle-exits
Open

yan-3005 wants to merge 25 commits into
mainfrom
feat/lifecycle-exits

Conversation

@yan-3005

@yan-3005 yan-3005 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

No linked issue: this is the lifecycle "exits" work from the governance lifecycle feedback round, paired with the Collate lifecycle editor PR (linked below). Follow-up for the seeded Glossary Term lifecycle: open-metadata/openmetadata-collate#8611.

A lifecycle can now move an asset off its onboarding path, to a stage such as Deprecated or Archived, from any stage: automatically once the asset meets conditions, or when a user requests it, with the approvers the lifecycle names. A request is a normal task on the task framework (StatusUpdate, like TierUpdate or DescriptionUpdate), so no asset schema carries request state. On an asset whose own lifecycle offers the exit, the status badge becomes a small menu (In Review ⌄ → Deprecate). Picking it opens a dialog for the status and a reason, and the request then shows as "Deprecation requested", with View request and Withdraw request, until its approvers decide.

The PR also carries two fixes from the same round:

  • The task API leaked a change request's proposed values to any reader of the asset. A review task now carries its change-request fields only for readers who may view the request, on every read and write response, including the domain task list and the delete response.
  • The pending-changes review showed a column edit as the whole column list, with no published value. Each changed column now shows its own published and proposed value, in full.

Type of change:

  • Bug fix
  • New feature

High-level design:

  • The request is a task. ADR:2026-11-16-a-lifecycle-request-triggers-only-lifecycle-playbooks (v2) records why. New task type StatusUpdate:
    • It is decided by the seeded StatusUpdateTaskWorkflow and described by the StatusUpdate task form schema.
    • On approval, entityStatus is set from the task's newStatus, written for the approver with governance-bot as impersonator, so the lifecycle's ownership of the status holds.
    • No lifecycleRequest field on any asset, and no per-asset write-path special cases.
  • The lifecycle governs it (StatusUpdateTasks):
    • Creating a request requires a stage the asset's owning lifecycle offers on request, refuses a second open request on the asset, and assigns it to the approvers the exit names: owners, reviewers or named users, with admins when no one but the requester is left.
    • Approving re-checks that the stage is still offered.
    • A resolution cannot change the requested status: the approve form shows it read-only, and the server refuses a changed one.
    • Withdrawing closes the task and ends its run.
  • Exits and onboarding no longer interfere (LifecycleExitRuns). Whenever the asset moves to one of its lifecycle's exit stages, by an approved request or an automatic exit, the lifecycle's open approval runs on it end and its tasks for other stages close. A request and an onboarding approval belong to different workflows, so neither replaces the other.
  • What is offered (ADR:2026-11-16-requestable-stages-are-read-per-entity): GET /v1/metadata/types/lifecycleStages/{entityType}/{id}/requestableStages is backed by EntityRepository.getRequestableStages, the same check a request runs, so what is offered is what is accepted.
  • Schema:
    • lifecycleConfiguration.exits (stage, trigger, conditions, and approval for on-request exits).
    • task.json adds StatusUpdate.
    • No migration: the new task workflow and form schema are seed data.
  • UI:
    • useLifecycleRequests reads the offered stages and the open StatusUpdate task.
    • EntityStageBadge opens StatusRequestModal.
    • The pending badge offers View and Withdraw; Withdraw is shown to the requester and admins.
    • The inbox renders the requested and current status with the reason.

Tests:

Use cases covered

  • A lifecycle with an on-request Deprecate exit: the asset offers Deprecate. A request with a reason becomes a task for its owner; the owner approves, the asset becomes Deprecated, and its open onboarding approval ends.
  • The owner rejects: the stage stays and the onboarding approval stays open.
  • A stage the lifecycle does not offer is refused (400). A second open request is refused (400). Changing the requested status on resolve is refused (400).
  • Withdrawing a request lets it be raised again.
  • A read-only user reading a review task, the entity's task list, or the domain's task list does not see the proposed values.
  • The pending-changes review shows column edits column by column.

Unit tests

  • Affected unit run on the final code: 318 run, 0 failures (TaskWorkflowLifecycleResolverTest, TaskFormExecutionResolverTest, TaskTargetOperationsTest, TaskResourceTest, WorkflowEventConsumerTest, EntityStatusWorkflowsTest, CreateTaskTest, FilterEntityImplTest, WorkflowTriggerFiltersTest, MetadataCollectionServiceTest, ChangeRequestVisibilityTest, RdfOntologyContractTest).
  • Jest: EntityStatusBadge suites (badge, dialog, pending menu, useLifecycleRequests) 36 run, 0 failures; PendingChanges 32 run, 0 failures.
  • Coverage: not measured.

Backend integration tests

  • WorkflowDefinitionResourceIT 224–230 (approve ends onboarding approval, reject keeps it, unoffered stage, duplicate request, requestable stages per entity, withdraw, decided as requested): 7 run, 0 failures on MySQL + Elasticsearch.
  • ChangeRequestResourceIT, including the new domain task list redaction test: 13 run, 0 failures.

Playwright (UI) tests

  • playwright/e2e/Features/Workflows/LifecycleRequest.spec.ts:
    • Request with a reason, a pending badge, and owner approval give Deprecated.
    • A domain whose lifecycle offers no exit shows no chip.
    • Local result against a live server built from this branch: 5 run (2 tests + setup/teardown), 0 failures.
  • The broader impacted specs run in PR CI.

Manual testing performed

Live: this branch's server (MySQL + Elasticsearch), the Collate UI from the companion PR, fresh database, seeded sample data. Admin, and Ana Lopez as owner.

  1. Domain Lifecycle from its template; added "Deprecated, when a user requests it, Owners approve"; published.
  2. Finance: status chip → Deprecate → dialog with the reason → Submit → "Deprecation requested", with View request and Withdraw request.
  3. As Ana: the Finance task "Request to update status for Finance" shows Requested Status Deprecated and the reason; Approve opens the form with the request read-only; Ok → Finance is Deprecated.
  4. Marketing: requested, then withdrew; the Deprecate chip is back.

UI screenshots:

Status chip menu Request dialog Request pending
View or withdraw Owner's task Owner approves
Deprecated Withdrawn, chip back

Requesting Deprecate from the status chip, with a reason:

Request

The owner approves the status update task:

Owner approves

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation> (no linked issue)
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed (new task type and an optional exit field; the task workflow and form schema are seed data).
  • For a UI feature or feature task: I embedded GitHub-hosted screenshots above.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • Self-review: the review round (Pere, Adrià) is addressed in ceef2e26e4a. The request is a task, not a field. All 6 findings are fixed: exit and onboarding interference, the rejected-exit review, the stuck and duplicated requests (gone with the field), automatic exits from another exit stage, and the domain list and delete redaction. Two gaps found while testing live are fixed too: the pending-request lookup used an entity link where the task list takes an FQN, and an approver could change the requested status.
  • Decision check: ADR:2026-11-16-a-lifecycle-request-triggers-only-lifecycle-playbooks (v2), ADR:2026-11-16-requestable-stages-are-read-per-entity (v2).

Companion: open-metadata/openmetadata-collate#8601 (the lifecycle editor Exits section and the seeded Glossary Term lifecycle).

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 0/5

Do not merge until the approval bypass and request-lifecycle failures are fixed.

Findings

  1. P1 Security Owners can replace approvers ▶
  2. P1 Team-only requests get stuck ▶
  3. P1 Old approvals survive status changes ▶
  4. P1 Duplicate requests can stay open ▶

Summary

Adds lifecycle status requests through tasks, with per-asset offers, approvals, withdrawal, and status-badge controls. It also adds transition rules and hides unreadable change-request values in domain task lists and delete responses.

  • Assets can request lifecycle moves with an approval task.
  • Change-request tasks hide proposed values from readers who cannot view the request.

yan-3005 kept the batching tests because call counts are the behavior under test; Greptile withdrew that finding.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Asset status menu] --> B[StatusUpdate task]
  B --> C[Choose lifecycle approvers]
  C --> D{Decision}
  D -->|Approve| E[Update asset status]
  E --> F[Close old lifecycle work]
  E --> G[Restart owning lifecycle]
  D -->|Reject| H[Keep current status]
  B -->|Withdraw| I[Close task and end its run]
Loading

Reviews (10) · Last reviewed commit: "fix(lifecycle): status requests are deci..." · Reviewed by Greptile


UI polish screenshots (from #38702, follow-up #38720): before and after, light and dark

Merged into this branch from #38702. Each image is a 2×2 grid. Columns are Before and After. Rows are Light (classic mode) and Dark (AI mode).

Workflows page tabs
o1-workflows-tabs

Pending request menu
o2-request-menu

View Request → Activity Feeds & Tasks, request selected (before: standalone task page)
o3-view-request

Withdraw asks first (before: withdrew immediately)
o4-withdraw

…who may view the request

A task read or task list returned the payload of a change request's review
task to any reader of the asset, including the proposed values. The task now
keeps its change-request fields, and their change history, for readers who may
view the request: admins, the asset's owners and reviewers, the requester, and
assignees of its review task.
…view

The review of pending changes showed a column change as the whole column list
with no published value. Each changed column now shows its own published and
proposed value, as the request's change preview does.
…e asset's status

A lifecycle configuration takes exits: stages such as Deprecated or Archived
it moves an asset to from any stage, automatically once conditions hold or
when a user requests it. A user requests one through the entity's new
lifecycleRequest field, offered from the stage badge of the assets whose own
lifecycle takes that request. The request reaches only the lifecycle playbooks
that take requests, is checked against the lifecycle owning the asset, and
survives CSV imports, session consolidation and workflow writes.
… requests in FilterEntityImplTest

The trigger's field filter keeps its signature; a change carrying a lifecycle
request also passes when the workflow takes requests, and only then looks the
workflow up.
@yan-3005 yan-3005 added the To release Will cherry-pick this PR into the release branch label Nov 16, 2026
…fecycle, declare lifecycleRequest

- Comment, resolve, close, PATCH and PUT responses carry a review task's
  change-request fields only for readers who may view the request, as reads do.
- A lifecycle request fires only the lifecycle that owns the entity's stage.
- om:lifecycleRequest is declared in the ontology.
- The unoffered-stage IT asserts the 400, a 404 and a PUT-keeps-request IT are
  added, the no-chip Playwright check waits for the offer, and the unused
  fieldTriggers overload and the no-op gate entry are removed.
…n redacting

A page of review tasks loads its change requests with one findByIds query and
loads the review tasks of requests the caller neither made nor owns in one
batch, instead of one request lookup and one task load per task.
@yan-3005
yan-3005 marked this pull request as ready for review November 16, 2026 15:32
@yan-3005
yan-3005 requested review from a team as code owners November 16, 2026 15:32
@yan-3005
yan-3005 requested review from chirag-madlani and sonika-shah and a balanced review from Copilot November 16, 2026 15:32

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.

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

…alues in the column review

A lifecycle request is validated against the stored entity read with every field,
as the requestable-stages endpoint reads it, so a stage the asset offers is never
refused on write. The pending-changes review shows column values in full; the
task view keeps its short preview.
Copilot AI balanced review requested due to automatic review settings November 16, 2026 15:44

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.

Copilot AI balanced review requested due to automatic review settings November 16, 2026 15:54

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.

Copilot AI balanced review requested due to automatic review settings November 16, 2026 16:00

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.

Copilot AI balanced review requested due to automatic review settings November 16, 2026 16:29
Comment on lines +108 to +111
public static void requireUneditedRequest(Task original, Task patched) {
if (original.getType() == TaskEntityType.StatusUpdate
&& (!Objects.equals(original.getAbout(), patched.getAbout())
|| !RequestedMove.of(original).equals(RequestedMove.of(patched)))) {

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.

P1 security Owners can replace approvers. requireUneditedRequest preserves the requested move but leaves assignees editable. An asset owner who is not a required approver can replace the assignees through PATCH or bulk Assign, then have the replacement approve the request. Resolution trusts the edited list rather than the lifecycle's chosen approvers.

Protect the approver list on both edit paths, or check it against the lifecycle before accepting a decision.

How this was verified: Asset owners may reassign tasks, and status-request resolution checks membership only in the task's current assignees.

Knowledge Base Used: Governance workflow automation

Comment on lines +195 to +198
List<EntityReference> others = selectApprovers(approval, entity, requester);
if (others.isEmpty()) {
others = withoutRequester(admins(), requester);
}

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.

P1 Team-only requests get stuck. When an approving team's only member raises a request, withoutRequester retains the team. That leaves others nonempty, so the administrator fallback never runs. The requester cannot resolve their own task, and other administrators fail the assigned-person check. The request needs manual reassignment or withdrawal instead of reaching an independent approver.

Expand teams and remove the requester before deciding whether to assign administrators.

Knowledge Base Used: Governance workflow automation

Comment on lines +43 to +48
public static void endRuns(EntityInterface<?> entity, String entityType, String from, String to) {
EntityStatusWorkflows.ACTIVE
.owningStageOf(entityType, entity)
.flatMap(EntityStatusWorkflows::playbookWithTransitions)
.filter(playbook -> EntityStatusWorkflows.makesTransition(playbook, from, to))
.ifPresent(playbook -> endRuns(entity, to, playbook));

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.

P1 Old approvals survive status changes. endRuns chooses the owning lifecycle from the partial entity passed by the status PATCH. For example, a domain lifecycle that excludes assets with missing childrenCount offers and accepts a request using a full read. The PATCH clears that field, so this lookup finds no lifecycle and leaves its old onboarding approvals open after the move.

Load the same complete asset fields before choosing which lifecycle's runs to end.

Knowledge Base Used:

…erge

# Conflicts:
#	openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TaskRepository.java
Copilot AI balanced review requested due to automatic review settings November 24, 2026 06:21

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.

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

UI browser tests

Ran: 133 of 135 test files execute the changed code

Result: ✅ 1096 passed · 154 skipped

Changed code executed by these browser tests: 51 / 146 lines (35%)

File Changed lines Executed %
src/components/Entity/EntityStatusBadge/PendingRequestMenu.tsx 17 1 6%
src/components/ActivityFeed/ActivityFeedList/TaskListV1.component.tsx 32 2 6%
src/components/Entity/EntityStatusBadge/StatusRequestModal.tsx 16 1 6%
src/components/Entity/EntityStatusBadge/EntityStageBadge.tsx 18 3 17%
src/components/Entity/EntityStatusBadge/EntityStageBadge.utils.ts 3 1 33%
src/components/discovery/personal-space/InboxPage/taskDetail.utils.ts 3 1 33%
src/components/Entity/EntityStatusBadge/StagePill.tsx 2 1 50%
src/utils/governance/lifecycle/LifecycleRequest.utils.ts 2 1 50%
src/hooks/useLifecycleRequests.ts 40 27 68%
src/components/Entity/EntityStatusBadge/EntityStageBadge.constants.ts 7 7 100%
src/components/Entity/EntityStatusBadge/EntityStatusBadge.component.tsx 2 2 100%
src/components/Metric/MetricDetails/MetricDetails.tsx 1 1 100%
src/rest/metadataTypeAPI.ts 3 3 100%
Changed files no browser test loads
  • src/components/DataAssets/DataAssetsHeader/DataAssetsHeader.interface.ts
  • src/components/DataProducts/DataProductsDetailsPage/DataProductsDetailsPage.component.tsx
  • src/components/Domain/DomainDetails/DomainDetails.component.tsx
  • src/components/Glossary/GlossaryHeader/GlossaryHeader.component.tsx
  • src/components/Modals/ConfirmationModal/ConfirmationModal.interface.ts
  • src/pages/WorkflowDefinitions/WorkflowsPage/WorkflowList.tsx

The Metric browser tests merged from main render the entity header, which now
asks for the stages a user can request. Give the shared MSW setup a handler
returning none, and apply the organize-imports order ui-checkstyle expects.
Copilot AI balanced review requested due to automatic review settings November 24, 2026 07:00

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.

… first, Workflows tabs (#38702)

* UI polish: lifecycle request badge, withdraw confirm, workflow tabs

- View Request opens the asset's Activity Feeds & Tasks tab with the
  request selected (classic and AI mode), instead of the standalone task page
- Withdraw request asks for confirmation in a 400px modal
- ConfirmationModal takes an optional width (default unchanged, 520)
- Pending-request menu moved into PendingRequestMenu
- Workflows page filter uses core Tabs instead of ButtonGroup
- New locale keys in all 21 languages

* View Request opens a request that is not on the loaded page of tasks
Copilot AI balanced review requested due to automatic review settings November 25, 2026 14:55

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.

Copilot AI balanced review requested due to automatic review settings November 25, 2026 15:25

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.

…s its run as cancelled

- A raised status request's assignees can be changed only by an admin, on
  PATCH and bulk Assign, so an asset owner cannot make themselves its approver.
- closeTask is a plain close again: a user's withdrawal ends the run through
  closeTaskAndCancelWorkflowRun, recorded as CANCELLED.
- ADR v5 records that a raised request is frozen and decided only by its
  assignees.
- Regenerated the Playwright impact map for PendingRequestMenu.
Copilot AI balanced review requested due to automatic review settings November 26, 2026 06:17

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.

Copilot AI balanced review requested due to automatic review settings November 26, 2026 06:47

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.

Copilot AI balanced review requested due to automatic review settings November 26, 2026 06:59

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 26, 2026

Copy link
Copy Markdown

Responding to your feedback

Code Review ✅ Approved 🔴 High risk 9 closed / 9 findings

Lifecycle approval rules authorize persistent asset-status transitions; an incorrect decision could retire or misclassify governed assets.

Adds lifecycle status requests as StatusUpdate tasks, letting assets move to exit stages such as Deprecated with approvals, withdrawal, and a status-badge menu. Resolved items include per-task redaction overhead for non-admins, approver resolution against partially loaded entities, superseding of approvals on stage change, reassignment of requests by owners, withdrawn runs ending as cancelled, and recording the lifecycle restart retry budget in the ADR. No open findings remain.

✅ 9 closed
✅ Performance: Task list redaction runs per-task DB lookups (N+1) for non-admins

📄 openmetadata-service/src/main/java/org/openmetadata/service/governance/approval/ChangeRequestVisibility.java:111-125 📄 openmetadata-service/src/main/java/org/openmetadata/service/resources/tasks/TaskResource.java:375-379
redactTasks is now called on every task list page (readablePage), including /tasks, my-assigned, my-created and the others. For a non-admin, each task that reviews a change request costs: one changeRequestDAO().findById, one seesAll call that loads the entity's owners and reviewers (cached only per entity), and a reviewableTasks call that runs Entity.getEntities again for a single task. That last task is usually the very task already in the page. This only happens when payload is requested, but the UI task views ask for it. So a page of N review tasks makes about 3N extra queries on a hot list path.

Fix: batch it. Collect the request ids from the page and load them in one DAO call. Compute seesAll per distinct entity. Call reviewableTasks once with all the requests that are still undecided, or better, run mayResolve on the Task objects already in the page instead of reloading them.

✅ Quality: Stage-badge trigger restyles core Button padding/shadow/background

📄 openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityStatusBadge/EntityStageBadge.constants.ts:22-24 📄 openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityStatusBadge/EntityStageBadge.tsx:106-115
STAGE_TRIGGER_CLASS is passed as className to the core Button. It sets tw:p-0 tw:shadow-none tw:bg-transparent tw:after:outline-0, which overrides the button's padding, shadow, background and its ::after border from the call site. The rule in §4 (ADR:2026-10-11-migrated-antd-components-adopt-core-styling) forbids caller-side padding, shadow and background on core components: a gap the core API can't express should be fixed in core, as a variant. The incident ChipTrigger does the same thing, so this copies a pattern that already breaks the rule rather than adding a second place that does. Either add a core 'bare/chip' Button variant and use it in both places, or record an amendment for this exception.

✅ Bug: Approvers resolved against a partially loaded entity, unlike the offer

📄 openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/StatusUpdateTasks.java:57-65 📄 openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/StatusUpdateTasks.java:106-111 📄 openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/StatusUpdateTasks.java:141-155 📄 openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/EntityStatusWorkflows.java:72-78
prepare loads the asset with only owners/reviewers (approvalTarget), then approvers → onRequestExit calls owningStageOf(entityType, entity). That method picks the playbook by evaluating each workflow's entity filter (appliesTo) against this stripped entity. requireOffered checks the stage through getRequestableStages(entity.getId()), which reloads the entity with every field, as ADR:2026-11-16-requestable-stages-are-read-per-entity requires. When a lifecycle's filter reads any other field (tags, domains, glossary, and so on), the offer check passes, but the approver lookup either finds no owning playbook or picks a different one. The .orElse(OWNERS) fallback then silently replaces the exit's configured approvers (reviewers, named candidates) with the owners. The stage and the approvers need to come from the same entity read. One way is to resolve the owning playbook from a fully loaded entity (the same get(null, id, getFields("*")) read the offer uses) and use only owners/reviewers from it to build the assignee list.

✅ Bug: Any-stage approval is not superseded once the asset changes stage

📄 openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/elements/nodes/userTask/CreateTask.java:503 📄 openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/elements/nodes/userTask/CreateTask.java:808 📄 openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/elements/nodes/userTask/CreateTask.java:822 📄 openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/elements/nodes/userTask/CreateTask.java:884-897 📄 openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/elements/nodes/userTask/CreateTask.java:1228-1239
withCurrentStage fills in a from-any-stage move's stage with the asset's stage at the moment the approval is created, and decidesSameMove then needs stage and targetStage to both match before it supersedes. Say an automatic "any stage → Deprecated" transition with approvers opens an approval while the asset is Draft (stored stage=Draft). The onboarding path then moves the asset to In Review. That is not a lifecycle transition, so LifecycleTransitionRuns.endRuns never closes the approval. On the next run the new approval is In Review→Deprecated, decidesSameMove returns false, and the old Draft→Deprecated approval stays open next to it. The same thing happens to prior approvals whose payload has no lifecycleMove (for example, ones created before this change): a new approval that gates a move no longer replaces them. Fix: when either side came from a stage-less move, compare only targetStage. The overlap rule already allows just one transition per (from, to) pair, so matching on the target alone is safe. Also treat a prior with no move as supersedable.

✅ Security: Entity owner can reassign a status request to themselves and approve it

📄 openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/StatusUpdateTasks.java:108-115 📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TaskRepository.java:1146-1160 📄 openmetadata-service/src/main/java/org/openmetadata/service/resources/tasks/TaskResource.java:1420
With this commit a StatusUpdate task is decided only by its assignees (isWorkflowApproval → requireAssigneeForWorkflowApproval), and the check that the resolver can edit the underlying asset is skipped. The task's assignees are still editable, though. PATCH on /assignees maps to ReassignTask (TaskResource.java:186-187), and OrganizationPolicy's isOwner() rule grants that to the owners of the target asset through TaskResourceContext. requireUneditedRequest freezes about, newStatus and currentStatus but leaves assignees alone.

So in test_aStatusRequestIsDecidedOnlyByTheApproversItsTransitionNames, the owner who gets a 403 on resolve can PATCH themselves into assignees and then approve the request. That gets around the transition's named approvers, which the javadoc says are fixed ("its approvers were chosen for that move"). The filer-deny on ResolveTask only stops the requester; any other owner can do this.

Fix: also refuse assignee changes on an open StatusUpdate task in requireUneditedRequest, unless the caller is an admin. Add an IT case where the owner PATCHes assignees and then tries to resolve.

...and 4 more closed from earlier reviews

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

This branch has not been deployed

No deployments
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.

4 participants