Skip to content

Conversation

@kvermeulen
Copy link

Purpose of the pull request

Close #17534

Brief change log

When triggering a sub workflow, lookup all global parameters from the current, and any parent workflow instances and pass them along in the start param list of the trigger request of the sub workflow

Verify this pull request

This change added tests and can be verified as follows:

  • Added a new integration test for validating the fixed behaviour
  • Manually verified the change by using the test-case mentioned in issue #17534

Pull Request Notice

Pull Request Notice

This is my very first pull-request, so bear with me on this one. :-)

A colleague of mine opened the original issue. This PR fixes these erroneous workflows for us, but I'm not entirely sure if this is the correct approach taken. I'll try and follow-up to make sure this PR meets all coding conventions and fulfills all requirements. I'll do my best on taking the time on improving the implementation on any pointers/advice given, if the implementation in the PR is not entirely correct or does not cover all use-cases, but I can't make any promises there.

Thank you for reviewing.

@boring-cyborg
Copy link

boring-cyborg bot commented Oct 14, 2025

Thanks for opening this pull request! Please check out our contributing guidelines. (https://github.com/apache/dolphinscheduler/blob/dev/docs/docs/en/contribute/join/pull-request.md)

@ruanwenjun
Copy link
Member

3.3.1 has been closed, please submit PR to dev.

@kvermeulen
Copy link
Author

I tried rebasing this one on dev. Is this sufficient, or should I create an entire new PR?

@ruanwenjun
Copy link
Member

I tried rebasing this one on dev. Is this sufficient, or should I create an entire new PR?

No need to create a new PR.

@ruanwenjun ruanwenjun added this to the 3.3.2 milestone Oct 15, 2025
@ruanwenjun ruanwenjun added the bug Something isn't working label Oct 15, 2025
@kvermeulen kvermeulen force-pushed the Fix-17534 branch 2 times, most recently from fae1b0b to ff36be6 Compare October 15, 2025 07:29
@kvermeulen
Copy link
Author

Fixed the 3 issues detected by sonarqube

@SbloodyS SbloodyS modified the milestones: 3.3.2, 3.3.3 Oct 21, 2025
.environmentCode(workflowInstance.getEnvironmentCode())
// todo: transport varpool and local params
.startParamList(commandParam.getCommandParams())
.startParamList(mergeParams(asList(commandParam.getCommandParams(), globalParamsOfParents)))
Copy link
Member

Choose a reason for hiding this comment

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

We should merge the current workflow instance's command params, global params, varpool as the subworkflow instance's command param is enough, we don't need to find the parant global params here, since the parent global params should already exist in command params.

Copy link
Author

Choose a reason for hiding this comment

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

Sorry, I missed that indeed. Parent global params already exist in the command params. I'll update and remove the unnecessary code. Can you maybe verify if the order of merging the params is correct? Before I didn't include the varpool for instance.

I'll update my commit and force push on the PR. I don't know if this is best practice or if we'll loose trace of the previous change. However, I do like a code changes for a fix in a single commit. Makes it more concise maybe. But any advice here is also welcome.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 5, 2025

… varpool from current workflow instance, together with the workflow instances command params to the sub workflow
@kvermeulen kvermeulen requested a review from ruanwenjun November 5, 2025 19:44
@kvermeulen kvermeulen changed the title [Fix-17534][Service/Master] get global parameters from parent workflow instances and add them to start params list of the trigger request of a sub workflow [Fix-17534][Service/Master] add global parameters and varpool from current workflow instance and add them to start params list of the trigger request of a sub workflow Nov 5, 2025
@kvermeulen
Copy link
Author

Updated and corrected the title of the PR after receiving some review remarks from @ruanwenjun, who pointed out that only the global parameters and varpool of the current workflow instance, need to be passed when triggering a subflow. Global parameters from any parent workflow(s) will already be in the command params from the current workflow instance. (thanks for pointing out!)

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] [Service/Master] Global variables of sub-workflows not getting inherited by underlying sub-workflows

3 participants