Stop adding TimingAction in WorkflowRun$GraphL and let workflow-cps handle it instead#548
Draft
dwnusbaum wants to merge 2 commits into
Draft
Stop adding TimingAction in WorkflowRun$GraphL and let workflow-cps handle it instead#548dwnusbaum wants to merge 2 commits into
TimingAction in WorkflowRun$GraphL and let workflow-cps handle it instead#548dwnusbaum wants to merge 2 commits into
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
6 tasks
WorkflowRun$GraphL still needs to add TimingActionTimingAction in WorkflowRun$GraphL and let workflow-cps handle the action for all FlowNodes
TimingAction in WorkflowRun$GraphL and let workflow-cps handle the action for all FlowNodesTimingAction in WorkflowRun$GraphL and let workflow-cps handle it instead
jglick
approved these changes
Jul 14, 2025
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.
Requires jenkinsci/workflow-cps-plugin#1052 to be release first, and then when this is released, users need to make sure that
workflow-cpsis updated either before or at the same time that they update to this PR, otherwiseFlowStartNodewill end up without aTimingAction.While trying to write tests for jenkinsci/workflow-cps-plugin#1052 and #547, I realized that the way that
WorkflowRun$GraphLaddsTimingActionis almost totally redundant due toFlowHead.setNewHeadalready addingTimingAction. TheTimingActionaddition logic was added toFlowHead.setNewHeadin jenkinsci/workflow-cps-plugin#188, and then theifwas added to the logic here in #75 when picking up theworkflow-cpsPR in tests to avoid adding a secondTimingAction.The logic in
workflow-jobis almost totally unused now, sincesetNewHeadis responsible for callingnotifyNewHead, which is what notifiesGraphListeners, so it already handles almost all nodes. The only case that still matters isFlowStartNode, becausenewStartNodeis separate fromsetNewHead, andnewStartNodedoesn't addTimingAction. jenkinsci/workflow-cps-plugin#1052 now handlesFlowStartNodedirectly as of jenkinsci/workflow-cps-plugin@4241907.Testing done
I tested this PR against the new automated tests in jenkinsci/workflow-cps-plugin#1052, to ensure that with this PR and without the changes to
FlowHead.newStartNodein that PR, the new testCpsFlowExecutionTest.timingActionAlwaysAddedfails. (I could duplicate the same test here, but it seems clearest to test over inworkflow-cpssince that plugin is the one addingTimingAction.)Submitter checklist