[FLINK-39310][web-ui] Use programArgsList in JSON body instead of program-args query parameter#27825
Open
daguimu wants to merge 1 commit intoapache:masterfrom
Open
[FLINK-39310][web-ui] Use programArgsList in JSON body instead of program-args query parameter#27825daguimu wants to merge 1 commit intoapache:masterfrom
daguimu wants to merge 1 commit intoapache:masterfrom
Conversation
Collaborator
…gram-args query parameter The Web UI's jar.service.ts was using the deprecated program-args query parameter (string) instead of sending programArgsList (string array) in the JSON request body, which is incompatible with the Flink 2.0 REST API. This change updates both runJob() and getPlan() to: - Send parameters via JSON request body with correct field names matching JarRunRequestBody/JarRequestBody (entryClass, programArgsList, parallelism, savepointPath, allowNonRestoredState) - Parse program arguments string into a string array (programArgsList) with proper handling of quoted arguments - Switch getPlan() from GET with query params to POST with JSON body - Fix pre-existing bug where savepointPath query param was incorrectly set to programArgs value instead of savepointPath - Send parallelism as integer and allowNonRestoredState as boolean to match server-side types Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
7b0c21f to
86f7d53
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Web UI's
jar.service.tsuses the deprecatedprogram-argsquery parameter (string) instead of the Flink 2.0 REST API'sprogramArgsList(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 expectsprogramArgsListin the request body.Additionally, there was a pre-existing bug where the
savepointPathquery parameter was incorrectly set to theprogramArgsvalue instead of the actualsavepointPath.Root Cause
Both
runJob()andgetPlan()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 byJarRunRequestBody/JarRequestBody(programArgsList,entryClass, etc.).Fix
Updated both
runJob()andgetPlan()injar.service.tsto:JarRunRequestBody/JarRequestBodyclasses:entryClass,programArgsList,parallelism,savepointPath,allowNonRestoredStatestring[](programArgsList) with proper handling of single and double quoted argumentsgetPlan()from GET to POST with JSON body (both are supported by the server, POST is recommended per API docs)programArgsparallelismas integer andallowNonRestoredStateas boolean to match server-side expectationsTests
The Flink web-dashboard Angular project has
skipTests: trueconfigured globally and no test framework (no Karma/Jest config, no.spec.tsfiles). Therefore:tsc --noEmit)JarRequestBody.javaandJarRunRequestBody.javaJarRunHandlerParameterTest,JarPlanHandlerParameterTest,JarHandlerUtilsTest) already validate the REST API handling ofprogramArgsListImpact
jar.service.tsin the web-dashboardFixes FLINK-39310