Skip to content

Fixes 7370: Compile Oracle table-diff sampling with supported SQL - #36828

Closed
stout-yeoman wants to merge 44 commits into
mainfrom
stout-yeoman/7370-oracle-table-diff-sampling
Closed

stout-yeoman wants to merge 44 commits into
mainfrom
stout-yeoman/7370-oracle-table-diff-sampling

Conversation

@stout-yeoman

@stout-yeoman stout-yeoman commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes open-metadata/openmetadata-collate#7370

Sampled Oracle table-diff tests currently generate SUBSTRING(MD5(...)), which Oracle rejects with ORA-00904. Add Oracle-specific SQLAlchemy compilers using SUBSTR and LOWER(RAWTOHEX(STANDARD_HASH(..., 'MD5'))). Preserve the existing sampling prefix, salt, threshold and other dialects.

Type of change:

  • Bug fix

High-level design:

N/A — bounded dialect-compilation fix in two existing Python function modules. No schema, API, sampling-policy or Collate submodule change.

Tests:

Use cases covered

Oracle SQL compilation, first-eight-character hash comparison, leading-zero/lowercase hashes, literal escaping and bind forwarding; matching salt/threshold on paired tables; percentage and row sampling; full-comparison bypass; unchanged generic/PostgreSQL SQL.

Unit tests

  • Added regression coverage in:

    • ingestion/tests/unit/observability/profiler/sqlalchemy/oracle/test_oracle_profiler_sql.py
    • ingestion/tests/unit/metadata/data_quality/test_data_diff.py
  • Regression baseline: 14 failures before the compiler fix; 47 affected tests pass after it and again after the final test-file move.

  • Additional nearby DQ/profiler verification: 75 tests passed before the content-preserving move. The complete run covered test_data_diff.py, test_databricks_data_diff.py, test_table_diff_param_setter.py, test_clickzetta_profiler.py, test_oracle_sampling_functions.py (subsequently moved to the Oracle path above), test_sqa_mixin_set_catalog.py and test_system_metrics_registry.py.

    env/bin/coverage run --include='*/profiler/orm/functions/md5.py,*/profiler/orm/functions/substr.py' -m pytest ingestion/tests/unit/metadata/data_quality ingestion/tests/unit/profiler -q
    env/bin/coverage report -m

    Final affected test command after the move:

    env/bin/python -m pytest ingestion/tests/unit/observability/profiler/sqlalchemy/oracle/test_oracle_profiler_sql.py ingestion/tests/unit/metadata/data_quality/test_data_diff.py -q
  • Measured helper coverage: 93% combined (Substr: 100%; MD5: 88%). All newly added executable lines are covered; the three missed statements are unchanged dialect handlers.

  • Ruff, formatting and changed-production-module type checks passed. Full-project static verification remains incomplete.

Final affected-unit verification: 158 passed, with 93% combined helper coverage (all new executable lines covered). The six files were:

  • ingestion/tests/unit/metadata/data_quality/test_data_diff.py
  • ingestion/tests/unit/observability/data_quality/validations/table/sqlalchemy/test_table_diff.py
  • ingestion/tests/unit/observability/profiler/test_sampling_config.py
  • ingestion/tests/unit/observability/profiler/sqlalchemy/oracle/test_oracle_profiler_sql.py
  • ingestion/tests/unit/metadata/data_quality/test_table_diff_param_setter.py
  • ingestion/tests/unit/observability/data_quality/validations/runtime_param_setter/test_table_diff_params_setter.py

These were passed to coverage run --include='*/profiler/orm/functions/md5.py,*/profiler/orm/functions/substr.py' -m pytest with -q; coverage started before imports.

Backend integration tests

Not applicable — no Java or backend API changes. Repository Java impact planner selects no tests and reports no unmapped files.

Ingestion integration tests

  • Data-quality table-diff suite and SDK caller: 18 passed, 2 inherited TODO skips.

    env -u CI env/bin/python -m pytest ingestion/tests/integration/data_quality/test_data_diff.py ingestion/tests/integration/sdk/test_dq_as_code_integration.py::test_runner_for_table_diff_test -q
  • Trino table-diff selection: 2 inherited skips, no new executed Trino coverage.

    env -u CI env/bin/python -m pytest ingestion/tests/integration/trino/test_data_quality.py::test_table_diff -q

Playwright (UI) tests

All 22 mapped specs / 118 test identities were exercised against the candidate. Final reconciled result after prerequisite corrections and two complete-spec reruns: 112 passed, 6 failed, none left unrun. The six failures are in unchanged Pages/Lineage/LineageControls.spec.ts at lines 110, 128, 152, 163, 184 and 224. Each is blocked by pointer interception at the canvas-origin click in visitLineageTab, before its assertions. All six also failed at the same action on a separately built base revision ce36a939299f823bcad9f7ac1f203f99a4ed77ea. They predate this Python-only change in the tested environment; the browser suite is not fully green.

The complete run initially recorded 107 passed, 10 failed and one serial successor not run. Rerunning the complete AutoPilot and ProfilerIngestionForm specs after prerequisite correction passed all 22 selected tests; the reconciled result counts each original identity once. An intermediate rerun failed fixture setup; its 19 dependent cases subsequently ran. No assertions, skip markers or product/test source were changed.

make playwright_affected_run ARGS='--base ce36a939299f823bcad9f7ac1f203f99a4ed77ea --workers=1'
# From openmetadata-ui/src/main/resources/ui:
npx playwright test playwright/e2e/Features/AutoPilot.spec.ts playwright/e2e/Features/DataQuality/ProfilerIngestionForm.spec.ts --workers=1
npx playwright test playwright/e2e/Pages/Lineage/LineageControls.spec.ts:110 --workers=1
npx playwright test --project=entity-data-teardown --workers=1

The separate base control ran the six line-selected LineageControls cases with one worker: six failed, two prerequisite tests passed, and teardown passed separately.

All 22 mapped specs (relative to the UI directory)
  • playwright/e2e/Features/AutoPilot.spec.ts
  • playwright/e2e/Features/Dashboards.spec.ts
  • playwright/e2e/Features/DataQuality/AddTestCaseNewFlow.spec.ts
  • playwright/e2e/Features/DataQuality/DataQuality.spec.ts
  • playwright/e2e/Features/DataQuality/Dimensionality.spec.ts
  • playwright/e2e/Features/DataQuality/Profiler.spec.ts
  • playwright/e2e/Features/DataQuality/ProfilerIngestionForm.spec.ts
  • playwright/e2e/Features/IncidentManager.spec.ts
  • playwright/e2e/Features/ServiceAgentsDeploymentSummary.spec.ts
  • playwright/e2e/Features/ServiceAgentsLiveProgress.spec.ts
  • playwright/e2e/Features/StorageMetadataAgentForm.spec.ts
  • playwright/e2e/Features/TestSuiteMultiPipeline.spec.ts
  • playwright/e2e/Features/TestSuitePipelineRedeploy.spec.ts
  • playwright/e2e/Flow/Navbar.spec.ts
  • playwright/e2e/Flow/ServiceCreationPermissions.spec.ts
  • playwright/e2e/Pages/DataMarketplace.spec.ts
  • playwright/e2e/Pages/HealthCheck.spec.ts
  • playwright/e2e/Pages/Lineage/LineageControls.spec.ts
  • playwright/e2e/Pages/LogsViewer.spec.ts
  • playwright/e2e/Pages/Policies.spec.ts
  • playwright/e2e/Pages/TestSuite.spec.ts
  • playwright/e2e/Pages/TestSuiteDetailsPage.spec.ts

Manual/product testing performed

  1. Reproduced baseline Oracle ORA-00904 from the actual sampling builder SQL.
  2. Passed 18 real Oracle expression/selection checks and four Oracle/PostgreSQL selected-key comparisons.
  3. Ingested disposable Oracle/PostgreSQL fixtures through metadata ingest, then executed eight scenarios through the actual metadata test CLI and read persisted results through the API: 10% and 75% percentage sampling, approximate ROWS sampling, controlled differences, no sampling, 100% sampling, quoted composite keys and Oracle/PostgreSQL comparison. All eight produced the expected persisted outcomes. The controlled-difference case correctly reported Failed with 959 differences.
  4. Captured the CLI's real predicates: Oracle and PostgreSQL selected exactly the same 974 keys in the cross-database case. Verified changed compiler modules were loaded by the CLI. Oracle version: 23.26.3.0.0. Coverage is scalar ASCII/integer keys; broader normalization and LOB keys are outside this fix.
  5. Cleaned task-owned sources, metadata services, fixtures and test identity; stopped task runtime containers.

UI screen recording:

Not applicable — standalone Python dialect bug fix, with no UI feature or UI source change.

Checklist:

  • Proposed title follows Fixes <issue-number>: <short explanation>.
  • The linked issue is referenced with its full cross-repository identifier.
  • Added tests cover the reported failure and fail without the fix.
  • No schema generation, migration or UI recording is required for this change.
  • Self-review completed on af55363ca83c0ba2671fa40f09e94a764aa96090 against REVIEW.md; no blocking findings or untested changed functions.
  • Decision check: this restores the existing sampling contract using Oracle-valid SQL; no new policy/default or cross-component contract is introduced.
  • Completed affected unit/integration and Oracle product acceptance verification.
  • Executed all mapped Playwright specs and compared the six remaining failures against the unchanged base.
  • Validation results and limitations recorded for review: changed-production-module static checks passed; full-project static verification remains incomplete. The six browser failures were reproduced on the unchanged base revision.

Summary by Gitar

  • Metadata completion:
    • Added CollectMetadataImpl and MetadataCollectionService to keep one open task per asset and stage
    • Added collectMetadataTask.json and metadataCompletionPayload.json schemas
  • Lifecycle approvals:
    • Added lifecycleMove payload and triggeringUser filer resolution in CreateTask
    • Added domain owner and candidate assignee options in SetApprovalAssigneesImpl
  • Workflow suspension:
    • Added suspend and resume in WorkflowBuilder and a manage menu in WorkflowHeader
    • Added InvalidatingCache so stage-owner lists are not served stale after suspend
  • Signal delivery:
    • Added WorkflowSignalDispatcher with per-subscriber retry and isolation
  • Workflow UI:
    • Added CollectMetadataForm and MetadataCompletionTask components
    • Added EmbeddedWorkflowBuilder for embedding the builder in host pages

This will update automatically on new commits.

harshach and others added 30 commits October 5, 2026 16:09
Add durable lifecycle configuration, conditional metadata collection tasks, current domain-owner approval resolution and explicit waiting for empty assignments. Preserve literal custom-property values and isolate event delivery when another workflow is suspended. Cover the engine changes with unit and API integration tests.
Validate required intake fields on Metric creation while allowing existing metrics to update and advance through workflows. Reuse the intake designer and preserve false and zero custom values. Cancel stale query-builder requests and add intake and creation regression coverage.
Apply the same organize-imports, ESLint and Prettier order used by UI Checkstyle for the glossary and shared intake extension helpers.
Default omitted metadata collection namespace maps to an empty object. Keep entity-owner assignment for tasks without assignees unless an approval workflow explicitly chooses the wait strategy.

Persist the fallback choice on tasks and cover workflow deployment, assignee resolution, and owner fallback with unit and integration regressions.
- CreateTask files an approval task in the name of the editor whose change started the
  run, the same identity self-approval prevention checks, so one approver can pass
  consecutive lifecycle gates.
- MetadataCollectionService reads the lifecycle stage by status code on EntityInterface<?>.
- Glossary term workflow history reads the workflow that owns the glossary term lifecycle stage.
- Glossary term intake forms can require owners; the intake form copy names metrics in every locale.
- WorkflowDefinitionResourceIT covers one owner approving two consecutive gates.
…workflows

- Approval-only entity workflows keep the default Approved write after an approval;
  workflows whose own nodes write the stage skip it.
- Glossary terms and metrics without reviewers start in Draft when a lifecycle
  playbook owns their stage, so follows, votes and edits leave approved assets alone.
- Workflow signals reach every subscriber; the first delivery failure is rethrown
  with later ones suppressed onto it.
- Intake forms gate user edits, not a workflow's stage writes, so assets created
  before a field became required can still move through their stages. A patch
  records the acting impersonator before validation runs.
- Glossary term workflow history shows the newest run across every workflow that
  owns the stage, falling back to the default approval workflow.
- WorkflowDefinitionResourceIT covers playbook Draft enrolment and approval-only
  workflows.
…ep canvas saves lossless

- A lifecycle stage keeps one server-opened MetadataCompletion task per asset: it lists
  the required fields still empty, updates as they are filled in, completes itself when
  none is missing and closes when the asset leaves the stage. Its only action, Re-check,
  is refused while fields are missing. No task workflow drives it, and clients cannot
  create or edit one (ADR:2026-10-15-a-lifecycle-stage-asks-for-its-missing-metadata-in-one-task).
- The lifecycle configuration keeps only what the guided editor needs: a stage's fields
  and who is asked to fill them in.
- The task panel and the inbox show the missing fields by name; task titles that had no
  translation get one.
- The workflow builder saves a workflow without dropping settings its forms do not edit
  (lifecycle metadata, approval transitions and task status, domain-owner approvers), gives
  the missing-fields node its own form, and links a lifecycle playbook back to its editor.
  A playbook's shape is locked in the canvas.
- Conditions with an operator that takes no value show no value field.
…value

An operator such as "Is Set" compares against nothing, so the rule's value
column now reads "No value needed" instead of an empty disabled select. The
column stays in place, so every rule row keeps the same widths and the
advanced-search-value cell that callers wait on is always rendered.
…equired fields

A lifecycle stage can now carry conditions - any JSON Logic rule written with
the workflow builder's condition picker - alongside its required fields, or
instead of them. The stage gate requires both. The collect node carries the
conditions too and evaluates them on the same attributes the gate sees, so the
Metadata Completion task stays open while they fail. The task names missing
fields but reports unmet conditions only as "The lifecycle conditions are not
met"; Re-check refuses with the same message. The canvas shows a stage's
conditions read-only on its collect node.

Also:
- Refuse to resolve a workflow task whose instance is still running but whose
  runtime task does not exist yet (409, retry) instead of closing it directly,
  which left the workflow waiting on a task nobody could resolve.
- Keep the intake form designer's edits when the custom properties load after
  the admin has started typing.
- Show a domain's lifecycle stage next to its name, as data products do.
- Show nothing outstanding in the inbox for a Metadata Completion task that has
  closed.
- Drop popover props UserTeamSelectableList no longer accepts.
…age workflow's history

- A lifecycle approval names the move it gates. userApprovalTask config gains an
  optional lifecycleMove (stage, targetStage); when set, the task carries the
  move instead of proposed changes built from the entity's latest change, which
  in a lifecycle is usually the workflow's own stage change. The task shows a
  card: approval needed to move from one stage to the next. Other approvals keep
  their proposed changes. ADR:2026-10-15-a-lifecycle-approval-names-the-stage-move-it-gates
- Glossaries can have a lifecycle and an intake form: glossary joins the
  lifecycle and intake target types, glossary creation honours an intake form,
  and the create-glossary drawer renders it.
- A glossary term's workflow history shows the newest run of whichever workflow
  sets its stage - the approval workflow or a lifecycle playbook - and names it.
…lign the task cards with core components

A Metadata Completion task asks the asset's owners, its reviewers or named users. When that group is
empty — owners and reviewers can themselves be among the fields the stage still needs — the task now
goes to the admins, and moves to the group once it has someone. UserUtil.getAdmins lists them.

The canvas collect-metadata form warns when the asked group is also a required field of the stage
(AskedGroupWarning, shared with the Collate lifecycle editor).

The lifecycle approval card, metadata completion task, collect-metadata form, workflow history header,
glossary/metric create forms and query builder value cell use Card, Box, Typography size props and
link buttons in alerts, as the ui-core-components guide and stories define.
…orce workflow owns no stage

A workflow's approval task (a lifecycle stage move, or the review of a held change) is decided by its
assignees: the server refuses resolving it for an admin or owner who is not assigned, and the task
tab and the pending-changes review show its actions only to assignees. Bots keep access; the
workflow engine resolves through its own path.

An Enforce workflow's approval publishes the held change it reviewed and never sets the stage, so it
no longer counts as owning the stage: a lifecycle playbook on the same entity type no longer lists it
as a conflicting workflow to pause.
…ses the stage's leftover task

A stage can ask different people for different fields: each collect step opens its own task with its
own fields and assignees. A step with no fields opens nothing and closes the task of the stage the
asset left.
yan-3005 and others added 13 commits October 16, 2026 12:33
…rkflow list heading

A rule whose container is narrower than the md container width lays its Field,
Operator and Value controls one under another instead of squeezing Operator to
an ellipsis. The workflow list heading is a plain h2, since Typography styles
headings through its prose wrapper.
…ted wording

A footer element carrying data-workflow-card-flag gives its workflow card the
error border. German, French and Hebrew lifecycle strings are reworded without
hyphens.
…p is empty

A refresh asks the stage's group once it has someone. While it is empty the
task keeps whoever it already has, so a reassignment survives the next edit,
and the admins are asked only when the task has nobody.
Export EmbeddedWorkflowBuilder: the builder's Workflow Builder and
Execution History tabs, canvas, palette and edit controls for a saved
workflow, without the page layout, breadcrumb and title header, so a
host page with its own header (the Collate lifecycle editor) can show
them in place. onSaved lets the host reload after a save.

- WorkflowExecutionHistory takes the workflow's fqn as a prop, falling
  back to the route's.
- WorkflowHeader gains an `actions` variant that renders only the run,
  test, save, cancel and edit controls.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…he status in version history

- A workflow approval (a lifecycle stage move or a held change) is decided by its
  assignees only. An assignee can approve even when the asset also has reviewers;
  anyone else, admins and owners included, gets "User 'x' is not an assignee of this
  approval, so they cannot approve or reject it."
- Version history reads "Status changed to Approved." for an entityStatus change.
- Data Product and Domain pages reload once a task on them is decided from the
  Activity tab, so the status in the header is current.
The workflow page header gets a three-dot menu after Edit Workflow holding
Suspend (Resume once suspended) and a red Delete, replacing the standalone
Delete Workflow button. The menu shows wherever deletion is allowed.
The manage menu hid Suspend and Resume whenever deletion was disabled, and
OpenMetadata disables deletion, so neither was reachable there. Suspend now
follows view mode, like Edit Workflow; only Delete follows the delete capability.
…d or resume

The stage lock reads the active stage-owning workflows from a cache that a
workflow change clears with invalidateAll(). Caffeine leaves an entry still
loading during invalidateAll() undefined, so a load that read the workflows
just before a suspend or resume could cache the old list for the 30s expiry:
the lock stayed on after a suspend, or stayed off after a resume. The cache
is now keyed by a generation that invalidation moves on, stranding such a
load under a key no lookup reads again.
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

Comment on lines +78 to +81
if (Boolean.TRUE.equals(assigneesConfig.get("addDomainOwners"))
&& !Entity.DOMAIN.equals(entityLink.getEntityType())) {
relationshipFields += ",domains";
}

@gitar-bot gitar-bot Bot Nov 2, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Quality: No decision record for 'wait', addDomainOwners or admin non-auto-approve

This PR extends the public userApprovalTask schema contract. It adds the emptyAssigneeStrategy enum value wait and a new addDomainOwners flag, and SetApprovalAssigneesImpl reads a new candidateIds key. It also changes the gateway rule at SetApprovalAssigneesImpl.java:221-227: assignAdmins and wait now always set hasAssignees=true, so an event-driven approval with nobody eligible stays open instead of auto-approving. Neither the new ADR (it covers only lifecycleMove) nor any existing record in docs/decisions/ states these rules. A record would say something like: "An approval whose emptyAssigneeStrategy is assignAdmins or wait never auto-approves; with no eligible assignee it keeps an open (possibly unassigned) task, and addDomainOwners resolves owners from the asset's domains, or a domain's own owners, at execution time."

Add a decision record stating the rule, or extend the lifecycle ADR with it.:

## Decision
1. `emptyAssigneeStrategy: wait` opens an unassigned task when no eligible assignee resolves; it never auto-approves and never falls back to admins.
2. `assignAdmins` never auto-approves, even when the requester is the only admin.
3. `addDomainOwners` adds the owners of the asset's domains (a domain's own owners) at execution time.

Was this helpful? React with 👍 / 👎

Comment on lines +56 to +58
@compiles(MD5, PythonDialects.Oracle.value)
def _(element: MD5, compiler: SQLCompiler, **kw: Any) -> str:
return f"LOWER(RAWTOHEX(STANDARD_HASH({compiler.process(element.clauses, **kw)}, 'MD5')))"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Quality: PR titled as an Oracle SQL fix carries an unrelated workflow feature set

The title and description cover only the Oracle SUBSTR/STANDARD_HASH compilers in md5.py and substr.py. The branch also includes about 100 files of unrelated, high-risk governance changes: a new Metadata Completion task type and schema, per-subscriber signal dispatch in place of Flowable's broadcast, new approval-assignee semantics, workflow suspend/resume UI, and new task-id reuse rules in CreateTask. The repo squash-merges, so none of these behaviors will be described in history, and reviewers of an "Oracle fix" will not examine them. Rebase this PR so it contains only the ingestion commits (af55363, e4dd1fc), and ship the workflow commits in their own PR with a description.

Was this helpful? React with 👍 / 👎

Comment on lines +53 to +54
final var actor =
Entity.getEntityReferenceByName(Entity.USER, "governance-bot", Include.NON_DELETED);

@gitar-bot gitar-bot Bot Nov 2, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Quality: Hardcoded "governance-bot" instead of the GOVERNANCE_BOT constant

CollectMetadataImpl looks up the actor by the raw literal "governance-bot". The value is already defined once as WorkflowEventConsumer.GOVERNANCE_BOT, and MetadataCollectionService uses that constant. If the bot name ever changes, this lookup will break without any warning. Use the constant.

Import WorkflowEventConsumer.GOVERNANCE_BOT statically and use it.:

final var actor =
    Entity.getEntityReferenceByName(Entity.USER, GOVERNANCE_BOT, Include.NON_DELETED);

Was this helpful? React with 👍 / 👎

@gitar-bot

gitar-bot Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Code Review ⚠️ Changes requested 0 closed / 3 findings

🔴 High risk · Changing workflow approval eligibility and lifecycle gates could let unintended users authorize stage transitions or leave assets blocked.

Adds Oracle-specific SQLAlchemy compilers for SUBSTR and LOWER(RAWTOHEX(STANDARD_HASH(..., 'MD5'))) alongside a broad set of governance workflow changes, and the verdict is changes requested. Three open findings block merge: the userApprovalTask contract changes (wait strategy, addDomainOwners, candidateIds) and the stay-open gateway rule lack a decision record, the unrelated workflow features should be split out of this Oracle fix PR, and CollectMetadataImpl should use the GOVERNANCE_BOT constant instead of the hardcoded governance-bot literal.

⚠️ Quality: No decision record for 'wait', addDomainOwners or admin non-auto-approve

📄 openmetadata-spec/src/main/resources/json/schema/governance/workflows/elements/nodes/userTask/userApprovalTask.json 📄 openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/elements/nodes/userTask/impl/SetApprovalAssigneesImpl.java:78-81 📄 openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/elements/nodes/userTask/impl/SetApprovalAssigneesImpl.java:100-103 📄 openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/elements/nodes/userTask/impl/SetApprovalAssigneesImpl.java:137-141 📄 openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/elements/nodes/userTask/impl/SetApprovalAssigneesImpl.java:189-194 📄 openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/elements/nodes/userTask/impl/SetApprovalAssigneesImpl.java:221-227

This PR extends the public userApprovalTask schema contract. It adds the emptyAssigneeStrategy enum value wait and a new addDomainOwners flag, and SetApprovalAssigneesImpl reads a new candidateIds key. It also changes the gateway rule at SetApprovalAssigneesImpl.java:221-227: assignAdmins and wait now always set hasAssignees=true, so an event-driven approval with nobody eligible stays open instead of auto-approving. Neither the new ADR (it covers only lifecycleMove) nor any existing record in docs/decisions/ states these rules. A record would say something like: "An approval whose emptyAssigneeStrategy is assignAdmins or wait never auto-approves; with no eligible assignee it keeps an open (possibly unassigned) task, and addDomainOwners resolves owners from the asset's domains, or a domain's own owners, at execution time."

Add a decision record stating the rule, or extend the lifecycle ADR with it.
## Decision
1. `emptyAssigneeStrategy: wait` opens an unassigned task when no eligible assignee resolves; it never auto-approves and never falls back to admins.
2. `assignAdmins` never auto-approves, even when the requester is the only admin.
3. `addDomainOwners` adds the owners of the asset's domains (a domain's own owners) at execution time.
⚠️ Quality: PR titled as an Oracle SQL fix carries an unrelated workflow feature set

📄 ingestion/src/metadata/profiler/orm/functions/md5.py:56-58 📄 ingestion/src/metadata/profiler/orm/functions/substr.py:39-41 📄 openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/WorkflowSignalDispatcher.java:1-15 📄 openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/metadata/MetadataCollectionService.java:1-15

The title and description cover only the Oracle SUBSTR/STANDARD_HASH compilers in md5.py and substr.py. The branch also includes about 100 files of unrelated, high-risk governance changes: a new Metadata Completion task type and schema, per-subscriber signal dispatch in place of Flowable's broadcast, new approval-assignee semantics, workflow suspend/resume UI, and new task-id reuse rules in CreateTask. The repo squash-merges, so none of these behaviors will be described in history, and reviewers of an "Oracle fix" will not examine them. Rebase this PR so it contains only the ingestion commits (af55363, e4dd1fc), and ship the workflow commits in their own PR with a description.

💡 Quality: Hardcoded "governance-bot" instead of the GOVERNANCE_BOT constant

📄 openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/elements/nodes/automatedTask/impl/CollectMetadataImpl.java:53-54

CollectMetadataImpl looks up the actor by the raw literal "governance-bot". The value is already defined once as WorkflowEventConsumer.GOVERNANCE_BOT, and MetadataCollectionService uses that constant. If the bot name ever changes, this lookup will break without any warning. Use the constant.

Import WorkflowEventConsumer.GOVERNANCE_BOT statically and use it.
final var actor =
    Entity.getEntityReferenceByName(Entity.USER, GOVERNANCE_BOT, Include.NON_DELETED);
🤖 Prompt for agents
Code Review: Adds Oracle-specific SQLAlchemy compilers for `SUBSTR` and `LOWER(RAWTOHEX(STANDARD_HASH(..., 'MD5')))` alongside a broad set of governance workflow changes, and the verdict is changes requested. Three open findings block merge: the `userApprovalTask` contract changes (`wait` strategy, `addDomainOwners`, `candidateIds`) and the stay-open gateway rule lack a decision record, the unrelated workflow features should be split out of this Oracle fix PR, and `CollectMetadataImpl` should use the `GOVERNANCE_BOT` constant instead of the hardcoded `governance-bot` literal.

1. ⚠️ Quality: No decision record for 'wait', addDomainOwners or admin non-auto-approve
   Files: openmetadata-spec/src/main/resources/json/schema/governance/workflows/elements/nodes/userTask/userApprovalTask.json, openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/elements/nodes/userTask/impl/SetApprovalAssigneesImpl.java:78-81, openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/elements/nodes/userTask/impl/SetApprovalAssigneesImpl.java:100-103, openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/elements/nodes/userTask/impl/SetApprovalAssigneesImpl.java:137-141, openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/elements/nodes/userTask/impl/SetApprovalAssigneesImpl.java:189-194, openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/elements/nodes/userTask/impl/SetApprovalAssigneesImpl.java:221-227

   This PR extends the public `userApprovalTask` schema contract. It adds the `emptyAssigneeStrategy` enum value `wait` and a new `addDomainOwners` flag, and `SetApprovalAssigneesImpl` reads a new `candidateIds` key. It also changes the gateway rule at SetApprovalAssigneesImpl.java:221-227: `assignAdmins` and `wait` now always set `hasAssignees=true`, so an event-driven approval with nobody eligible stays open instead of auto-approving. Neither the new ADR (it covers only `lifecycleMove`) nor any existing record in `docs/decisions/` states these rules. A record would say something like: "An approval whose emptyAssigneeStrategy is `assignAdmins` or `wait` never auto-approves; with no eligible assignee it keeps an open (possibly unassigned) task, and `addDomainOwners` resolves owners from the asset's domains, or a domain's own owners, at execution time."

   Fix (Add a decision record stating the rule, or extend the lifecycle ADR with it.):
   ## Decision
   1. `emptyAssigneeStrategy: wait` opens an unassigned task when no eligible assignee resolves; it never auto-approves and never falls back to admins.
   2. `assignAdmins` never auto-approves, even when the requester is the only admin.
   3. `addDomainOwners` adds the owners of the asset's domains (a domain's own owners) at execution time.

2. ⚠️ Quality: PR titled as an Oracle SQL fix carries an unrelated workflow feature set
   Files: ingestion/src/metadata/profiler/orm/functions/md5.py:56-58, ingestion/src/metadata/profiler/orm/functions/substr.py:39-41, openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/WorkflowSignalDispatcher.java:1-15, openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/metadata/MetadataCollectionService.java:1-15

   The title and description cover only the Oracle `SUBSTR`/`STANDARD_HASH` compilers in md5.py and substr.py. The branch also includes about 100 files of unrelated, high-risk governance changes: a new Metadata Completion task type and schema, per-subscriber signal dispatch in place of Flowable's broadcast, new approval-assignee semantics, workflow suspend/resume UI, and new task-id reuse rules in CreateTask. The repo squash-merges, so none of these behaviors will be described in history, and reviewers of an "Oracle fix" will not examine them. Rebase this PR so it contains only the ingestion commits (af55363, e4dd1fc), and ship the workflow commits in their own PR with a description.

3. 💡 Quality: Hardcoded "governance-bot" instead of the GOVERNANCE_BOT constant
   Files: openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/elements/nodes/automatedTask/impl/CollectMetadataImpl.java:53-54

   `CollectMetadataImpl` looks up the actor by the raw literal "governance-bot". The value is already defined once as `WorkflowEventConsumer.GOVERNANCE_BOT`, and `MetadataCollectionService` uses that constant. If the bot name ever changes, this lookup will break without any warning. Use the constant.

   Fix (Import WorkflowEventConsumer.GOVERNANCE_BOT statically and use it.):
   final var actor =
       Entity.getEntityReferenceByName(Entity.USER, GOVERNANCE_BOT, Include.NON_DELETED);

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

@stout-yeoman
stout-yeoman marked this pull request as ready for review November 2, 2026 09:52
@stout-yeoman
stout-yeoman requested review from a team as code owners November 2, 2026 09:52
@github-actions

github-actions Bot commented Nov 2, 2026

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.

@stout-yeoman

Copy link
Copy Markdown
Contributor Author

Superseded by #37074, rebuilt as one commit on current main with only the four Oracle source/test files (161 additions). The original branch and validation evidence are preserved. The replacement description distinguishes fresh checks from earlier live validation.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants