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

   <!--
   1. Title: [#<issue>] <type>(<scope>): <subject>
      Examples:
        - "[#123] feat(operator): support xxx"
        - "[#233] fix: check null before access result in xxx"
        - "[MINOR] refactor: fix typo in variable name"
        - "[MINOR] docs: fix typo in README"
        - "[#255] test: fix flaky test NameOfTheTest"
      Reference: https://www.conventionalcommits.org/en/v1.0.0/
   2. If the PR is unfinished, please mark this PR as draft.
   -->
   
   ### What changes were proposed in this pull request?
   
   - Route job ID parsing in `JobMetaService`#`getJobByIdentifier`/`deleteJob` 
through `parseJobRunId` so malformed IDs throw `NoSuchEntityException` instead 
of runtime errors.
   - Fix the missing-job error message to include the actual identifier 
(`ident.toString()`).
   - Keep DB-backed tests as `@TestTemplate` so `BackendTestExtension` can 
inject the relational backend per invocation (required for H2/MySQL/PostgreSQL 
runs).
   
   ### Why are the changes needed?
   
   - Prevents StringIndexOutOfBoundsException/NumberFormatException from 
malformed job IDs and ensures callers get a consistent NoSuchEntityException.
   - The backend-injection extension only runs with `@TestTemplate`; using 
plain `@Test` would bypass it and leave the backend uninitialized.
   
   Fix: #9082
   
   ### Does this PR introduce _any_ user-facing change?
    - No API or behavior changes. Malformed job IDs now consistently return 
`NoSuchEntityException` instead of unexpected runtime errors, improving error 
consistency.
   
   ### How was this patch tested?
    - Added unit tests:
         - 
`TestJobMetaService`#`testGetJobWithMalformedIdentifierThrowsNoSuchEntityException`
         - 
`TestJobMetaService`#`testDeleteJobWithMalformedIdentifierThrowsNoSuchEntityException`
     - Formatting: ./gradlew :core:spotlessJavaCheck
     - Unit: ./gradlew :core:test --tests 
"org.apache.gravitino.storage.relational.service.TestJobMetaService"


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