Skip to content

[Fix-18307][API] The frontend is correctly using the preferred values of the associated project for task creating and workflow scheduling#18308

Open
njnu-seafish wants to merge 6 commits into
apache:devfrom
njnu-seafish:Fix-18307
Open

[Fix-18307][API] The frontend is correctly using the preferred values of the associated project for task creating and workflow scheduling#18308
njnu-seafish wants to merge 6 commits into
apache:devfrom
njnu-seafish:Fix-18307

Conversation

@njnu-seafish

Copy link
Copy Markdown
Contributor

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

@njnu-seafish njnu-seafish requested a review from SbloodyS as a code owner June 1, 2026 13:10
@github-actions github-actions Bot added the UI ui and front end related label Jun 1, 2026
@njnu-seafish njnu-seafish changed the title [Fix-18307][API] The frontend is correctly using the preferred values of the associated project for workflow scheduling [Fix-18307][API] The frontend is correctly using the preferred values of the associated project for task creating and workflow scheduling Jun 2, 2026
@njnu-seafish

njnu-seafish commented Jun 2, 2026

Copy link
Copy Markdown
Contributor Author

project preference values are not correctly applied when creating tasks:

[DEBUG] restructureNodeData - Creating new task, applying project preferences
detail-modal.tsx:141 [DEBUG] restructureNodeData - Skipping taskPriority: value=HIGHEST, inData=false
detail-modal.tsx:141 [DEBUG] restructureNodeData - Skipping workerGroup: value=seatunnel, inData=false
detail-modal.tsx:138 [DEBUG] restructureNodeData - Applying environmentCode: 172144649035872

Root Cause:
The item in data check fails because the initial data object does not contain fields like taskPriority or workerGroup. These fields are only added later during the form component initialization.

Solution:
Remove the item in data check and directly assign the project preference values to the data object.

@SbloodyS SbloodyS requested a review from Copilot June 3, 2026 07:09
@SbloodyS SbloodyS added the bug Something isn't working label Jun 3, 2026
@SbloodyS SbloodyS modified the milestones: 3.4.2, 3.5.0 Jun 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 defaulting warningGroupId.
  • 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.

Comment on lines 132 to 136
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] })
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix: use whitelist for project preference fields in task creation

  • Replace item in data check 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

@SbloodyS SbloodyS requested a review from Copilot June 7, 2026 04:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@sonarqubecloud

sonarqubecloud Bot commented Jun 7, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working UI ui and front end related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] [API] The frontend is not correctly using the preferred values of the associated project for task creating and workflow scheduling.

3 participants