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

   ## What changed
   
   - Added explicit v2 audit mappings for all known `OperationType` values in 
`CompatibilityUtils`
   - Expanded `AuditLog.Operation` with the concrete audit operation values 
needed by v2
   - Added tests to verify:
     - concrete mappings for newly covered operation types
     - all known `OperationType` values map to a non-unknown audit operation
   
   ## Why
   
   The previous v2 compatibility mapping only covered part of the listener 
operation space.
   Many supported operations still fell back to `UNKNOWN_OPERATION`, which made 
audit output incomplete and inconsistent.
   
   This change makes v2 audit mapping complete for all known operation types 
and keeps `UNKNOWN_OPERATION` reserved for truly unknown inputs only.
   
   ## How it was tested
   
   ```bash
   IT_SPARK_HOME=/Users/fanng/deploy/demo/spark-3.5.3-bin-hadoop3 
   IT_SPARK_ARGS='--conf 
spark.jars=/Users/fanng/deploy/demo/jars/iceberg-spark-runtime-3.5_2.12-1.9.2.jar,/Users/fanng/deploy/demo/jars/iceberg-aws-bundle-1.9.2.jar
 --conf 
spark.sql.extensions=org.apache.iceberg.spark.extensions.IcebergSparkSessionExtensions
 --conf spark.sql.catalog.rest=org.apache.iceberg.spark.SparkCatalog --conf 
spark.sql.catalog.rest.type=rest --conf 
spark.sql.catalog.rest.uri=http://127.0.0.1:9001/iceberg/ --conf 
spark.sql.catalog.rest.header.X-Iceberg-Access-Delegation=vended-credentials' \
   IT_TABLE_IDENTIFIER=rest.ab.a1 \
   GRAVITINO_ENV_IT=true \
   ./gradlew :core:test -PskipIT=true --tests 
'org.apache.gravitino.audit.v2.TestCompatibilityUtils'
   ```
   
   ## Risks / follow-ups
   
   - `AuditLog.Operation` is still shared with legacy audit code, so this 
change expands the enum surface beyond the legacy formatter coverage.
   - If new `OperationType` values are added later, the new guard test should 
fail until the mapping is updated.
   


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