Repository navigation
Fixes 7370: Compile Oracle table-diff sampling with supported SQL - #36828
stout-yeoman wants to merge 44 commits into
Conversation
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.
…an stop redefining them
…ty approvals on fresh tasks
…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.
…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.
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
| if (Boolean.TRUE.equals(assigneesConfig.get("addDomainOwners")) | ||
| && !Entity.DOMAIN.equals(entityLink.getEntityType())) { | ||
| relationshipFields += ",domains"; | ||
| } |
There was a problem hiding this comment.
⚠️ 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 👍 / 👎
| @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')))" |
There was a problem hiding this comment.
⚠️ 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 👍 / 👎
| final var actor = | ||
| Entity.getEntityReferenceByName(Entity.USER, "governance-bot", Include.NON_DELETED); |
There was a problem hiding this comment.
💡 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 👍 / 👎
Code Review
|
| Compact |
|
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
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 |
|
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. |
Describe your changes:
Fixes open-metadata/openmetadata-collate#7370
Sampled Oracle table-diff tests currently generate
SUBSTRING(MD5(...)), which Oracle rejects withORA-00904. Add Oracle-specific SQLAlchemy compilers usingSUBSTRandLOWER(RAWTOHEX(STANDARD_HASH(..., 'MD5'))). Preserve the existing sampling prefix, salt, threshold and other dialects.Type of change:
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.pyingestion/tests/unit/metadata/data_quality/test_data_diff.pyRegression 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.pyandtest_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 -mFinal affected test command after the move:
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.pyingestion/tests/unit/observability/data_quality/validations/table/sqlalchemy/test_table_diff.pyingestion/tests/unit/observability/profiler/test_sampling_config.pyingestion/tests/unit/observability/profiler/sqlalchemy/oracle/test_oracle_profiler_sql.pyingestion/tests/unit/metadata/data_quality/test_table_diff_param_setter.pyingestion/tests/unit/observability/data_quality/validations/runtime_param_setter/test_table_diff_params_setter.pyThese were passed to
coverage run --include='*/profiler/orm/functions/md5.py,*/profiler/orm/functions/substr.py' -m pytestwith-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.
Trino table-diff selection: 2 inherited skips, no new executed Trino coverage.
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.tsat lines 110, 128, 152, 163, 184 and 224. Each is blocked by pointer interception at the canvas-origin click invisitLineageTab, before its assertions. All six also failed at the same action on a separately built base revisionce36a939299f823bcad9f7ac1f203f99a4ed77ea. 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.
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.tsplaywright/e2e/Features/Dashboards.spec.tsplaywright/e2e/Features/DataQuality/AddTestCaseNewFlow.spec.tsplaywright/e2e/Features/DataQuality/DataQuality.spec.tsplaywright/e2e/Features/DataQuality/Dimensionality.spec.tsplaywright/e2e/Features/DataQuality/Profiler.spec.tsplaywright/e2e/Features/DataQuality/ProfilerIngestionForm.spec.tsplaywright/e2e/Features/IncidentManager.spec.tsplaywright/e2e/Features/ServiceAgentsDeploymentSummary.spec.tsplaywright/e2e/Features/ServiceAgentsLiveProgress.spec.tsplaywright/e2e/Features/StorageMetadataAgentForm.spec.tsplaywright/e2e/Features/TestSuiteMultiPipeline.spec.tsplaywright/e2e/Features/TestSuitePipelineRedeploy.spec.tsplaywright/e2e/Flow/Navbar.spec.tsplaywright/e2e/Flow/ServiceCreationPermissions.spec.tsplaywright/e2e/Pages/DataMarketplace.spec.tsplaywright/e2e/Pages/HealthCheck.spec.tsplaywright/e2e/Pages/Lineage/LineageControls.spec.tsplaywright/e2e/Pages/LogsViewer.spec.tsplaywright/e2e/Pages/Policies.spec.tsplaywright/e2e/Pages/TestSuite.spec.tsplaywright/e2e/Pages/TestSuiteDetailsPage.spec.tsManual/product testing performed
ORA-00904from the actual sampling builder SQL.metadata ingest, then executed eight scenarios through the actualmetadata testCLI 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.UI screen recording:
Not applicable — standalone Python dialect bug fix, with no UI feature or UI source change.
Checklist:
Fixes <issue-number>: <short explanation>.af55363ca83c0ba2671fa40f09e94a764aa96090againstREVIEW.md; no blocking findings or untested changed functions.Summary by Gitar
CollectMetadataImplandMetadataCollectionServiceto keep one open task per asset and stagecollectMetadataTask.jsonandmetadataCompletionPayload.jsonschemaslifecycleMovepayload andtriggeringUserfiler resolution inCreateTaskSetApprovalAssigneesImplWorkflowBuilderand a manage menu inWorkflowHeaderInvalidatingCacheso stage-owner lists are not served stale after suspendWorkflowSignalDispatcherwith per-subscriber retry and isolationCollectMetadataFormandMetadataCompletionTaskcomponentsEmbeddedWorkflowBuilderfor embedding the builder in host pagesThis will update automatically on new commits.