daguimu opened a new pull request, #27825: URL: https://github.com/apache/flink/pull/27825
## Problem\n\nThe Web UI's `jar.service.ts` uses the deprecated `program-args` query parameter (string) instead of the Flink 2.0 REST API's `programArgsList` (string array) in the JSON request body. This causes JAR submission with program arguments to fail on Flink 2.0+ — arguments are silently ignored or rejected because the server expects `programArgsList` in the request body.\n\nAdditionally, there was a pre-existing bug where the `savepointPath` query parameter was incorrectly set to the `programArgs` value instead of the actual `savepointPath`.\n\n## Root Cause\n\nBoth `runJob()` and `getPlan()` methods were sending parameters via HTTP query parameters with incorrect names (`program-args`, `entry-class`) instead of using JSON request body fields with the correct names expected by `JarRunRequestBody`/`JarRequestBody` (`programArgsList`, `entryClass`, etc.).\n\n## Fix\n\nUpdated both `runJob()` and `getPlan()` in `jar.service.ts` to:\n\n- **Send parameters via JSON request bo dy** with field names matching the server-side `JarRunRequestBody`/`JarRequestBody` classes: `entryClass`, `programArgsList`, `parallelism`, `savepointPath`, `allowNonRestoredState`\n- **Parse program arguments** from a single input string into a `string[]` (`programArgsList`) with proper handling of single and double quoted arguments\n- **Switch `getPlan()` from GET to POST** with JSON body (both are supported by the server, POST is recommended per API docs)\n- **Fix savepointPath bug** where the query param value was incorrectly set to `programArgs`\n- **Correct types**: send `parallelism` as integer and `allowNonRestoredState` as boolean to match server-side expectations\n\n## Tests\n\nThe Flink web-dashboard Angular project has `skipTests: true` configured globally and no test framework (no Karma/Jest config, no `.spec.ts` files). Therefore:\n\n- Verified TypeScript compilation passes (`tsc --noEmit`)\n- Verified ESLint passes\n- Performed 3-round manual code review verifying fi eld names match `JarRequestBody.java` and `JarRunRequestBody.java`\n- Existing Java-side tests (`JarRunHandlerParameterTest`, `JarPlanHandlerParameterTest`, `JarHandlerUtilsTest`) already validate the REST API handling of `programArgsList`\n\n## Impact\n\n- Only affects `jar.service.ts` in the web-dashboard\n- Fixes JAR submission with program arguments on Flink 2.0+\n- Fixes the savepointPath bug that was silently breaking savepoint restore on job submission\n- No breaking changes — the server already accepts the JSON body format\n\nFixes FLINK-39310 -- 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]
