fatmanverse commented on PR #12922: URL: https://github.com/apache/seatunnel/pull/12922#issuecomment-6515609136
Thanks @DanielLeens. Both points are addressed in 145ab764f. **Issue 2 (validation boundary).** `validatedSubmitJobsParams` now also rejects, before any job is submitted: - a `jobId` or `restoreSourceJobId` that is not a `long` (`'jobId' must be a long integer`), which `submitJobInternal` used to find only after the earlier entries were submitted; - a restore whose `restoreSourceJobId` is blank (`""` or `" "`), which `submitJobInternal` treated as missing. The method has a comment that lists these checks, says that `submitJobs` runs it for every entry before the first submission, and that failures depending on the job config or the cluster (an invalid job config, a missing savepoint) can still happen during submission. The `/submit-jobs` sections of the en/zh v1/v2 REST pages and the incompatible-changes entry say the same, so they no longer claim the batch is atomic. `JobInfoServiceSubmitJobsTest` covers `"abc"` and `"12x"` for both ids, a blank `restoreSourceJobId` for CHECKPOINT and SAVEPOINT, and that `"123"` is still accepted. **Issue 1 (RestApiIT).** Two new tests run against both the v1 (`/hazelcast/rest/maps/submit-jobs`) and the v2 (`/submit-jobs`) endpoint of the real cluster: - `testSubmitJobsUsesParamsAsGiven`: an entry without `params` and an entry with `jobName` `sales&ops 100%+x=y-<nanoTime>`; asserts HTTP 200, two results, the name returned exactly and the job listed under that name. - `testSubmitJobsRejectsAnInvalidLaterEntryBeforeSubmittingAny`: a valid first entry with a unique name, then a second entry with `"jobId": "abc"`, `restoreMode: CHECKPOINT` with `"restoreSourceJobId": "abc"`, or `isStartWithSavePoint: true` without `jobId`; asserts HTTP 400 and that no running or finished job has the first name. Before the change the first two cases also returned 400, but only after the first job was created. Verified on JDK 17: `seatunnel-engine-server` unit tests 709 run, 0 failures (5 skipped); `RestApiIT#testSubmitJobs*` 2/2. The previous Build on 98a2be8 failed on unrelated jobs (a Maven Central `Connection reset` on the Windows unit tests and an `EdgeSocketMysql8_4IT` thread check). -- 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]
