Repository navigation
fix(governance): validate workflow edge conditions and node references (1.13) - #32371
Conversation
Restrict the values interpolated into conditional-edge Flowable JUEL
expressions (${from_result == 'condition'}) to a well-formed character set.
- Add WorkflowExpressionValidator with the allowed patterns.
- Validate the condition and source node of conditional edges at the
create/update boundary in WorkflowDefinitionRepository; unconditional
edges keep the broader entityName contract.
- Guard expression construction in Edge as a defense-in-depth check.
- Add pattern/maxLength on edge condition and length bounds on from/to.
- Add unit tests for the validator, Edge, and repository validation.
❌ 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 |
…ss-test delete race
Fixes the last family of failures on the mysql lanes, and most of what is left
on postgres-opensearch. Symptom is one of:
Api <entityService> instance for <uuid> not found
Cannot invoke "EntityReference.getFullyQualifiedName()" because
the return value of "Dashboard.getService()" is null
Single root cause: service-backed entity ITs create a fresh service per entity,
so an unqualified listEntities returns rows belonging to sibling tests. When a
sibling's @AfterEach hard-deletes its service mid-list, server-side hydration of
that row's service ref either throws or yields null.
BaseEntityIT gains a getEntityServiceFqn hook (default null, so non-service
entities are unaffected) and pins every unqualified list call to the entity's own
service. Service-backed subclasses override it. Also bumps the hard-delete
visibility wait from 15s to 45s for the change-event pipeline on the
pg-es-redis parallel lane, and waits for accepted async bulk entities before
asserting on them.
Taken from PR #32340 byte for byte, except for two classes it does not cover:
- PipelineResourceIT: same 7-line override; it hits the identical error and is
the class that failed on the postgres-opensearch lane.
- DashboardResourceIT: same override, plus test_listDashboardsByService listed
unscoped with limit=100 and then dereferenced getService() on every returned
row. It builds its own ListParams, so the base-class hook cannot reach it —
scoped the call to the service the test created, which is what a test of that
name was already meant to do. Swept the module for the same shape; this was
the only other instance (DatabaseSchemaResourceIT already scopes via
setDatabase).
AuditLogResourceIT and RecognizerFeedbackRepositoryTest are pre-existing
failures on 1.13 unrelated to this branch (both also fail on #32373, the latter
also on #32371); their #32340 fixes are included since they are test-only.
Verified: test-compile and spotless clean across the module.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The openmetadata-service unit lane is red on every 1.13 PR, not just this one: 8 failures on #32400, #32371 and #32373. This branch already showed 6 — a strict subset, the other 2 (AuthenticationCodeFlowHandlerTest) having been fixed by #32408 landing on the base. Nothing here was caused by this branch; these are the remaining 6. Three assert against entities and fields that only exist on main/2.0, having been backported wholesale: - IndexMappingNestedFieldConsistencyTest asserted mappings for auditReport, aiApplication, llmModel and aiGovernance. None of those entities exist on 1.13. - SearchIndexFactoryTest asserted page reindex fields include "parent"; page hierarchy is main-only. - SearchRepositoryBehaviorTest expected the column child index to be aliased cluster_column_search_index; on 1.13 it is cluster_tableColumn. EntityCsvTest covers domain/data-product validation on bulk edit. SearchRepositoryBehaviorTest also gains a test for an EXTERNAL_HANDLER-only change emitting no child-update call, which needs the accompanying SearchRepository fix: appendUpdate/appendDelete/appendCreate appended a separator unconditionally, so a propagation whose switch branch deliberately emits nothing (certification, driven by propagateCertificationTags) produced a whitespace-only script that still fired updateChildren against every child index. The three guards only append the separator when the branch actually wrote something. That makes two product changes on this branch: the TestCaseRepository null/EntityNotFound guard and these three separator guards. Everything else is test-only. Verified locally: EntityCsvTest 63, SearchIndexFactoryTest 200, SearchRepositoryBehaviorTest 115, IndexMappingNestedFieldConsistencyTest 4 — 382 tests, 0 failures, 0 errors. Spotless clean. Taken from PR #32340 byte for byte. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Code Review ✅ Approved 1 resolved / 1 findingsBackport adds validation for governance workflow edge conditions and node references to prevent injection into Flowable expressions, with server-side patterns, repository-boundary checks, and JSON schema constraints. Stricter condition/node rules may reject existing workflows on update if they contain now-disallowed characters (e.g. ✅ 1 resolved✅ Edge Case: Stricter condition/node rules may reject existing workflows on update
OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|



Backport of #32326 to
1.13.Describe your changes
Governance workflow edge
conditionvalues and node references are interpolated into the Flowable sequence-flow expressions that drive conditional transitions (${from_result == 'condition'}). This PR restricts those values so only well-formed input is accepted.WorkflowExpressionValidatorwith the allowed patterns (a condition must be empty — unconditional — or contain at least one alphanumeric plusspace . _ -; a conditional edge's source must be an identifier).WorkflowDefinitionRepository(rejected with a clear400). Unconditional edges are untouched, so node names keep the broaderentityNamecontract.Edgeas a defense-in-depth check.edge.json:pattern/maxLengthoncondition(aligned with the server-side validator) andminLength/maxLengthonfrom/to.No change to the generated BPMN for valid workflows (the expression string is identical), so no redeploy/migration is required.
Type of change
Tests
WorkflowExpressionValidatorTest,EdgeTest,WorkflowDefinitionRepositoryEdgeSafetyTest.Checklist