Repository navigation
[2.1] Fixes #35456: Approval tasks preview and undo the whole cycle, and finish after their workflow is suspended - #39845
Open
gh-bot-collate[bot] wants to merge 1 commit into
Open
gh-bot-collate[bot] wants to merge 1 commit into
gh-bot-collate[bot] wants to merge 1 commit into
Conversation
…nish after their workflow is suspended (#38857) * Add integration tests for the approval task preview across a cycle * Record the version an approval cycle began from in the glossary approval payload schema * Move the approved baseline check out of RollbackEntityImpl so other workflow code can share it * Recompute the approval task preview from the version history at every task write * Add the decision record for the approval preview and mark the one it supersedes * Read the approval cycle history inside the preview guard so a failed read keeps the task's payload * Record an approval preview that could not read its whole cycle in the glossary approval payload schema * Compare the cycle's base version with the current one when the history walk cannot reach it, and mark a preview that still cannot * Warn on the Proposed Changes card when the approval preview could not read the whole cycle * Add integration tests for an approval preview whose cycle has a version missing from the history * Record the comparison fallback, the incomplete marker and the guarded read in the approval preview decision * Cover inherited references in approval history previews VersionDiff delegates list comparisons to MutationPlanner, which filters inherited references. Exercise a historical snapshot with inherited owners, reviewers and domains alongside a real edit. * Fix incomplete approval previews and opening baselines * Use governed approval history for preview and rejection * Include triggeringBots in approval history preview and rollback * Keep approval previews incomplete when prior ranges are unreadable * Restore unreviewed gaps on reject, let open tasks finish after suspend, preview CSV imports Incomplete cycle history: when the walk to the cycle base stops at a missing version or the 200 version cap and the base version is readable, preview and rejection now restore every reviewed field that differs between the base and the end of the gap, as a snapshot rollback would. A rejected task no longer leaves unreviewed content in place under a restored approval. Suspended or soft deleted workflows: suspending only stops new runs. The Flowable trigger definitions stay active, because a child run cannot complete while its parent definition is suspended; new runs are gated in FilterEntityImpl and FetchEntitiesImpl instead. A soft delete suspends instead of removing the deployment, a restore resumes it, and the lookups an open run uses to record stages and create or resolve its tasks include soft deleted workflows. Open tasks can be approved and rejected, rollbacks run, and later stages open. CSV import: an imported row records the fields it changed in the version change description, so version history, change events, trigger filters and the approval preview see it. Change request previews resolve references stored as id and type to the entity name. ADR 2026-11-27 decision 4 updated; ADR 2026-12-03 added. * Refuse manual starts and record no run while a workflow is suspended The suspend change keeps the trigger definitions active so open runs can finish. That left two gaps: triggerWorkflow started a run without the suspend check triggerByKey has, and every event or timer tick on a suspended workflow started a trigger run that did nothing but was still recorded as a run of the workflow. triggerWorkflow now refuses a suspended workflow, the triggerByKey check also covers a periodic trigger's per entity type process key, and WorkflowInstanceListener records no run for a trigger start while the workflow is suspended. Trigger process keys map to their main workflow through one TriggerFactory helper, which also keeps workflow names that contain a hyphen intact. * Keep a trigger run that started while its workflow was suspended stopped after a resume The start listener records no run for a trigger start while the workflow is suspended. The fetch and filter steps run later as their own jobs and checked the suspend state again, so a resume in between could start main runs that were never recorded. Both steps now honour the start listener's decision. * Stub the workflow definition lookup with Include.ALL in resolver and assignee tests The lifecycle resolver now reads workflow definitions with Include.ALL so a soft deleted workflow still resolves for its open tasks. These tests stubbed Include.NON_DELETED, so the lookup returned null: three cases failed and three passed only through the null fallback. * Address review: suspended workflow delivery, pre-upgrade priors, CSV import preview - Signal delivery and the change request listener count treat a start of a suspended workflow's trigger as suspended, so entity events start no trigger run and a change request delivered after a suspend is retried and requeued on resume. The filter checks suspension before reading the entity. - A soft delete with no open run undeploys as before; with open runs it still suspends. - A prior approval task whose run recorded no reviewed range carries the predecessor of its run's triggering edit, so a chain open at upgrade time keeps the earlier edit in review. - A CSV import stores the change description main records again; the approval cycle reads an import version against the version before it instead. - The trigger key maps to its workflow by stripping only a known entity type suffix. - WorkflowSuspendOpenTasksIT uses an active workflow as the sync point for the absence check. - ADR 2026-12-03 v3 and ADR 2026-11-27 v2 record these choices. * Check the workflow's main definition only for an active start subscription takesSignal now reads the process key only when the definition is active and the subscription starts a run, so a suspended definition or an open run's catch signal needs no key lookup. WorkflowSignalIsolationTest gives its active start definition a trigger key. * Mark the preview incomplete when a prior task's cycle start is unknown A task opened on 1.13 recorded neither a reviewed range nor its triggering edit, so the next task cannot see where the earlier cycle began. Its preview now shows its own cycle and is marked proposedChangesIncomplete. Change request runs record neither by design and are not counted. ADR 2026-11-27 decision 4 notes the case. --------- Co-authored-by: Ram Narayan Balaji <[email protected]> Co-authored-by: Ram Narayan Balaji <[email protected]> (cherry picked from commit 8df1410)
gh-bot-collate
Bot
requested review from
manerow and
sweta1308
and removed request for
a team
December 4, 2026 13:34
Author
|
🤖 This backport will not merge itself: |
13 tasks done
Contributor
|
🤖 This backport is red, so it will not merge itself. @Vamsi-klu Failing: The change is not on |
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Automated backport of #38857 to
2.1.8df1410f4cfa3247df68504df6d30f1ad7c86f05main.Opened from openmetadata-collate, which holds the credentials needed to open a PR here. It merges itself once this branch's required checks pass — no review needed. If a check fails it stays open and the author of #38857 is asked to look.
resolver run