[Fix-18307][API] The frontend is correctly using the preferred values of the associated project for task creating and workflow scheduling#18308
Conversation
|
project preference values are not correctly applied when creating tasks: [DEBUG] restructureNodeData - Creating new task, applying project preferences Root Cause: Solution: |
There was a problem hiding this comment.
Pull request overview
This PR fixes the frontend’s use of project-level preference defaults so that workflow scheduling (and task creation defaults) correctly apply the project’s configured values (e.g., alert group) instead of falling back to null/empty values.
Changes:
- Update workflow scheduling modal to read the project preference alert group field consistently (
alertGroups) when defaultingwarningGroupId. - Fix task node initialization to correctly assign preference keys using computed property names when creating a new task.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| dolphinscheduler-ui/src/views/projects/workflow/definition/components/timing-modal.tsx | Aligns scheduling defaulting logic to use the correct project preference key for alert group selection. |
| dolphinscheduler-ui/src/views/projects/task/components/node/detail-modal.tsx | Fixes incorrect preference assignment during new task creation (computed key vs literal "item"), but introduces a broader assignment behavior change that should be constrained. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (!data?.id) { | ||
| for (const item in projectPreferences.value) { | ||
| if (projectPreferences.value[item] !== null && item in data) { | ||
| Object.assign(data, { item: projectPreferences.value[item] }) | ||
| if (projectPreferences.value[item] !== null) { | ||
| Object.assign(data, { [item]: projectPreferences.value[item] }) | ||
| } |
There was a problem hiding this comment.
Fix: use whitelist for project preference fields in task creation
- Replace
item in datacheck with explicit allowed fields list - Ensures project preferences are applied to new tasks even when initial data object is empty
- Prevents unrelated fields (tenant, alertGroups) from being added to task node model
- Whitelist includes: taskPriority, workerGroup, environmentCode, failRetryTimes, failRetryInterval, cpuQuota, memoryMax, timeoutFlag, timeoutNotifyStrategy, timeout
|



Was this PR generated or assisted by AI?
Yes.
Purpose of the pull request
close #18307
Brief change log
When scheduling the workflow, the frontend correctly applies the project's preference values.
Verify this pull request
This pull request is code cleanup without any test coverage.
(or)
This pull request is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(or)
Pull Request Notice
Pull Request Notice
If your pull request contains incompatible change, you should also add it to
docs/docs/en/guide/upgrade/incompatible.md