Backport #33393 to 2.0: make the test case and data contract scoping filters resolve what they scope by - #33569
Conversation
…filters resolve what they scope by
Code Review ✅ Approved🟡 Medium risk Backport of #33393 fixes three bugs in test case and data contract scoping filters for observability alerts on OptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
✅ Playwright Results — workflow succeededValidated commit ✅ 797 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 54m 21s ⏱️ Max setup 3m 4s · max shard execution 18m 39s · max shard-job elapsed before upload 21m 59s · reporting 5s 🌐 206.78 requests/attempt · 2.62 app boots/UI scenario · 29.67% common-shard skew Optimization targets still in progress:
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
Backport of #33393 (Fixes #31330, Fixes #33388, Fixes #33389) to
2.0.Problem
An observability alert can be narrowed with two filters: "test cases of these tables" and "data contracts of these entities". On
2.0both get it wrong:entityFQN, which for a column test is<table>.<column>, not the table. So an alert scoped to a table stays silent for its not null, unique and values-in-set tests, which are most of a real suite. This came in with fix(alerts): strict literal matching across alert filter functions #27987, which replaced a pattern match on the test case's own name with this exact comparison, so every2.0release has it.true, which means "deliver". A comment on a test case is sent to test case alerts, so an alert scoped to one table receives comments from every table.falsefor anything that is not a data contract, so a comment on a contract never reaches an alert scoped to that contract's entity.What this PR changes
The same as #33393. The table filter reads the table from the test case's
entityLink, which is how search and permission checks already find it. The data contract filter reads the contract'sentity. For a comment, both filters first look up the entity the comment is on, as the other scoping filters on this branch already do since #30571.How the backport was made
A cherry-pick of
eab033a919with one conflict, inAlertsRuleEvaluator.2.0has no separateConversationentity (that split, #30909, is onmainonly): a comment is aThreadevent, and the helper that finds what a comment is about is calledthreadSubject()rather thanfeedSubject(). So the new helper handlesTHREADonly and callsthreadSubject(). For the same reason, the new unit tests build their comment events as aThreadof typeConversation.Those are the only differences. Every other added and removed line matches #33393 exactly, and the integration test changes are identical.
What users will notice
Alerts that use the table filter start receiving column-level test events, and stop receiving comments from other tables' test cases. Expect the volume of those alerts to change.
How it was tested
spotless:checkclean.AlertUtilunit tests on this branch: 76 green, including the 20 new ones.2.0's current evaluator fail 7 of 11 (table filter) and 1 of 9 (data contract filter), with the same failures as onmain.AlertsRuleEvaluatorResourceITrun locally on this branch: 45 run, 0 failures, 1 skipped (the same skip as onmain).The PR is not yet safe to merge because direct events for UI-created data contracts can still be excluded by the entity-scoping filter, and the explicit Java and testing requirements must also be satisfied.
Findings
Summary
This backport changes observability-alert scoping to resolve test cases and data contracts from the entities they concern, including thread events.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD CE[ChangeEvent] --> ET{Entity type} ET -->|testCase or dataContract| DP[Use event payload] ET -->|thread| SR[Read thread subject reference] SR --> DB[Resolve subject entity] DP --> F{Scoping filter} DB --> F F -->|test case| EL[Parse entityLink for parent table FQN] F -->|data contract| RF[Read covered-entity FQN] EL --> CMP[Compare against configured FQNs] RF --> CMP CMP --> RESULT[Allow or reject alert delivery]Reviews (1) · Last reviewed commit: "Backport #33393 to 2.0: make the test ca..."