Repository navigation
Fixes #37526: Share the web analytic event type hashes - #37563
Conversation
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
| // Event data rows are stored with the event type as their FQN, hashed the way @BindFQN hashes it. | ||
| public static String eventTypeHash(String eventType) { | ||
| return FullyQualifiedName.buildHash(eventType); | ||
| } | ||
|
|
||
| public static List<String> eventTypeHashes() { | ||
| return Arrays.stream(WebAnalyticEventType.values()) | ||
| .map(eventType -> eventTypeHash(eventType.value())) | ||
| .toList(); | ||
| } |
There was a problem hiding this comment.
⚠️ Quality: Event-type hash is now a cross-repo contract with no decision record
This PR turns the storage key of web analytic event rows into a public contract. eventTypeHash/eventTypeHashes are public static, and the description says they exist so that code reading entity_extension_time_series with SQL, including the downstream telemetry reader tested in another repo, uses the same value instead of computing it again ("readers inside and outside the repository share one definition"). That is a derived hash format another component has to agree with. No record in docs/decisions/ covers it. The checklist's "no durable decision; the stored hash is unchanged" is true about storage, but the change is that the hash is now promised to outside readers, and that promise only lives in the PR body, which a squash merge drops.
The record would say: Web analytic event data rows in entity_extension_time_series are keyed by FullyQualifiedName.buildHash(eventType), the MD5 of the quoted event-type value (e.g. PageView → 36c3c341bdf7ed4b36652d62d5cb14d7). Readers outside WebAnalyticEventRepository get it from eventTypeHash/eventTypeHashes, and changing it requires a data migration plus a coordinated change in downstream readers. WebAnalyticEventRepositoryTest can be named as its Guard. Cite it as ADR:<date>-<slug> in the comment above eventTypeHash.
Add docs/decisions/2026-11-11-web-analytic-event-rows-are-keyed-by-the-event-type-hash.md and cite it from the helper.:
// ADR:2026-11-11-web-analytic-event-rows-are-keyed-by-the-event-type-hash
// Event data rows are stored with the event type as their FQN, hashed the way @BindFQN hashes it.
public static String eventTypeHash(String eventType) {
return FullyQualifiedName.buildHash(eventType);
}
Was this helpful? React with 👍 / 👎
Code Review
|
| Compact |
|
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source
Describe your changes:
Fixes #37526
Follow-up to #37527. Web analytic event rows in
entity_extension_time_seriesare keyed by the hash of their event type (PageView,CustomEvent).WebAnalyticEventRepositorycomputed that hash inline in three places, and code that reads these rows with SQL had to compute it again on its own.This PR adds two public helpers to
WebAnalyticEventRepository:eventTypeHash(String eventType): the hash a row of that event type is stored under.eventTypeHashes(): the hashes of every event type.The repository's three listing methods now use
eventTypeHash, so readers inside and outside the repository share one definition instead of copying it.Nothing changes in what is stored or read: the helper calls the same
FullyQualifiedName.buildHashthe@BindFQNbinder uses when the rows are written.Type of change:
High-level design:
N/A, small change.
Tests:
Use cases covered
eventTypeHashes()covers every event type.Unit tests
WebAnalyticEventRepositoryTestpins the stored hashes ofPageViewandCustomEvent. If the hashing ever changes, this test fails, because existing rows would no longer be found.Backend integration tests
Ran
WebAnalyticEventRepositoryTest(2 passed) andPaginatedWebAnalyticEventDataSourceReadFailureTest(2 passed) locally.WebAnalyticEventResourceITruns in the merge queue.Manual testing performed
openmetadata-servicewith this change and ran the downstream telemetry reader's tests against it, including its MySQL and Postgres Testcontainers test.UI screen recording:
Not applicable: backend-only change.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.REVIEW.md(thepr-checklistskill runs it) and fixed every 🔴 finding, or answered it on the line below.Self-review at be3d178: two static helpers and three call sites switched to them, no findings.