Repository navigation
[2.1] Fixes #38796: Let a workflow list the bots whose changes start it - #39005
Merged
Merged
Conversation
…8797) * Let a workflow list the bots whose changes start it Since 2.1 a bot's change never starts a governance workflow and is never held for approval. That keeps ingestion out of review queues, but blocks automation that exists to propose content for people to review. An eventBasedEntity trigger now lists, in triggeringBots, the bots whose changes start it: - WorkflowEventConsumer drops a bot's change before Flowable unless a workflow on the entity type lists the bot, and tags the change with the bot (triggeringBot variable). - FilterEntityImpl starts the run only for the workflows that list that bot. - ApprovalGate holds a listed bot's edit for the Enforce workflows that list it. - GovernanceApprovalRegistry's snapshot carries the lists, resolved to the users the bots write as. - Saving a workflow refuses an unknown bot, a system bot and an application's bot; only newly listed bots are checked. governance-bot never starts a workflow. - Workflow builder: a bot picker on the start node, listing only bots an admin created. The list is empty by default, so no stored workflow changes behaviour. * Refuse leftover application bots; show bot display names once loaded - A bot left behind by an uninstalled application keeps its "<AppName>Bot" name but loses the application's link, so it looked admin-created. Saving a workflow now also refuses a bot named for a marketplace or installed application, and the Triggering Bots picker hides it. - The picker kept showing a saved bot's raw name after the bot list loaded: useSyncedListData now relabels the selection when its label function changes. * Document the name-based application-bot rule; fetch app lists in parallel - The decision record now states how an application's bot is recognised: the installed application's link, or its "<application name>Bot" name for an installed or marketplace application, and why a leftover bot of an uninstalled application must be refused too. - The Triggering Bots picker fetches installed and marketplace applications concurrently. * Name the change's bot changedByBot; test a workflow listing two bots - A workflow lists several bots; a change has one author. The process variable that carries that author is now changedByBot (was triggeringBot), and the comments say so. - WorkflowTriggeringBotsIT: one Enforce workflow listing two bots holds both bots' edits as separate change requests. * Refresh listed bots when bots change; never gate workflow automation; cover the create flow - The registry snapshot's epoch now also fingerprints bot_entity, so a listed bot deleted and recreated with another bot user (or reassigned) is resolved again within the 5-second recheck, instead of only after a workflow definition is written. - ApprovalGate.rulesForActor returns no rules for workflow automation (governance-bot, or a user it impersonates), as the consumer already does, whatever a bot list holds. - Unit tests for the registry's bot lists (listing, suspended, Enforce, deleted bot, epoch), the trigger filter's bot check, and gate admission for listed bots and workflow automation. - IT for the flow the feature exists for: a bot listed on the seeded glossary term approval workflow creates a term, which goes to review; the asset link it adds is held and released when the term is approved. * Test workflow automation writing for a listed bot; merge the picker's fetch wrappers Covers the exact case from review: a listed bot impersonated by governance-bot is never held by the approval gate. The picker's two swallow-and-return-empty fetch helpers become one generic fetchAllPagesOrEmpty. (cherry picked from commit c6ee3a8)
gh-bot-collate
Bot
requested review from
yan-3005
and removed request for
a team
November 27, 2026 13:50
gh-bot-collate
Bot
requested review from
sweta1308
and removed request for
a team
November 27, 2026 13:50
Author
|
🤖 This backport will not merge itself: |
6 of 7 tasks
The approval registry snapshot now fingerprints bot_entity, so repository tests that build a partial schema need the table or every governed write reports the approval rules as unavailable.
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 #38797 to
2.1.c6ee3a8d2247ab839a31769b92c0f5052ba66604Resolution notes
Backport notes: #38797 → 2.1
Conflict
openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/WorkflowDefinitionRepository.javaconflicted only in the import block:
The rest of the file's hunks (the new
requireNewTriggeringBotsAllowed/triggeringBotsOfhelpers,the
prepareForCreateandgetUpdatercall sites) applied cleanly — the conflict was only in thisimport list.
Resolution
Kept only
import ...WorkflowTriggeringBots;, the import this PR actually introduces.Dropped
import ...elements.triggers.PeriodicBatchEntityTrigger;. That import, and thePeriodicBatchEntityTrigger.requireServerTimezone(...)call it supports inprepare(), are anunrelated, pre-existing main-only feature (periodic-batch-trigger server-timezone validation)
that predates PR #38797 — it's already present in the commit before c6ee3a8 on main. It showed
up in the cherry-pick's diff only as surrounding context, not as part of this PR's change. 2.1 has
no
PeriodicBatchEntityTrigger.requireServerTimezonemethod and no such validation inprepare(),so adding the import without the feature it supports would be dead/unused and out of scope for this
backport.
What to check by hand
WorkflowTriggeringBotscompiles/links against 2.1'sBotRepository/user model (the classitself came in clean via the cherry-pick as a new file,
Ain git status — not hand-edited here).PeriodicBatchEntityTrigger.requireServerTimezoneor otherwise assumes the periodic-batch-timezone feature is present on 2.1.
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 #38797 is asked to look.
resolver run