Skip to content

fix(alerts): retire the nine EventType values no emitter produces - #33033

Merged
manerow merged 3 commits into
mainfrom
cleanup/retire-orphan-event-types
Sep 9, 2026
Merged

fix(alerts): retire the nine EventType values no emitter produces#33033
manerow merged 3 commits into
mainfrom
cleanup/retire-orphan-event-types

Conversation

@manerow

@manerow manerow commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Fixes #29039

Nine EventType values have no emitter on main. They are offered in the alert builder, accepted by
the API and stored on subscriptions, but no change_event row can ever carry them, so an alert
filtering on one is a silent no-op. This deletes them from the vocabulary and makes the alert
diagnostics endpoints tolerate the historical rows that stop parsing as a result.

main only, no backport: 2.0 still emits two of these values, and a release branch keeps its wire
vocabulary.

What is being removed, and why each is safe

Values Why it is an orphan
taskCreated, taskUpdated Never emitted by any released version. Added to the vocabulary by the Task System Redesign (#25894) with no emitter ever wired. Absent from the 1.13 enum.
the five suggestion* Orphaned when #25894 folded suggestions into Tasks and deleted SuggestionsResource. Zero references on main and on 2.0.
taskResolved, taskClosed Their only producer was the legacy feed task API. #30909 (Conversation V2) deleted FeedRepository, FeedResource, FeedUtil, FeedResourceIT and the legacy feed_mixin task methods, and no ThreadType.Task creator remains.

taskResolved and taskClosed are the user-visible half. ResourceEventTypes.LEGACY_TASK_EVENTS
still advertised them for every entity resource, so the builder offered "Task Resolved" and
"Task Closed" for events nothing can fire. Confirmed on a running instance before the change:

GET /v1/events/subscriptions/notification/resources
glossaryTerm.supportedEventTypes -> [... , taskResolved, taskClosed]

Task lifecycle is entityCreated / entityUpdated on entityType = task like any other entity.

No migration

Subscriptions store event types as plain text, in the rule condition and in arguments[].input
(typed in the schema as an array of string). AlertsRuleEvaluator.matchAnyEventType compares raw
strings, so an alert holding a deleted value simply never matches, exactly as today. Verified after
the change: an alert whose filter carries taskResolved still POSTs (201), GETs (200) with the
value round-tripped, and PATCHes (200).

Only three of the nine can appear in a stored row at all. Four of the suggestion* never reached
change_event on any version, because Suggestion implements neither EntityInterface nor
Thread, so 1.13's FormatterUtil.extractChangeEvent matched no branch and returned null. The
survivors are taskResolved / taskClosed from a 1.13 or 2.0 upgrade, and suggestionDeleted from
1.13 only.

Why the tolerant reads are in the same PR

Deleting a value makes the generated @JsonCreator throw for any surviving row, which
JsonUtils.readValue turns into a 500. Six readers had no guard, all of them alert diagnostics,
none on the delivery path. Measured on a running instance by inserting one row whose eventType the
build does not declare:

Endpoint Before the guard After
.../eventsRecord 500 200
.../diagnosticInfo (both variants) 500 200
.../listEvents?limit=15 (the UI's default) 500 200
.../listSuccessfullySentChangeEvents 500 200
.../failedEvents, .../listAllFailedEvents 500 200

Retention bounds how long such a row lives, and that cleanup cannot be disabled:
cleanChangeEvents runs unconditionally and changeEventRetentionPeriod has minimum: 1. But it
has no maximum, so a ninety-day or one-year retention policy stretches the window with it, and
these six are the last unguarded ChangeEvent readers in the service, so one unreadable row from
any cause already fails these endpoints today. AbstractEventConsumer and AuditLogConsumer both
skip such a row; these six did not.

The new ChangeEventJsonUtils.readOrNull returns null and logs a warning instead of throwing. The
four EventSubscriptionScheduler stream sites filter the nulls out; the two AccessControlDAOs row
mappers cannot skip a row, so they return a degraded one, keeping the status and timestamp
columns and leaving the payload empty. That keeps pagination and counting stable and needs no call
site changes. Verified the guard drops a row and not a page: listSuccessfullySentChangeEvents
returned 49 of 50, and listEvents returned all 15 with 2 degraded and the rest intact.

Tests

ResourceEventTypesTest.declaredAndUnreachableTogetherCoverTheWholeEnum is the lockstep guard and
stays green untouched: it fails the build for any EventType that is neither declared by a resource
nor listed as unreachable. Three assertions that pinned the old reachability were updated, and two
new unit classes cover the guard with a retired-value payload.

  • mvn -pl openmetadata-service test: 19/19 across ResourceEventTypesTest,
    ChangeEventJsonUtilsTest, AccessControlDAOsMapperTest
  • UI jest over src/utils/Alerts, src/components/Alerts, src/pages/AddNotificationPage,
    src/components/observability/Alerts: 341/341 in 31 suites
  • openmetadata-integration-tests builds; spotless clean

Notes for review

@github-actions github-actions Bot added backend safe to test Add this label to run secure Github workflows on PRs labels Sep 9, 2026
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

🔄 Playwright impact map auto-refreshed

This PR touched specs or UI source that changed the source→spec routing map. I regenerated .github/playwright/impact-map.generated.json and pushed the diff to this branch.

- source entries: 553 → 553
- 0 added, 0 removed, 2 changed spec-list

Entries whose spec list changed:
  openmetadata-ui/src/main/resources/ui/src/components/Glossary/AddGlossaryTermForm/AddGlossaryTermForm.component.tsx
  openmetadata-ui/src/main/resources/ui/src/components/Modals/StyleModal/StyleModal.component.tsx

What is this file? It is the auto-generated half of Playwright's PR planner. It routes "if source X changes, run specs Y" by walking spec imports and cross-referencing getByTestId strings. Hand-authored routing in impact-map.json always wins on conflict.

What if I want to regenerate locally instead? Run this before pushing your next change to skip the bot commit:

python3 .github/scripts/generate_playwright_impact_map.py
git add .github/playwright/impact-map.generated.json
git commit --amend --no-edit  # or a separate commit

@gitar-bot

gitar-bot Bot commented Sep 9, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Retires nine orphaned EventType values that no emitter produces, making them safe no-ops in alert filtering. Adds tolerant reads to six alert diagnostics endpoints to handle historical rows with deleted event types, preventing 500 errors. No issues found.

Options

Display: compact → Showing less information.

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

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

⚠️ UI Checkstyle passed — lint findings in changed files

🔍 ESLint findings in this PR's files — 0 error(s), 1 warning(s)

Errors block the build. Warnings do not yet — they are rules whose backlog is still
being worked down, listed so this PR does not add to it. See docs/ui-code-quality-gate.md.

0 error(s), 1 warning(s) across 1 changed file(s).

Count Rule
1 openmetadata-imports/no-lower-layer-page-imports
All findings
Location Rule Message
🟡 src/utils/Alerts/AlertsUtil.test.tsx:38:1 openmetadata-imports/no-lower-layer-page-imports Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here.

Fix locally (fast - only checks files changed in this branch):

make ui-checkstyle-changed

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 70%
70.47% (95250/135158) 55.01% (56360/102436) 56.38% (18815/33367)

@sonarqubecloud

sonarqubecloud Bot commented Sep 9, 2026

Copy link
Copy Markdown

@sonarqubecloud

sonarqubecloud Bot commented Sep 9, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit ded139ad5e5e37d23fe304146b4331ae30d287b7 in Playwright run 34330436600, attempt 1.

✅ 4486 passed · ❌ 0 failed · 🟡 2 flaky · ⏭️ 1 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) 56m 9s

⏱️ Max setup 5m 19s · max shard execution 21m 6s · max shard-job elapsed before upload 24m 20s · reporting 16s

🌐 217.98 requests/attempt · 2.31 app boots/UI scenario · 41.07% common-shard skew

Optimization targets still in progress:

  • Common shard skew was 41.07% (convergence target: at most 15%).
  • Browser traffic was 217.98 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.31 per UI scenario (10913 boots / 4726 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard advanced-search-01 130 0 0 0 0 0
✅ Shard chromium-01 118 0 0 0 0 0
✅ Shard chromium-02 140 0 0 0 0 0
✅ Shard chromium-03 151 0 0 0 0 0
✅ Shard chromium-04 140 0 0 0 0 0
✅ Shard chromium-05 144 0 0 0 0 0
✅ Shard chromium-06 171 0 0 0 0 0
🟡 Shard chromium-07 167 0 2 0 0 0
✅ Shard chromium-08 151 0 0 0 0 0
✅ Shard chromium-09 149 0 0 0 0 0
✅ Shard chromium-10 193 0 0 0 0 0
✅ Shard chromium-11 133 0 0 0 0 0
✅ Shard chromium-12 144 0 0 0 0 0
✅ Shard chromium-13 136 0 0 1 0 0
✅ Shard chromium-14 161 0 0 0 0 0
✅ Shard chromium-15 171 0 0 0 0 0
✅ Shard chromium-16 174 0 0 0 0 0
✅ Shard chromium-17 163 0 0 0 0 0
✅ Shard chromium-18 152 0 0 0 0 0
✅ Shard chromium-19 168 0 0 0 0 0
✅ Shard chromium-20 173 0 0 0 0 0
✅ Shard chromium-21 147 0 0 0 0 0
✅ Shard chromium-22 185 0 0 0 0 0
✅ Shard chromium-23 137 0 0 0 0 0
✅ Shard chromium-24 190 0 0 0 0 0
✅ Shard chromium-25 178 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 import-export-01 76 0 0 0 0 0
✅ Shard import-export-02 74 0 0 0 0 0
✅ Shard ingestion-01 45 0 0 0 0 0
✅ Shard ingestion-02 41 0 0 0 0 0
✅ Shard reindex-01 28 0 0 0 0 0
✅ Shard search-01 12 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0
🟡 2 flaky test(s) (passed on retry)
  • Features/ContextCenterMemories.spec.tsArrowDown + Enter keyboard navigation selects the linked table result (shard chromium-07, 1 retry)
  • Pages/ExploreTree.spec.tsCopy field link should have valid URL format for APIEndpoint (shard chromium-07, 1 retry)

📦 Download artifacts

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

@manerow
manerow enabled auto-merge September 9, 2026 12:14
@manerow
manerow added this pull request to the merge queue Sep 9, 2026
Merged via the queue into main with commit 0333eda Sep 9, 2026
179 checks passed
@manerow
manerow deleted the cleanup/retire-orphan-event-types branch September 9, 2026 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

alerts and notifications backend cleanup Code clean up task json schema safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

3 participants