fix(alerts): retire the nine EventType values no emitter produces - #33033
Conversation
🔄 Playwright impact map auto-refreshedThis PR touched specs or UI source that changed the source→spec routing map. I regenerated 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 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 |
Code Review ✅ ApprovedRetires nine orphaned 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 |
|
| 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
|
|
✅ Playwright Results — workflow succeededValidated commit ✅ 4486 passed · ❌ 0 failed · 🟡 2 flaky · ⏭️ 1 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) 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:
🟡 2 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 |



Fixes #29039
Nine
EventTypevalues have no emitter onmain. They are offered in the alert builder, accepted bythe API and stored on subscriptions, but no
change_eventrow can ever carry them, so an alertfiltering 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.
mainonly, no backport:2.0still emits two of these values, and a release branch keeps its wirevocabulary.
What is being removed, and why each is safe
taskCreated,taskUpdatedsuggestion*SuggestionsResource. Zero references onmainand on2.0.taskResolved,taskClosedFeedRepository,FeedResource,FeedUtil,FeedResourceITand the legacyfeed_mixintask methods, and noThreadType.Taskcreator remains.taskResolvedandtaskClosedare the user-visible half.ResourceEventTypes.LEGACY_TASK_EVENTSstill 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:
Task lifecycle is
entityCreated/entityUpdatedonentityType = tasklike any other entity.No migration
Subscriptions store event types as plain text, in the rule
conditionand inarguments[].input(typed in the schema as an array of string).
AlertsRuleEvaluator.matchAnyEventTypecompares rawstrings, so an alert holding a deleted value simply never matches, exactly as today. Verified after
the change: an alert whose filter carries
taskResolvedstillPOSTs (201),GETs (200) with thevalue round-tripped, and
PATCHes (200).Only three of the nine can appear in a stored row at all. Four of the
suggestion*never reachedchange_eventon any version, becauseSuggestionimplements neitherEntityInterfacenorThread, so 1.13'sFormatterUtil.extractChangeEventmatched no branch and returned null. Thesurvivors are
taskResolved/taskClosedfrom a 1.13 or 2.0 upgrade, andsuggestionDeletedfrom1.13 only.
Why the tolerant reads are in the same PR
Deleting a value makes the generated
@JsonCreatorthrow for any surviving row, whichJsonUtils.readValueturns 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
eventTypethebuild does not declare:
.../eventsRecord.../diagnosticInfo(both variants).../listEvents?limit=15(the UI's default).../listSuccessfullySentChangeEvents.../failedEvents,.../listAllFailedEventsRetention bounds how long such a row lives, and that cleanup cannot be disabled:
cleanChangeEventsruns unconditionally andchangeEventRetentionPeriodhasminimum: 1. But ithas no maximum, so a ninety-day or one-year retention policy stretches the window with it, and
these six are the last unguarded
ChangeEventreaders in the service, so one unreadable row fromany cause already fails these endpoints today.
AbstractEventConsumerandAuditLogConsumerbothskip such a row; these six did not.
The new
ChangeEventJsonUtils.readOrNullreturns null and logs a warning instead of throwing. Thefour
EventSubscriptionSchedulerstream sites filter the nulls out; the twoAccessControlDAOsrowmappers cannot skip a row, so they return a degraded one, keeping the
statusandtimestampcolumns 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:
listSuccessfullySentChangeEventsreturned 49 of 50, and
listEventsreturned all 15 with 2 degraded and the rest intact.Tests
ResourceEventTypesTest.declaredAndUnreachableTogetherCoverTheWholeEnumis the lockstep guard andstays green untouched: it fails the build for any
EventTypethat is neither declared by a resourcenor 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 acrossResourceEventTypesTest,ChangeEventJsonUtilsTest,AccessControlDAOsMapperTestsrc/utils/Alerts,src/components/Alerts,src/pages/AddNotificationPage,src/components/observability/Alerts: 341/341 in 31 suitesopenmetadata-integration-testsbuilds;spotlesscleanNotes for review
enumandjavaEnumsinchangeEventType.jsonare index-paired. Both were edited in lockstep andthe pairing was asserted programmatically; the generated enum was inspected to confirm no surviving
constant shifted onto another value's string.
$refclosure, mirroring feat(rdf): SPARQL playground, MCP knowledge-graph tools, insights endpoints #28042 which addedthe ontology values to the same nine files.
entityFieldsChangedis deliberately untouched. It is dead as alert vocabulary but alive as aninternal
PutResponsemarker at 21 call sites, and needs the refactor described in Retire orphan EventType values: taskCreated, taskUpdated, taskResolved, taskClosed and the five suggestion* values (entityFieldsChanged needs a refactor first) #29039 first.