[Fix-18446][task-sql]Persist sqlSource and sqlResource fields when saving SQL task node - #18447
Open
nanxiuzi wants to merge 1 commit into
Open
[Fix-18446][task-sql]Persist sqlSource and sqlResource fields when saving SQL task node#18447nanxiuzi wants to merge 1 commit into
nanxiuzi wants to merge 1 commit into
Conversation
…saving SQL task node
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.
Summary
Fixes #18446
The SQL task node's "Resource File" mode (introduced in #18019) loses its
sqlSourceandsqlResourcevalues after saving — the node reverts to "Script" mode and the selected SQL file path is empty on reopen. The two form fields are defined inuse-sql.ts(lines ~65 and ~95) but are never written totaskParamsbyformatParams()informat-data.ts, so they are dropped on save.Changes
dolphinscheduler-ui/src/views/projects/task/components/node/format-data.ts: serializesqlSourceandsqlResourceintotaskParamsin the SQL branch offormatParams().dolphinscheduler-ui/src/views/projects/task/components/node/types.ts: declaresqlSource?: stringandsqlResource?: stringonITaskParams. Required becausestrict: trueis set intsconfig.json— otherwisevue-tsc --noEmit(part ofpnpm run build:prod) fails the type check ondata.sqlSourceandtaskParams.sqlSource.Backfill works automatically —
formatModel()already does...omit(data.taskParams, ['resourceList', 'mainJar', 'localParams']), so any field written intotaskParamsis transparently restored on edit. No backfill-side change needed.Verification
pnpm run build:prodpasses (vue-tsc type check + Vite production build).sqlSourceandsqlResourcepreserved. DevTools Network confirms"sqlSource":"FILE"and"sqlResource":"..."intaskDefinitionJson.taskParams.Reproduce steps (for reviewers)
.sqlresource file from the resource tree.