laserninja opened a new pull request, #12865:
URL: https://github.com/apache/gravitino/pull/12865

   ### What changes were proposed in this pull request?
   
   - Add `SemanticModelInfo` (immutable listener payload) under 
`org.apache.gravitino.listener.api.info`.
   - Add pre / success / failure event types under 
`org.apache.gravitino.listener.api.event.semantic` for **list**, **load**, 
**create**, **alter**, and **drop** Semantic Models, mirroring the existing 
view events. `ListSemanticModelEvent` implements `ListEvent` and reports the 
result count.
   - Add `SemanticModelEventDispatcher` to publish those events on the 
`EventBus`.
   - Wire `GravitinoEnv` so the chain is `SemanticModelEventDispatcher` -> 
`SemanticModelNormalizeDispatcher` -> `SemanticModelOperationDispatcher`, 
replacing the `TODO(#12595)`.
   - Add `CREATE/ALTER/DROP/LOAD/LIST_SEMANTIC_MODEL` operation types plus 
audit mappings on both audit paths: `AuditLog.Operation.fromEvent` (v1) and 
`CompatibilityUtils` (v2).
   - Add `TestSemanticModelEvent`; extend `TestOperation` and 
`TestCompatibilityUtils`.
   
   `semanticModelExists` gets no dedicated event, consistent with `viewExists` 
/ function behavior. Ownership and privilege hooks are out of scope (#12594).
   
   ### Why are the changes needed?
   
   Semantic Model CRUD did not emit listener events, so `EventListenerPlugin` 
implementations could not observe those operations and audit classified them as 
`UNKNOWN_OPERATION`. The parent [design 
doc](https://github.com/apache/gravitino/blob/main/design-docs/gravitino-semantic-model-design.md#events)
 specifies that list, load, create, alter, and drop emit pre, success, and 
failure events, with rename represented as an alter event.
   
   Fix: #12595
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes, for operators and integrations: event listeners and audit pipelines now 
see Semantic Model list/load/create/alter/drop and their failures with concrete 
audit operation types. No REST or Java client API changes.
   
   ### How was this patch tested?
   
   - `./gradlew :core:test --tests 
org.apache.gravitino.listener.api.event.TestSemanticModelEvent --tests 
org.apache.gravitino.audit.TestOperation --tests 
org.apache.gravitino.audit.v2.TestCompatibilityUtils -PskipITs` - 30 tests, all 
pass.
   - Full `./gradlew :core:test -PskipITs` - 1823 tests, 0 failures.
   - `./gradlew :core:javadoc` and `:core:spotlessCheck` clean.
   
   The pre-existing `testAllKnownOperationTypesMapToConcreteAuditOperation` 
guard in `TestCompatibilityUtils` covers the new operation types, so the 
mapping cannot silently regress to `UNKNOWN_OPERATION`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to