lasdf1234 opened a new pull request, #14956:
URL: https://github.com/apache/gravitino/pull/14956
### What changes were proposed in this pull request?
`JobRuntimeTemplateMaskUtils.maskSensitiveJobConf(null)` now returns an
empty map instead of `null`, so `RunJobPreEvent` / `RunJobEvent`
(`ImmutableMap.copyOf`) no longer NPE when `JobEventDispatcher.runJob(...,
null)` builds events.
Also updates `TestJobRuntimeTemplateMaskUtils` and adds a
`JobEventDispatcher` regression for the null `jobConf` path.
Supersedes #14817 (same fix, addresses review: update old test, document
empty-map intent, add dispatcher coverage).
### Why are the changes needed?
Fixes #14775. REST already maps missing `jobConf` to `emptyMap()`; the event
path did not, so a null masked map aborted dispatch before the job was created.
### Does this PR introduce _any_ user-facing change?
No functional API change. Listeners now see an empty `jobConf` map instead
of failing when the caller passes `null` (intended; consistent with REST).
### How was this patch tested?
```
./gradlew spotlessApply :core:test \
--tests 'org.apache.gravitino.job.TestJobRuntimeTemplateMaskUtils' \
--tests
'org.apache.gravitino.listener.api.event.TestJobEventDispatcher.testRunJobWithNullJobConfEmitsEmptyMapOnEvents'
\
--tests
'org.apache.gravitino.listener.api.event.TestJobEventDispatcher.testRunJobEventMasksSensitiveJobConf'
\
-PskipITs -PskipDockerTests=true
```
Made with [Cursor](https://cursor.com)
--
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]