Skip to content

feat(governance): hold approval gated changes off the entity until approved (#4673) - #32038

Merged
yan-3005 merged 92 commits into
mainfrom
feature/approval-workflow-pending-changes
Oct 15, 2026
Merged

yan-3005 merged 92 commits into
mainfrom
feature/approval-workflow-pending-changes

Conversation

@yan-3005

@yan-3005 yan-3005 commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

What changed

Adds approval-gated change requests to governance workflows. When a workflow opts in (by carrying a resolvePendingChangeTask hook), a human edit that touches a gated field on a governed entity is not written to the entity. The whole request is stored as a durable, revisioned change request, the entity is left untouched (no version bump, no ChangeEvent, nothing indexed), and a review task is opened. The change is published only when an eligible reviewer, who is not the requester, approves that exact revision; on rejection it is discarded. Consumers keep seeing the published value until then; the reviewer sees exactly what is proposed.

Resolves https://github.com/open-metadata/openmetadata-collate/issues/4673

Why

The existing governance workflows react to a change after it is already persisted. There was no way to require approval before a change becomes visible: a tag, a description, or a status edit landed immediately, got indexed, and fired downstream events, and only then went through review. This PR moves the gate to the edit itself so an unapproved change never reaches search, lineage, or notifications.

The flow

User edits an entity (PATCH / PUT / CSV import)
        │
        ▼
EntityRepository ──► ApprovalGate.admit
        │                    │
        │   no gated field   │  a gated field changed (field + entity filter match a hook workflow)
        ▼   (or bot change)  ▼
  write as today     ChangeRequestService.submit  (one DB transaction)
                       - change_request (one active per entity + requester)
                       - change_revision (immutable ops with their base values)
                       - entity NOT written
                             │
                             ▼
                     200 + X-OpenMetadata-Pending-Change: <changeRequestId>
                             │  after commit
                             ▼
                     ChangeRequestDelivery ──► "<entityType>-changeRequestSubmitted" signal
                             │                 (claim/lease, retried; recovery scheduler)
                             ▼
                     only the reviewing hook workflow runs ──► approval Task (linked to the revision)
                             │
                ┌────────────┴─────────────┐
             approve                     reject
   (decision recorded in the catalog     (decision recorded)
    before Flowable moves on)                 │
                ▼                             ▼
   ResolvePendingChange COMMIT      ResolvePendingChange DISCARD
   ChangeApplyService: lock entity,  request REJECTED, entity unchanged
   compare with base values, apply
   as the requester (normal patch,
   real ChangeEvent, change_application)

Architecture

Component Responsibility
ApprovalGate At edit time: resolve the gating rules for the entity type, decide whether the request touches a gated field, and hand the whole request to ChangeRequestService. Custom properties are matched per property (extension.<name>). Bot changes are never held. Fails closed: if rules cannot be resolved the write is refused with 503 and nothing is published.
MutationPlanner / MutationOps Turns a request into normalized operations (set / add / remove) that record the base value they were based on, plus a digest. Detects drift and splits conflicts at apply.
ChangeRequestService Submits, revises (a second edit by the same requester becomes revision N+1 and supersedes N), withdraws, cancels and finishes change requests. Lock order: entity → request → revision.
ChangeRequestDelivery / ChangeRequestRecoveryScheduler Post-commit delivery of the dedicated signal to the reviewing workflow with claim/lease and retries; the scheduler redelivers anything left undelivered.
ApprovalDecisionService Records reviewer decisions in the catalog before Flowable completes the task. Refuses the requester (admins included) and impersonated approvals; a decision on a superseded revision is refused.
ChangeApplyService On approval, re-reads the entity, drops or conflicts drifted operations, and applies the rest through the normal repository patch as the requester, writing a change_application row and a normal ChangeEvent.
GovernanceApprovalRegistry Resolves field-gating rules from deployed workflows that carry the hook, in a snapshot validated against the workflow-definition epoch on every call, so a workflow changed on another node gates on the next write.
FilterEntityImpl / EventBasedEntityTrigger Hook workflows start only from the change-request signal; every other hook workflow on the entity type ignores the run.
ResolvePendingChangeImpl The hook node: commit applies the approved revision, discard rejects the request.
CreateTask / TaskWorkflowHandler / TaskResource Links the approval task to the change request and revision (the task payload carries changeRequestRevision), and routes resolve through the decision service.
WorkflowEventConsumer.isBotChange Single rule shared by the gate and the event consumer: a change whose updatedBy user is a bot is excluded from all workflows.
ChangeRequestResource `GET /v1/changeRequests?entityId=
WorkflowDefinitionRepository Validates a hook workflow at create/update time, and cancels its pending requests when it is unhooked or deleted.

Data model

New tables in bootstrap/sql/migrations/native/2.1.0 (MySQL + Postgres). The earlier pending_approval_change table from this PR is removed; it never shipped in a release.

Table Holds
change_request One request per (entity, requester) while active (unique activeInterceptKey), status, reviewing workflow, linked task, delivery state
change_revision Immutable revisions: the operations with their base values, the base entity version, and a digest
approval_decision Who approved or rejected which revision, and when (one per reviewer per revision)
change_application What was applied on approval, including operations dropped because they had drifted

Nothing pending is stored on the entity row, its version history, or the search index.

Per requester change requests

Scenario Behaviour
Two users edit the same entity Two independent change requests and tasks. Approving both on the same gated field applies the first; the second becomes CONFLICTED instead of overwriting it.
Same user edits again before review The same change request gets a new revision containing everything so far; the old revision's task closes, a fresh task opens, and approvals never carry over.
Mixed request If any gated field changes, the whole request is held, whatever other fields it touches, and is applied together on approval. A request touching only non-gated fields publishes as today.
Drift while waiting A gated field changed by someone else since submit → CONFLICTED, nothing applied. A non-gated field changed since submit → that operation is dropped and the newer value kept (recorded in change_application).
Task attribution The task's creator is the editor who made the change; the applied version is recorded as the requester's edit.

Mutual exclusivity

Two mutually exclusive tags in one gated edit are rejected up front (400), as the entity updater would reject them. At apply, the change goes through the normal repository patch, so the repository's own tag validation applies against the current entity.

Entity agnostic

The gate works on EntityInterface through GovernanceApprovalRegistry.gatingRules(entityType), so any entity type with a hook workflow is gated the same way. Only the approval task's assignees depend on the entity (reviewers or owners, per the approval node's config). Several hook workflows may target one entity type (usually scoped by filter); a single request touching fields gated by two different workflows is rejected with 400 so each change has exactly one reviewing workflow.

Validation and safety

  • A hook workflow must use an eventBasedEntity trigger on Updated, use a JSON Logic filter, and resolve the request (commit or discard) on every terminal path. Otherwise it is rejected at create time, so a request can never stay pending forever.
  • Clearing a gated scalar field is held for review. An omitted collection in a PUT (owners, tags) is merged, not treated as a removal.
  • Bot changes (updatedBy is a bot user) are excluded from workflows: never held, and reactive event workflows do not start for them. A bot impersonating a user is gated as that user. Workflow automation writes as the acting user with governance-bot as impersonator and is exempt, as before.
  • Fails closed: if gating rules cannot be resolved or staging fails, the write is refused (503) and nothing is published.
  • Deleting the entity, or deleting or unhooking the reviewing workflow, cancels its pending requests and closes their tasks.

Response contract

A held PUT or PATCH returns 202 Accepted with the published (unchanged) entity, its ETag, X-OpenMetadata-Pending-Change: <changeRequestId> and X-OpenMetadata-Change: entityNoChange; an edit that publishes still returns 200. Bulk asset writes (tag, glossary term, domain and data product; add and remove) hold each gated asset as its own change request and report them with X-OpenMetadata-Pending-Change-Count: N: 202 when every asset was held, 200 otherwise (the async tag job start carries the count; dry runs submit nothing). CSV import reports held rows as Pending approval: change request <id> and counts them in numberOfRowsPendingApproval (also on dry runs, without submitting).

Review from creation

A hook workflow whose trigger also lists Created reviews an asset from its creation: until the asset is Approved its edits publish and join one review task (the workflow's own status steps move it, e.g. In Review → Approved or Rejected; the next edit of a Rejected asset starts a new review), and once it is Approved its edits are held as change requests while it keeps its status. A hook workflow that triggers only on Updated holds every gated edit. Saving a Created hook workflow requires a step that sets the status to Approved.

Schema

  • resolvePendingChangeTask.json defines the hook node: config.action is an enum of commit / discard.
  • New governance/changeRequest/* schemas (changeRequest, changeRevision, mutationOp, approvalDecision, changeApplication) and api/governance/withdrawChangeRequest.
  • resolveTask gains an optional changeRequestRevision; csvImportResult gains numberOfRowsPendingApproval.

UI

  • New ResolvePendingChangeForm and workflow builder wiring for the resolvePendingChangeTask node.
  • A pending-change indicator on the asset, glossary, domain and data product headers, backed by /v1/changeRequests, and a toast when a save is held for approval (pendingChangeInterceptor).
  • Two upstream fixes to the workflow builder that this feature depends on: the event trigger exclude filter now emits JsonLogic (which the backend evaluates) instead of an Elasticsearch query, and clearing that filter now persists instead of retaining the previous value.

Testing

Level Coverage
Integration (WorkflowDefinitionResourceIT) Approved change applied as the requester; rejection discarded; requester cannot approve their own request; second edit revises the same request; held rename applied whole; gated drift conflicts; ungated drift keeps the newer value; two requesters; withdraw closes the task; deleting the workflow cancels pending requests; PUT upsert held; custom property gated per property; bot changes excluded from workflows. Previously disabled tests re-enabled against current behaviour.
Integration (ChangeRequest*IT) Admission (PATCH / PUT / mixed / filter / two workflows / bots / impersonation), submit and revisions, decisions, apply and conflicts, lifecycle and recovery, resource and visibility, CSV import and bulk, DAO.
E2E (Playwright, ChangeRequestReviewLifecycle.spec.ts) A requester's held edit keeps the published value; the reviewer approves (published), rejects (dropped) and the requester withdraws, all from the pending changes dialog; a reviewer assigned only by the workflow approves; edits the workflow does not gate (a tag, a glossary the filter leaves out) publish at once; a viewer outside the review sees no held edit while a requester sees only their own; an edit needing two approvals waits for the second; accepting one of two competing edits supersedes the other; a bot write supersedes the held edit. Runs in the single-worker GlobalSettings lane, because an Enforce workflow gates its entity type server-wide while it exists.
Unit GovernanceApprovalRegistryTest (rules, plus ApprovalGate admission: gated/ungated, whole-request holding, custom properties, two workflows, bots, impersonation), MutationPlannerTest, MutationOpsTest, WorkflowEventConsumerTest (bot exclusion), CreateTaskTest, FilterEntityImplTest, EntityCsvTest.

Verified end to end against a live server through the REST API: held edits, revisions, approval and rejection, self-approval refusal, gated and ungated drift, withdraw and cancel, visibility, concurrent edits by one requester, two requesters, tags, custom properties, glossary term upsert, CSV import (dry run and real), impersonation, and bot exclusion.

Tests executed on this revision

Run Result
Backend unit — governance, workflows, task and workflow-definition repositories (after the last commit) 568 / 568 passed
Backend unit — after merging main, including EntityRepository, ETagResponseFilter, RestUtil 680 / 680 passed
Backend unit — this branch merged with #34694 (lifecycle), including its new suites 586 / 586 passed
UI unit — pending-change interceptor, change summary, task tab 52 / 52 passed
UI unit — workflow serialization and validation 14 / 14 passed
UI checkstyle on changed files / check-i18n 0 errors / passed
Integration (MySQL + Elasticsearch, local) — ChangeRequestAdmissionIT 16, ChangeRequestApplyIT 11, ChangeRequestDecisionIT 6, ChangeRequestSubmitIT 5, ChangeRequestLifecycleIT 4, ChangeRequestResourceIT 7, ChangeRequestDaoIT 4, ChangeRequestImportAndBulkIT 5, WorkflowDefinitionResourceIT#test_creationReview* 4 62 / 62 passed
Integration (MySQL + Elasticsearch, local) — after the delivery change: ChangeRequestAdmissionIT, ChangeRequestApplyIT, ChangeRequestSubmitIT, GlossaryResourceIT#entityStatus_* all passed (skips are tests whose preconditions do not hold)
Live server, REST — review from creation: create → In Review → one task across two editors → Approved → held edit (202) → published, still Approved, no new review 11 / 11 checks
Live server, REST — reject → Rejected → next edit back to In Review with a new task 4 / 4 checks
Live server, REST — default GlossaryTermApprovalWorkflow unchanged (no holds) 7 / 7 checks
Playwright E2E — ChangeRequestReviewLifecycle.spec.ts, GlobalSettings lane, local Docker stack (MySQL + Elasticsearch) 7 / 7 passed, plus 21 / 21 on --repeat-each=3; no workflows or glossaries left behind
image

New tests: ApprovalGateBulkResponseTest, MutationOpsTest#proposedChangesNameTagsByFqnAndShowTextUnquoted, ETagResponseFilterTest#heldEditResponseGetsETagOfTheUnchangedEntity, ChangeRequestServiceTest$Override#aConflictingOverrideKeepsTheReviewTaskOpen, three creation-review cases in GovernanceApprovalRegistryTest, ChangeRequestAdmissionIT (202 for held PATCH/PUT, 200 for published), ChangeRequestImportAndBulkIT (bulk 202 / 200 and the async tag count), WorkflowDefinitionResourceIT#test_creationReview* (4), UI tests for the change summary, the bulk toast and legacy trigger filters.

🤖 Generated with Claude Code

Greptile Summary

The PR adds approval-gated entity changes that remain outside persisted entity state until governance workflows commit or discard them.

  • Adds a transactional per-entity, per-requester pending-change store with row locking and monotonic version tokens.
  • Applies held changes through a dedicated workflow node and conditionally deletes only the resolved snapshot.
  • Adds workflow validation, trigger/filter integration, database migrations, UI configuration, and end-to-end coverage.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains; row-level accumulation locking, monotonic hold versions, and compare-and-delete resolution address all previously reported concurrency failures.

Important Files Changed

Filename Overview
openmetadata-service/src/main/java/org/openmetadata/service/governance/approval/PendingApprovalChangeStore.java Serializes same-requester accumulation with a row lock and advances a monotonic token, resolving the previously reported lost-update and timestamp-collision paths.
openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/elements/nodes/automatedTask/impl/ResolvePendingChangeImpl.java Resolves a captured hold snapshot and conditionally deletes it, leaving any concurrently accumulated newer state intact.
openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/CollectionDAO.java Adds database-specific upsert, seed, locking-read, and compare-and-delete operations for pending approval records.
openmetadata-service/src/main/java/org/openmetadata/service/governance/approval/ApprovalGate.java Stages selected entity changes outside the entity and signals the matching governance workflow.
openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/WorkflowDefinitionRepository.java Validates that pending-change workflows resolve held state along terminal paths.
openmetadata-ui/src/main/resources/ui/src/components/WorkflowDefinitions/WorkflowBuilder/forms/ResolvePendingChangeForm.tsx Adds workflow-builder configuration for commit, discard, and hold actions.

Sequence Diagram

sequenceDiagram
  participant Editor
  participant Gate as ApprovalGate
  participant Store as Pending Change Store
  participant Workflow
  participant Entity
  Editor->>Gate: Edit gated field
  Gate->>Store: Accumulate held diff
  Gate-->>Entity: Persist approved value only
  Gate->>Workflow: Signal held change
  alt Approved
    Workflow->>Store: Read held snapshot and version
    Workflow->>Entity: Apply held change
    Workflow->>Store: Delete if version unchanged
  else Rejected
    Workflow->>Store: Delete if version unchanged
  end
Loading

Reviews (4): Last reviewed commit: "fix(governance): make the pending-change..." | Re-trigger Greptile

Context used:

yan-3005 and others added 6 commits August 23, 2026 22:59
…ed (#4673) [WIP]

Pending-hold model with an opt-in workflow hook node (resolvePendingChangeTask).

- PendingApprovalChangeStore: per-entity, accumulating, ChangeDescription-shaped hold
  (entity_extension-backed; never touches the row/version history); effective() unions hold with
  the entity's persisted change description.
- ApprovalGate (PUT/PATCH): when a workflow that opts in (contains a resolvePendingChange hook) gates
  a covered field (description/tags/owners/domains) and its filter doesn't exclude the entity, revert
  the field to approved (nothing persists, no ChangeEvent) and record the proposal as a hold.
  Post-commit, trigger the workflow directly via triggerWithSignal (no synthetic event -> no
  alert/webhook/search leak). Skips governance-bot; fails open.
- resolvePendingChangeTask hook node (schema + NodeSubType + WorkflowNodeDefinitionInterface subtype
  registration + wrapper + impl + NodeFactory). Node-configured action: commit (apply held change as
  governance-bot -> the one real ChangeEvent), discard (clear hold), hold (leave held). Author places
  it at the status transition; presence is the opt-in signal.
- checkChangeDescription + FilterEntityImpl evaluate effective() so "what changed" nodes see the
  held proposal.
- Seed workflows unchanged; no migration (no existing node config changed) - adoption is opt-in by
  adding the hook. v0.1 creates go through create() -> never held.

Tests:
- Unit (run, green): PendingApprovalChangeStoreTest + GovernanceApprovalRegistryTest (10 pass).
- IT (authored, compiles): PendingApprovalChangeIT - hold->approve->commit / reject->discard.

WIP - remaining: run the IT end-to-end (stack) incl. resolving seeded-vs-custom workflow
coexistence; surface the held change on the approval task for reviewers.

Verified: openmetadata-service compiles + 10 unit tests green; integration-tests test-compiles.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…lter support

- Hold approval-gated changes per (entity, requester); each requester's edit
  forms its own hold in pending_approval_change and its own approval task.
- Attribute the approval task's requester and creator to the editor of the run.
- Supersede only the same requester's prior task for hook workflows.
- Evaluate each edit's change on the trigger: the held change carried on the
  gate signal, otherwise the persisted change description; run the exclusion
  filter against the proposed entity so the trigger and gate agree.
- Fire a hook workflow only on the gate's held-change signal.
- Emit JsonLogic from the event-trigger exclude filter; persist a cleared filter.
- Add tests for the trigger decision and the requester/creator resolution.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…held-change test coverage

- Reject mutually-exclusive tags at the edit when tags are gated, before the change
  is held, so the conflict never reaches the review workflow's commit node.
- On commit, merge held tags into the entity's current tags with the held change
  taking precedence, dropping a conflicting current tag and keeping non-conflicting ones.
- Tolerate a held-only change (only fieldsUpdated set) in the change-description check.
- Add CheckChangeDescriptionTaskImpl coverage for held changes, and integration tests
  for per-requester holds resolved independently, the task creator, and mutual exclusivity.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…workflows

- Hold an explicit removal of a gated scalar field (a PATCH remove) so a destructive
  edit is reviewed instead of written straight through; an omitted collection is still
  left alone so a PUT that leaves it out is not mistaken for a change.
- Reject a hook workflow whose resolvePendingChangeTask nodes all only hold the change:
  with no commit or discard anywhere the edit would stay held forever.
- Add integration tests for clearing a gated field and for the hold only rejection.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…circuit hook checks

- Remove the unused user parameter from ApprovalGate.submitPending and update its caller;
  the real editor already comes from the held trigger recorded at hold time.
- Stop scanning after the first match in hasPendingChangeHook and targetsEntityType.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Copilot AI lite review requested due to automatic review settings August 25, 2026 14:01
@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 Aug 25, 2026

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

✅ TypeScript Types Auto-Updated

The generated TypeScript types have been automatically updated based on JSON schema changes in this PR.

Copilot AI review requested due to automatic review settings August 25, 2026 14:06

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.

…flow-pending-changes

# Conflicts:
#	bootstrap/sql/migrations/native/2.1.0/mysql/schemaChanges.sql
#	bootstrap/sql/migrations/native/2.1.0/postgres/schemaChanges.sql
#	openmetadata-ui/src/main/resources/ui/src/utils/WorkflowNodeConfigUtils.ts
@github-actions

github-actions Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 77%
77.75% (126466/162657) 64.43% (79968/124100) 65.6% (26703/40703)

yan-3005 and others added 2 commits August 25, 2026 20:10
Accumulate a requester's held change in a single transaction: insert the
first hold atomically, and merge a later edit behind a row lock so two
concurrent edits by the same requester each survive.

Resolve (commit or discard) deletes only the hold version it read, so an
edit accumulated after that read stays in place for its own review.

Remove an entity's remaining holds during hard-delete cleanup, and drop the
duplicated supersede comment in CreateTask.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…g-changes' into feature/approval-workflow-pending-changes
Copilot AI review requested due to automatic review settings August 25, 2026 14:41

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.

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

🚦 Removed from the merge queue — failed_checks (2026-10-15T03:06:04Z)

Blocked the queue: java-checkstyle

@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-10-15T03:50:27Z)

Blocked the queue: integration-tests-mysql-elasticsearch

…hem, and retry workflow ITs

test_WorkflowWithReviewersOwnersCandidates and test_WorkflowWithTeamCandidates create their table
after the workflow is deployed, and test_CustomApprovalWorkflowForNewEntities waits for deployment
before creating its entities, so each creation event reaches a listening workflow.

Workflow ITs that wait on asynchronous results retry once (@RetryingTest(2)). A retried attempt
gets its own namespace names (TestNamespaceExtension appends _rN), so it never collides with the
entities an earlier attempt created.

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.

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

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ UI Checkstyle passed — lint findings in changed files

🔍 ESLint findings in this PR's files — 0 error(s), 36 warning(s)

Errors block the build. Warnings do not yet — they are rules whose backlog is still
being worked down, listed so this PR does not add to it. See docs/ui-code-quality-gate.md.

0 error(s), 36 warning(s) across 9 changed file(s).

Count Rule
31 react-hooks/exhaustive-deps
3 openmetadata-imports/no-lower-layer-page-imports
1 openmetadata-imports/no-api-calls-in-iteration
1 openmetadata-imports/no-cross-page-imports
All findings
Location Rule Message
🟡 src/components/DataAssets/AssetsSelectionModal/AssetSelectionModal.interface.ts:53:1 openmetadata-imports/no-lower-layer-page-imports Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here.
🟡 src/components/DataProducts/DataProductsDetailsPage/DataProductsDetailsPage.component.tsx:897:6 react-hooks/exhaustive-deps React Hook useMemo has missing dependencies: 'getEntityFeedCount', 'isVersionsView', and 'openAssetDrawer'. Either include them or remove the dependency array.
🟡 src/components/DataProducts/DataProductsDetailsPage/DataProductsDetailsPage.component.tsx:935:6 react-hooks/exhaustive-deps React Hook useEffect has missing dependencies: 'fetchActiveAnnouncement', 'fetchActivityCount', 'fetchDataProductAssets', 'fetchDataProductContract', and 'fetch
🟡 src/components/DataProducts/DataProductsDetailsPage/DataProductsDetailsPage.component.tsx:948:5 react-hooks/exhaustive-deps React Hook useMemo has a missing dependency: 'tabs'. Either include it or remove the dependency array.
🟡 src/components/DataProducts/DataProductsDetailsPage/DataProductsDetailsPage.component.tsx:948:6 react-hooks/exhaustive-deps React Hook useMemo has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked.
🟡 src/components/DataProducts/DataProductsDetailsPage/DataProductsDetailsPage.component.tsx:990:6 react-hooks/exhaustive-deps React Hook useMemo has missing dependencies: 'handleTabChange' and 't'. Either include them or remove the dependency array.
🟡 src/components/Domain/DomainDetails/DomainDetails.component.tsx:358:6 react-hooks/exhaustive-deps React Hook useCallback has missing dependencies: 'domain.fullyQualifiedName' and 't'. Either include them or remove the dependency array.
🟡 src/components/Domain/DomainDetails/DomainDetails.component.tsx:360:9 react-hooks/exhaustive-deps The 'handleTabChange' function makes the dependencies of useCallback Hook (at line 469) change on every render. To fix this, wrap the definition of 'handleTabCh
🟡 src/components/Domain/DomainDetails/DomainDetails.component.tsx:360:9 react-hooks/exhaustive-deps The 'handleTabChange' function makes the dependencies of useCallback Hook (at line 638) change on every render. To fix this, wrap the definition of 'handleTabCh
🟡 src/components/Domain/DomainDetails/DomainDetails.component.tsx:748:5 react-hooks/exhaustive-deps React Hook useCallback has missing dependencies: 'closeSubDomainDrawer' and 't'. Either include them or remove the dependency array.
🟡 src/components/Domain/DomainDetails/DomainDetails.component.tsx:947:6 react-hooks/exhaustive-deps React Hook useMemo has missing dependencies: 'activeTab', 'addSubDomain', 'getEntityFeedCount', 'isVersionsView', 'onAddDataProduct', 'onDeleteSubDomain', and '
🟡 src/components/Domain/DomainDetails/DomainDetails.component.tsx:977:6 react-hooks/exhaustive-deps React Hook useEffect has missing dependencies: 'fetchActiveAnnouncement', 'fetchActivityCount', 'fetchDataProducts', 'fetchDomainAssets', and 'fetchTaskCounts'.
🟡 src/components/Domain/DomainDetails/DomainDetails.component.tsx:990:6 react-hooks/exhaustive-deps React Hook useMemo has an unnecessary dependency: 'isSubDomain'. Either exclude it or remove the dependency array.
🟡 src/components/Domain/DomainDetails/DomainDetails.component.tsx:998:5 react-hooks/exhaustive-deps React Hook useMemo has a missing dependency: 'tabs'. Either include it or remove the dependency array.
🟡 src/components/Domain/DomainDetails/DomainDetails.component.tsx:998:6 react-hooks/exhaustive-deps React Hook useMemo has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked.
🟡 src/components/Entity/Task/TaskTab/TaskTabNew.component.tsx:71:1 openmetadata-imports/no-lower-layer-page-imports Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here.
🟡 src/components/Entity/Task/TaskTab/TaskTabNew.component.tsx:72:1 openmetadata-imports/no-lower-layer-page-imports Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here.
🟡 src/components/Entity/Task/TaskTab/TaskTabNew.component.tsx:725:9 react-hooks/exhaustive-deps The 'updateTaskData' function makes the dependencies of useCallback Hook (at line 830) change on every render. To fix this, wrap the definition of 'updateTaskDa
🟡 src/components/Entity/Task/TaskTab/TaskTabNew.component.tsx:1277:6 react-hooks/exhaustive-deps React Hook useMemo has unnecessary dependencies: 'onTaskDropdownClick', 'taskHandler.approvedValue', and 'taskHandler.rejectedValue'. Either exclude them or rem
🟡 src/components/Entity/Task/TaskTab/TaskTabNew.component.tsx:1312:6 react-hooks/exhaustive-deps React Hook useMemo has unnecessary dependencies: 'isPartOfAssigneeTeam' and 'task'. Either exclude them or remove the dependency array.
🟡 src/components/Entity/Task/TaskTab/TaskTabNew.component.tsx:1375:6 react-hooks/exhaustive-deps React Hook useMemo has unnecessary dependencies: 'onTaskResolve' and 'task'. Either exclude them or remove the dependency array.
🟡 src/components/Glossary/GlossaryHeader/GlossaryHeader.component.tsx:593:6 react-hooks/exhaustive-deps React Hook useCallback has missing dependencies: 'isGlossary', 'onAddGlossaryTerm', and 'selectedData'. Either include them or remove the dependency array. If '
🟡 src/components/Glossary/GlossaryHeader/GlossaryHeader.component.tsx:673:6 react-hooks/exhaustive-deps React Hook useCallback has a missing dependency: 'showModal'. Either include it or remove the dependency array.
🟡 src/components/Glossary/GlossaryHeader/GlossaryHeader.component.tsx:732:6 react-hooks/exhaustive-deps React Hook useMemo has missing dependencies: 'handleAddGlossaryTermClick' and 't'. Either include them or remove the dependency array.
🟡 src/components/Glossary/GlossaryHeader/GlossaryHeader.component.tsx:774:6 react-hooks/exhaustive-deps React Hook useEffect has a missing dependency: 'handleBreadcrumb'. Either include it or remove the dependency array.
🟡 src/components/Glossary/GlossaryHeader/GlossaryHeader.component.tsx:793:6 react-hooks/exhaustive-deps React Hook useEffect has missing dependencies: 'fetchCurrentGlossaryInfo' and 'isVersionView'. Either include them or remove the dependency array.
🟡 src/components/WorkflowDefinitions/WorkflowBuilder/NodeConfigSidebar.tsx:170:39 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.
🟡 src/components/WorkflowDefinitions/WorkflowBuilder/NodeConfigSidebar.tsx:223:6 react-hooks/exhaustive-deps React Hook useEffect has a missing dependency: 'node'. Either include it or remove the dependency array.
🟡 src/components/WorkflowDefinitions/WorkflowBuilder/NodeConfigSidebar.tsx:367:6 react-hooks/exhaustive-deps React Hook useEffect has a missing dependency: 'node'. Either include it or remove the dependency array. If 'setBackendConfig' needs the current value of 'node'
🟡 src/hooks/useWorkflowActions.ts:235:5 react-hooks/exhaustive-deps React Hook useCallback has a missing dependency: 'workflowMetadata'. Either include it or remove the dependency array.
🟡 src/pages/EntityImport/BulkEntityImportPage/BulkEntityImportPage.tsx:134:1 openmetadata-imports/no-cross-page-imports Page features must not import another page feature. Move shared code to components, hooks, interfaces, or pure utilities.
🟡 src/pages/EntityImport/BulkEntityImportPage/BulkEntityImportPage.tsx:819:5 react-hooks/exhaustive-deps React Hook useCallback has an unnecessary dependency: 'entityType'. Either exclude it or remove the dependency array.
🟡 src/pages/EntityImport/BulkEntityImportPage/BulkEntityImportPage.tsx:1280:6 react-hooks/exhaustive-deps React Hook useEffect has missing dependencies: 'handleImportWebsocketResponse' and 'handleResetImportJob'. Either include them or remove the dependency array.
🟡 src/pages/EntityImport/BulkEntityImportPage/BulkEntityImportPage.tsx:1355:6 react-hooks/exhaustive-deps React Hook useMemo has a missing dependency: 'filterColumns'. Either include it or remove the dependency array.
🟡 src/pages/WorkflowDefinitions/WorkflowBuilder/WorkflowBuilder.tsx:367:6 react-hooks/exhaustive-deps React Hook useEffect has missing dependencies: 'edges' and 'nodes'. Either include them or remove the dependency array.
🟡 src/pages/WorkflowDefinitions/WorkflowBuilder/WorkflowBuilder.tsx:431:5 react-hooks/exhaustive-deps React Hook useCallback has missing dependencies: 't' and 'workflowLogic'. Either include them or remove the dependency array.

Fix locally (fast - only checks files changed in this branch):

make ui-checkstyle-changed

# Conflicts:
#	.github/playwright/impact-map.generated.json

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.

Resolves import conflicts in EntityCsv, TaskWorkflowHandler and EntityCsvTest:
FormatterUtil moved to events.ChangeEvents (#35032).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

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

The Java checkstyle failed.

Please run mvn spotless:apply in the root of your repository and commit the changes to this PR.
You can also use pre-commit to automate the Java code formatting.

You can install the pre-commit hooks with make install_test precommit_install.

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

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

🔴 High risk · Approval-gated entity writes, reviewer authorization, and persistence migrations could incorrectly publish or block metadata changes if decisions or application drift.

Approval-gated change requests hold gated edits as revisioned change requests outside the entity until an eligible reviewer approves or rejects them, so unapproved values never reach search, lineage, or notifications. This session resolved fixes for orphaned holds on entity deletion, a held-change write ordering risk, MySQL merge handling, weak version tokens, bulk admission failures, and several UI refresh and indicator issues. No open findings remain.

✅ 15 closed
✅ Bug: Pending holds orphaned when a governed entity is deleted

📄 openmetadata-service/src/main/java/org/openmetadata/service/governance/approval/PendingApprovalChangeStore.java:69-72 📄 bootstrap/sql/migrations/native/2.1.0/postgres/schemaChanges.sql:45-54
PendingApprovalChangeStore.deleteAllForEntity is defined (its Javadoc says "used when the entity itself is deleted") but has no caller anywhere in the codebase, and no entity delete path (EntityRepository delete/deleteInternal/postDelete) cleans up the pending_approval_change table. The migration also creates the table without any FK/ON DELETE CASCADE to the entity. As a result, deleting an entity that has an open approval hold leaves an orphaned row in pending_approval_change forever, accumulating unbounded over time. Wire PendingApprovalChangeStore.deleteAllForEntity(entityId) into the entity hard-delete/cleanup path (e.g. in EntityRepository's delete cleanup) so holds are removed with their entity.

✅ Quality: Duplicated comment block in CreateTask supersede logic

📄 openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/elements/nodes/userTask/CreateTask.java:728-733 📄 openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/elements/nodes/userTask/CreateTask.java:1193-1200
The three-line comment explaining per-requester supersede is pasted twice back-to-back (lines 728-730 and 731-733) above the requesterToMatch assignment. Harmless but confusing; remove the duplicate copy.

✅ Edge Case: Held change persisted before write can orphan on write failure

📄 openmetadata-service/src/main/java/org/openmetadata/service/governance/approval/ApprovalGate.java:95-109 📄 openmetadata-service/src/main/java/org/openmetadata/service/governance/approval/ApprovalGate.java:138-149 📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/EntityRepository.java:9011
In updateInternal/patch, ApprovalGate.stageAndHold records the hold in the pending_approval_change table (PendingApprovalChangeStore.accumulate) and reverts the fields, but the review workflow is only fired later in reactUpdate via submitPending. If the entity write throws between stageAndHold and reactUpdate, submitPending never runs, so no workflow is triggered while the hold row may remain, and the PENDING_TRIGGER ThreadLocal stays set until the next stageAndHold clears it. Consider triggering the workflow only after the write commits succeeds and/or persisting the hold within the same transaction as the entity write so a rollback also drops the hold.

✅ Bug: insertIfAbsent==0 check drops merges on MySQL (found-rows)

📄 openmetadata-service/src/main/java/org/openmetadata/service/governance/approval/PendingApprovalChangeStore.java:65-79 📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/CollectionDAO.java:1989-2003 🔗 useAffectedRows / CLIENT_FOUND_ROWS
accumulate decides whether a prior hold exists by testing dao.insertIfAbsent(...) == 0. On MySQL this INSERT uses ON DUPLICATE KEY UPDATE entity_id = entity_id, and its affected-rows value depends on the CLIENT_FOUND_ROWS flag. MySQL Connector/J's default (useAffectedRows=false, which is not overridden in HikariCPDataSourceFactory or any config) sets CLIENT_FOUND_ROWS, so an existing row set to its current value returns 1, not 0. As a result, when a requester already has a hold, insertIfAbsent returns 1, the == 0 branch is skipped, the merge (findForUpdate + upsert) never runs, and the second and subsequent edits are silently discarded — exactly the accumulation this commit is meant to guarantee. Postgres (ON CONFLICT DO NOTHING) returns 0 reliably, so the bug is MySQL-only. Don't rely on ON DUPLICATE KEY UPDATE affected-rows to detect existence; drive the decision off a locked read instead.

✅ Edge Case: updated_at millisecond token is a weak version guard

📄 openmetadata-service/src/main/java/org/openmetadata/service/governance/approval/PendingApprovalChangeStore.java:65-79 📄 openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/elements/nodes/automatedTask/impl/ResolvePendingChangeImpl.java:103-117
deleteIfUnchanged and the getRecord snapshot use updated_at (a System.currentTimeMillis() value) as the version token that protects a newer edit from being deleted during resolution. Two edits by the same requester within the same millisecond produce the same updated_at, so if a new edit accumulates in the same millisecond that a resolution read its snapshot, deleteIfUnchanged(seenUpdatedAt) will match and delete the row containing the newer, uncommitted proposal — the exact silent loss this token is meant to prevent. The window is narrow but real under load. Consider a strictly monotonic version counter or a per-write unique token instead of a wall-clock millisecond.

...and 10 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

@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-10-15T10:52:47Z)

No failing check on merge-queue commit 8209901 — invalidated by an entry ahead in the queue, or a required check timed out.

This branch was previously deployed

1 inactive deployment
test — 15663ff3 Deployed Oct 15, 2026 by yan-3005 via RDF Playwright execution #32594
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 skip-pr-checks Bypass PR metadata validation check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants