Repository navigation
Fixes #34693: support lifecycle gates, metadata tasks and metric intake - #34694
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.
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
Apply the same organize-imports, ESLint and Prettier order used by UI Checkstyle for the glossary and shared intake extension helpers.
✅ Generated Sources Auto-UpdatedThe generated TypeScript types ( |
…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.
| Task open = repository.findOpenTaskByEntityAndType(entity.getFullyQualifiedName(), TASK_TYPE); | ||
| int closed = 0; | ||
| while (open != null && !current.equals(open.getId()) && closed < MAX_STALE_TASKS) { | ||
| final MetadataCompletionPayload payload = | ||
| JsonUtils.convertValue(open.getPayload(), MetadataCompletionPayload.class); | ||
| if (isInStage(entity, payload.getStage())) { | ||
| open = null; |
There was a problem hiding this comment.
closeTasksOfOtherStages can leave old-stage tasks open permanently. With twelve collection nodes in the previous stage, the first run closes ten tasks and opens the new stage's task. That newer task then wins the createdAt DESC LIMIT 1 lookup. Later runs stop at that task, so they never visit the remaining two stale tasks. Fetch tasks from other stages directly, or page through all open tasks without stopping at the first current-stage task.
There was a problem hiding this comment.
Fixed in d074e48: the reconcile now lists all open MetadataCompletion tasks for the asset (bounded) and closes every one from a stage the asset has left, so a newer current-stage task no longer hides older stale ones.
| const { data } = await getWorkflowInstancesForApplication({ | ||
| ...timeRange, | ||
| entityLink, | ||
| limit: RECENT_INSTANCES_LIMIT, | ||
| }); | ||
| const instances = orderBy(data ?? [], getInstanceStart, 'desc'); | ||
| const definitions = await getReadableDefinitions(instances); |
There was a problem hiding this comment.
getLatestWorkflowRun searches only the first 25 runs across all workflows. If a term has an approval run followed by 25 runs of a workflow that does not set its stage, the approval run falls outside this page. The card then shows no workflow history even though approval history exists. Follow the returned pages until a relevant run is found, or filter for stage-setting workflows before applying the limit.
There was a problem hiding this comment.
Fixed in d074e48: getLatestWorkflowRun pages through the runs (up to 8 pages of 25) until it finds a stage-setting workflow. Added a test with 25 runs of another workflow ahead of the approval run.
…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) <noreply@anthropic.com>
…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.
| void test_sameOwnerApprovesConsecutiveGates(TestNamespace ns) throws Exception { | ||
| OpenMetadataClient admin = SdkClients.adminClient(); | ||
| OpenMetadataClient ownerClient = SdkClients.user1Client(); | ||
| EntityReference owner = admin.users().getByName("shared_user1").getEntityReference(); |
There was a problem hiding this comment.
Tests exceed required method size
The added test_sameOwnerApprovesConsecutiveGates spans over 60 lines and mixes entity setup, workflow deployment, two approvals, and polling. The Java guide requires methods to stay around 15 lines and do one nameable thing. Extract setup and approval helpers so the test reads as a short sequence of outcomes. The same pattern appears in LifecycleMetadataTasksIT and LifecycleWorkflowConfigurationIT. This repository requirement must be satisfied before merging.
Context Used: AGENTS.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Done in d074e48: test_sameOwnerApprovesConsecutiveGates and the long tests in LifecycleMetadataTasksIT and LifecycleWorkflowConfigurationIT now read as named steps with helpers.
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.
| final var variables = new WorkflowVariableHandler(execution); | ||
| try { | ||
| collect(execution, variables); | ||
| } catch (Exception failure) { |
There was a problem hiding this comment.
Unexpected errors look routine
CollectMetadataImpl.execute catches every Exception and converts it to BpmnError. The Java guide explicitly requires catching specific exception types. Catch the failures this delegate expects so unrelated coding errors are not treated as ordinary workflow failures. This repository requirement must be satisfied before merging.
Context Used: AGENTS.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Done in d074e48: it now catches RuntimeException. collect() declares no checked exceptions, and any failure still has to become a BpmnError so the stage's error boundary handles it, as in the other delegates.
… history and tests - Glossary intake is checked when a glossary is created, including a PUT that creates one, and skipped for bots, as for Metric; later edits to a glossary created before a required field are accepted. - A stage's metadata reconcile closes every open task of another stage the asset has left, not only those newer than the current stage's task. - Workflow history pages through an entity's runs until one of a stage-setting workflow is found, so runs of other workflows cannot hide it. - CollectMetadataImpl catches RuntimeException; collect() declares no checked exceptions and failures still reach the stage's error boundary. - Tests use the imported ResolveTask and read as named steps.
Code Review ✅ Approved 4 closed / 4 findings🔴 High risk · Changing approval-assignee resolution and empty-assignee behavior could permit unintended lifecycle stage changes or leave valid transitions blocked. Adds guided lifecycle workflow support, including metadata collection tasks, approval steps that wait for assignees, and shared Metric intake forms. Resolved NPE when ✅ 4 closed✅ Bug: NPE when collectMetadataTask omits inputNamespaceMap
✅ Bug: Workflow tasks no longer fall back to entity owners for every strategy
✅ Bug: One failing signal subscriber still aborts delivery to later workflows
✅ Bug: Admin fallback overwrites manual reassignment on every reconcile
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
|



Describe your changes:
Fixes #34693
Add the shared schema, workflow-engine and intake-form support needed by guided lifecycle workflows. The executable graph remains authoritative; optional lifecycle metadata preserves field checks and guidance, metadata collection creates ordinary tasks, and approval steps can explicitly wait for an assignee. Metric creation now uses the shared intake form without preventing older metrics from updating when new requirements are enabled.
Based on the two commits in this branch:
0edb073f3e— persist lifecycle gates, collect metadata tasks, resolve current domain owners/immutable candidate IDs, handle empty assignments, preserve literal custom-property values, and isolate workflow event delivery.8bb1648217— reuse shared Metric intake forms, preserve zero/false custom values, cancel stale query-builder requests, and add creation/intake regression coverage.This builds on the merged lifecycle API in #34541. Draft pending review, CI, direct OSS UI evidence and the remaining validation noted below.
Type of change:
High-level design:
config.lifecyclepresentation metadata and acollectMetadataTasknode. Register the node through the existing factory and preserve metadata throughWorkflowDefinitionMapper; Java models and committed TypeScript models derive from the schemas.MetadataCollectionServiceuses the shared task repository and a deterministic entity/workflow/stage/field identity. Repeated edits reuse tasks; satisfied requirements complete, inapplicable requirements cancel, and returning requirements reopen. Task completion alone does not satisfy a missing field. Existing manual assignments are preserved.0andfalse. Intake-designer proposals stay unsaved until Save.Tests:
Use cases covered
Persist/reload lifecycle metadata; conditional metadata tasks that reuse, complete, cancel and reopen; missing/empty approvers that wait; current domain ownership and immutable candidate IDs; suspended workflow event isolation; dotted custom properties and zero/false values; required Metric creation fields; legacy Metric updates; glossary custom-field regressions; and stale query-builder request cancellation.
Unit tests
WorkflowSignalIsolationTest,WorkflowDefinitionMapperTest,DataCompletenessImplTest,SetApprovalAssigneesImplTest,IntakeFormValidatorTestand shared task regressions.useMetricIntakeForm.test.tsx,AddMetricForm.utils.test.tsandAdvanceSearchProvider.test.tsx, plus shared intake/query-builder regression suites.Backend integration tests
LifecycleWorkflowConfigurationITandLifecycleMetadataTasksIT; expandedIntakeFormResourceIT.Ingestion integration tests
Not applicable: no connector or ingestion-runtime changes. Pydantic regeneration/ingestion compatibility is still to be checked before marking ready.
Playwright (UI) tests
39 distinct scenarios passed without retries against these backend changes through the consuming lifecycle UI, covering all four entity types, stage transitions, three rejection paths, task reuse/cancellation, approval waits, multiple approvals, conflict pauses and shared intake forms. The browser spec belongs to the companion UI repository; this PR does not add an OSS Playwright file. The recorded total combines a 35-scenario full run and an eight-scenario focused run with four overlapping scenarios.
Manual testing performed
A local test server and browser exercised the template drawer, stage editor, conditional check details, approvals, shared intake-form configuration, publish/reload and generated canvas. Seven consuming-UI screenshots were inspected with no page errors. Backend build/install, scoped Spotless, changed-file UI ESLint/Prettier and whitespace checks passed. Full-workspace TypeScript still reports repository/dependency errors, including unresolved core-component icon declarations; a full-repository green build is not claimed.
UI screen recording / screenshots:
TODO before marking ready: attach a direct OpenMetadata Metric intake-form recording/screenshots. Keeping this PR as a draft; the consuming UI's evidence is included with its separate PR.
Checklist:
Fixes #34693.Summary by Gitar
WorkflowListpage section and a footer slot onWorkflowCardfor downstream buildsgetLatestWorkflowRunWorkflowHeaderQueryBuilderRuleRowQueryBuilderValueCellAddGlossaryEmbeddedWorkflowBuilderto show the builder tabs in a host page without the page headerSuspend/ResumewithDeleteinWorkflowHeaderDomainDetailsThis will update automatically on new commits.
The remaining Java guide violations must be addressed before merging.
Findings
Summary
Adds shared support for guided lifecycle workflows:
No new findings were accepted in this review.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR A[Asset change] --> B[Workflow graph] B --> C[Check required metadata] C -->|Missing| D[Open or refresh metadata task] C -->|Complete| E[Approval when required] D --> F[User fills asset fields] F --> A E --> G[Move asset to next stage]Reviews (8) · Last reviewed commit: "fix(lifecycle): address review on intake..." · Reviewed by Greptile