-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Governance Workflows: scheduleRunId correlation, batch trigger refactor, stage entity enrichment #27081
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
yan-3005
wants to merge
20
commits into
ram/inclusive-gateway
Choose a base branch
from
ram/workflow-instance-states-impl
base: ram/inclusive-gateway
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Governance Workflows: scheduleRunId correlation, batch trigger refactor, stage entity enrichment #27081
Changes from 3 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
f929f4d
Governance workflows: scheduleRunId correlation, batch trigger refact…
yan-3005 95ecb30
Update generated TypeScript types
github-actions[bot] d5e4d84
Governance workflows: fix updatedBy namespace resolution and address …
yan-3005 3eeaab5
Fix readScheduleRunIdFromProcess to handle String-typed schedule run IDs
yan-3005 035d0f9
Route scheduleRunId filter through ListFilter instead of bypassing pa…
yan-3005 870bc7b
Improve PeriodicBatchEntityTrigger scaling: per-iteration offset comm…
yan-3005 3ff954b
Merge branch 'ram/inclusive-gateway' into ram/workflow-instance-state…
yan-3005 3d5c00b
Merge branch 'ram/inclusive-gateway' into ram/workflow-instance-state…
yan-3005 3b8aed3
feat(workflows): scheduleRunId, per-batch instance recording, stage e…
yan-3005 6852185
Merge remote-tracking branch 'origin/ram/inclusive-gateway' into ram/…
yan-3005 23047ac
fix(trigger): remove attachWorkflowInstanceListeners from trigger pro…
yan-3005 12177fe
fix(trigger): resolve merge conflict — keep scheduleRunId IO parameter
yan-3005 3383b60
Merge remote-tracking branch 'origin/main' into ram/workflow-instance…
yan-3005 277e75a
fix(tests): update TriggerFactoryTest for multi-instance arch; restor…
yan-3005 34cb467
Merge branch 'ram/inclusive-gateway' into ram/workflow-instance-state…
yan-3005 86dbaa6
Merge remote-tracking branch 'origin/ram/inclusive-gateway' into ram/…
yan-3005 27cbda2
Merge branch 'ram/workflow-instance-states-impl' of https://github.co…
yan-3005 8084025
Merge origin/ram/inclusive-gateway into ram/workflow-instance-states-…
yan-3005 10548d8
perf: fetch WorkflowDefinition once per stage event, eliminating dupl…
yan-3005 82ddbf9
fix: include resolveWorkflowFqn helper in TriggerFactory
yan-3005 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
bootstrap/sql/migrations/native/1.14.0/mysql/schemaChanges.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| ALTER TABLE workflow_instance_time_series | ||
| ADD COLUMN scheduleRunId VARCHAR(36) | ||
| GENERATED ALWAYS AS (json ->> '$.scheduleRunId'); | ||
| ALTER TABLE workflow_instance_time_series | ||
| ADD INDEX idx_workflow_instance_schedule_run_id (scheduleRunId); | ||
|
|
||
| ALTER TABLE workflow_instance_state_time_series | ||
| ADD COLUMN scheduleRunId VARCHAR(36) | ||
| GENERATED ALWAYS AS (json ->> '$.scheduleRunId'); | ||
| ALTER TABLE workflow_instance_state_time_series | ||
| ADD INDEX idx_workflow_instance_state_schedule_run_id (scheduleRunId); |
11 changes: 11 additions & 0 deletions
11
bootstrap/sql/migrations/native/1.14.0/postgres/schemaChanges.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| ALTER TABLE workflow_instance_time_series | ||
| ADD COLUMN scheduleRunId VARCHAR(36) | ||
| GENERATED ALWAYS AS ((json ->> 'scheduleRunId')) STORED; | ||
| CREATE INDEX idx_workflow_instance_schedule_run_id | ||
| ON workflow_instance_time_series (scheduleRunId); | ||
|
|
||
| ALTER TABLE workflow_instance_state_time_series | ||
| ADD COLUMN scheduleRunId VARCHAR(36) | ||
| GENERATED ALWAYS AS ((json ->> 'scheduleRunId')) STORED; | ||
| CREATE INDEX idx_workflow_instance_state_schedule_run_id | ||
| ON workflow_instance_state_time_series (scheduleRunId); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
.../main/java/org/openmetadata/service/governance/workflows/WorkflowScheduleRunIdReader.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| package org.openmetadata.service.governance.workflows; | ||
|
|
||
| import static org.openmetadata.service.governance.workflows.Workflow.GLOBAL_NAMESPACE; | ||
| import static org.openmetadata.service.governance.workflows.Workflow.WORKFLOW_SCHEDULE_RUN_ID_VARIABLE; | ||
| import static org.openmetadata.service.governance.workflows.WorkflowVariableHandler.getNamespacedVariableName; | ||
|
|
||
| import java.util.UUID; | ||
| import lombok.extern.slf4j.Slf4j; | ||
| import org.flowable.engine.delegate.DelegateExecution; | ||
|
|
||
| @Slf4j | ||
| public final class WorkflowScheduleRunIdReader { | ||
| private WorkflowScheduleRunIdReader() {} | ||
|
|
||
| public static UUID readFrom(DelegateExecution execution) { | ||
| Object plain = execution.getVariable(WORKFLOW_SCHEDULE_RUN_ID_VARIABLE); | ||
| if (plain != null) { | ||
| return toUuid(plain); | ||
| } | ||
| Object namespaced = | ||
| execution.getVariable( | ||
| getNamespacedVariableName(GLOBAL_NAMESPACE, WORKFLOW_SCHEDULE_RUN_ID_VARIABLE)); | ||
| return namespaced != null ? toUuid(namespaced) : null; | ||
| } | ||
|
|
||
| private static UUID toUuid(Object value) { | ||
| if (value instanceof UUID uuid) { | ||
| return uuid; | ||
| } | ||
| try { | ||
| return UUID.fromString(value.toString()); | ||
| } catch (IllegalArgumentException e) { | ||
| LOG.warn( | ||
| "[WorkflowScheduleRunIdReader] Invalid scheduleRunId value '{}': {}", | ||
| value, | ||
| e.getMessage()); | ||
| return null; | ||
| } | ||
| } | ||
| } |
24 changes: 24 additions & 0 deletions
24
...va/org/openmetadata/service/governance/workflows/WorkflowScheduleRunIdSetterListener.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| package org.openmetadata.service.governance.workflows; | ||
|
|
||
| import static org.openmetadata.service.governance.workflows.Workflow.WORKFLOW_SCHEDULE_RUN_ID_VARIABLE; | ||
|
|
||
| import java.util.UUID; | ||
| import lombok.extern.slf4j.Slf4j; | ||
| import org.flowable.engine.delegate.DelegateExecution; | ||
| import org.flowable.engine.delegate.JavaDelegate; | ||
|
|
||
| @Slf4j | ||
| public class WorkflowScheduleRunIdSetterListener implements JavaDelegate { | ||
| @Override | ||
| public void execute(DelegateExecution execution) { | ||
| if (execution.getVariable(WORKFLOW_SCHEDULE_RUN_ID_VARIABLE) != null) { | ||
| return; | ||
| } | ||
| UUID scheduleRunId = UUID.randomUUID(); | ||
| execution.setVariable(WORKFLOW_SCHEDULE_RUN_ID_VARIABLE, scheduleRunId); | ||
| LOG.debug( | ||
| "[SCHEDULE_RUN_ID_SET] ProcessInstance: {} - scheduleRunId: {}", | ||
| execution.getProcessInstanceId(), | ||
| scheduleRunId); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.