Skip to content

Backport #33393 to 2.0: make the test case and data contract scoping filters resolve what they scope by - #33569

Merged
mohityadav766 merged 1 commit into
2.0from
backport/33393-to-2.0
Sep 18, 2026
Merged

mohityadav766 merged 1 commit into
2.0from
backport/33393-to-2.0

Conversation

@manerow

@manerow manerow commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

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.0 both get it wrong:

  1. Column-level tests never match their table. The table filter compares the test case's 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 every 2.0 release has it.
  2. Comments on any test case pass the table filter. For anything that is not a test case the filter returns 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.
  3. The data contract filter never matches comments. It returns false for 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's entity. 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 eab033a919 with one conflict, in AlertsRuleEvaluator. 2.0 has no separate Conversation entity (that split, #30909, is on main only): a comment is a Thread event, and the helper that finds what a comment is about is called threadSubject() rather than feedSubject(). So the new helper handles THREAD only and calls threadSubject(). For the same reason, the new unit tests build their comment events as a Thread of type Conversation.

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:check clean.
  • The alert evaluator and AlertUtil unit tests on this branch: 76 green, including the 20 new ones.
  • Negative control: the new tests run against 2.0's current evaluator fail 7 of 11 (table filter) and 1 of 9 (data contract filter), with the same failures as on main.
  • AlertsRuleEvaluatorResourceIT run locally on this branch: 45 run, 0 failures, 1 skipped (the same skip as on main).

RetriggerConfidence Score: 4/5

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

  1. P1 Missing target FQN
  2. P2 Early return violates rule
  3. P2 Internal lookup is mocked
Summary

This backport changes observability-alert scoping to resolve test cases and data contracts from the entities they concern, including thread events.

  • Derives a test case's parent table from its entity link so column-level tests can match table scopes.
  • Resolves thread subjects before applying test-case and data-contract filters.
  • Adds focused unit and integration-test cases for direct events, thread events, prefix collisions, and unresolved subjects.
  • Direct UI-created data-contract events can still fail entity scoping because their target reference is not hydrated with an FQN.
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]
Loading

Reviews (1) · Last reviewed commit: "Backport #33393 to 2.0: make the test ca..."

@manerow
manerow requested a review from a team as a code owner September 18, 2026 09:11
@manerow manerow added safe to test Add this label to run secure Github workflows on PRs backend skip-pr-checks Bypass PR metadata validation check labels Sep 18, 2026
@gitar-bot

gitar-bot Bot commented Sep 18, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk

Backport of #33393 fixes three bugs in test case and data contract scoping filters for observability alerts on 2.0: column-level tests now match their table, comments on test cases no longer pass the table filter, and comments on data contracts now reach contract-scoped alerts. All unit and integration tests pass.

Review coverage

Rules No rules evaluated

Functional validation Not enabled · Set up

Auto-approval Not enabled · Set up

Options

Display: compact → Counting what did not apply, without listing it.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@github-actions

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit fb636eded16a36fe6ed98346e995a51fa7c64572 in Playwright run 35328280458, attempt 1.

✅ 797 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky

Performance

Blocking 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:

  • Common shard skew was 29.67% (convergence target: at most 15%).
  • Browser traffic was 206.78 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.62 per UI scenario (2173 boots / 829 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 146 0 0 0 0 0
✅ Shard chromium-02 160 0 0 0 0 0
✅ Shard chromium-03 152 0 0 0 0 0
✅ Shard chromium-04 147 0 0 0 0 0
✅ Shard data-asset-rules-01 65 0 0 0 0 0
✅ Shard domain-isolation-01 16 0 0 0 0 0
✅ Shard global-state-01 34 0 0 0 0 0
✅ Shard ingestion-01 32 0 0 0 0 0
✅ Shard reindex-01 5 0 0 0 0 0
✅ Shard search-01 11 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@mohityadav766
mohityadav766 merged commit ae08472 into 2.0 Sep 18, 2026
185 of 202 checks passed
@mohityadav766
mohityadav766 deleted the backport/33393-to-2.0 branch September 18, 2026 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants