fix(workflows): GitHub Sink + event-based workflows silently reject all entities - #28451
fix(workflows): GitHub Sink + event-based workflows silently reject all entities#28451sonika-shah wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes a regression in event-based workflow trigger filtering where Elasticsearch-style JSON filter strings were incorrectly treated as “exclude everything” due to a missing boolean inversion, breaking sinks/approval workflows that rely on ES-query JSON rather than JsonLogic.
Changes:
- Restores the intended inverted interpretation of
RuleEngine.apply()results for excluded JSON filters viaapplyJsonFilter(...). - Extracts JSON-filter evaluation into a package-private static helper to make the behavior directly unit-testable.
- Adds focused unit tests to pin the ES-query (non-JsonLogic) fallback behavior and JsonLogic match/non-match cases.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/elements/triggers/impl/FilterEntityImpl.java | Restores/centralizes inverted JSON filter evaluation so non-JsonLogic inputs “pass through” excluded filtering. |
| openmetadata-service/src/test/java/org/openmetadata/service/governance/workflows/elements/triggers/impl/FilterEntityImplTest.java | Adds regression/unit coverage for applyJsonFilter including the ES-query JSON fallback path and JsonLogic behaviors. |
c91c9e5 to
f27041b
Compare
FilterEntityImpl.passesExcludedFilter() rejected every entity for
event-based workflows whose trigger filter is Elasticsearch query JSON
(rather than JsonLogic). The Boolean inversion (!) on the JSON-filter
result was missing, so the Git Sink, EventBased approval workflows,
and any user-built workflow with an ES-style filter took the
${!passesFilter} branch in their trigger BPMN and never invoked the
main workflow's CallActivity.
Before: passesJsonFilter = Boolean.TRUE.equals(RuleEngine.apply(...))
After: passesJsonFilter = !Boolean.TRUE.equals(RuleEngine.apply(...))
RuleEngine.apply() is documented to return false ("falls back to
triggering workflow") when filterLogic is not parseable as JsonLogic.
Event-based workflow filters carry Elasticsearch query DSL through
this path, so the consumer must treat any non-TRUE result as a pass.
Extracts the JSON-filter evaluation into a small private static helper
(applyJsonFilter) and adds five focused tests using the existing
reflection pattern in FilterEntityImplTest. The regression test
testApplyJsonFilterPassesWhenFilterIsNotJsonLogic pins the
event-based-trigger path and fails deterministically if the inversion
is ever removed again.
f27041b to
bf6c603
Compare
|
🟡 Playwright Results — all passed (11 flaky)✅ 4251 passed · ❌ 0 failed · 🟡 11 flaky · ⏭️ 88 skipped
🟡 11 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
|
Closing — this PR diagnosed the wrong layer. The actual root cause is in the Workflow Builder UI emitting Elasticsearch query DSL for event-based trigger filters, where the schema requires JsonLogic. Superseded by #28464, which fixes the UI to emit JsonLogic. |
Code Review ✅ ApprovedRestores the negated boolean check in FilterEntityImpl to correctly handle non-JsonLogic inputs in event-based workflows. Adds five unit tests to ensure proper coverage of the JSON filter evaluation logic. OptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |



Fix
Restore the
!inFilterEntityImpl.passesExcludedFilter()so non-JsonLogic filter input passes through correctly. Extract the JSON-filter evaluation into a smallapplyJsonFilterhelper so the behavior can be unit-tested.Why the
!is requiredRuleEngine.apply()returnsfalsewhenfilterLogiccannot be evaluated as JsonLogic — its catch branch is annotated "falls back to triggering workflow". Event-based workflow triggers pass Elasticsearch query DSL through this code path, so the consumer must treat any non-TRUEresult as "pass through". The!provides that semantic.Impact
Without the
!, every event-based workflow with an ES-style filter (Git Sink, EventBased approval, custom user workflows) is filtered out at the trigger gate:endEventin <100ms via the${!passesFilter}branchCallActivityto the main workflow is skippedACT_HI_PROCINSTshows only*Triggerrows; the main workflow never startsRegression source
The
!was originally added by #25272 ("Show Relevant Exclude Fields in EventBased Workflows") and inadvertently removed by #25894 ("Task redesign") — a 498-file refactor where this one-character change inFilterEntityImpl.java(+1/-1) was easy to miss in review.Why this wasn't caught by existing tests
FilterEntityImplTest— 17 existing tests, all targetingpassesFieldBasedFilter. The JSON-filter branch (passesJsonFilter/RuleEngine.apply) had no coverage.*IT.java) — verify workflows deploy correctly; they don't assert that a matching event drives the workflow to its terminal side effect.Tests added (same PR, existing reflection pattern)
Five new tests in
FilterEntityImplTestexerciseapplyJsonFiltervia reflection — same pattern used by the existing tests forpassesFieldBasedFilter. Uses the realRuleEngine(no mocks).testApplyJsonFilterPassesWhenFilterLogicIsNulltestApplyJsonFilterPassesWhenFilterLogicIsEmptytestApplyJsonFilterPassesWhenFilterIsNotJsonLogic— regression test; fails if!is removed againtestApplyJsonFilterExcludesWhenJsonLogicMatches— pins the "matching rule excludes" semantictestApplyJsonFilterPassesWhenJsonLogicDoesNotMatchVerification
CallActivity → sinkTask → endEventTest run:
mvn test -pl openmetadata-service -Dtest=FilterEntityImplTest→ 22/22 green (17 existing + 5 new). Verified end-to-end against a Git Sink workflow with an ES filter ondatabaseService/table/glossaryTerm.