[JIRA] (JENKINS-37929) WorkUnitContext.actions does not populate for Pipeline steps

7 views
Skip to first unread message

alunsford@webassign.net (JIRA)

unread,
Sep 2, 2016, 10:16:02 AM9/2/16
to jenkinsc...@googlegroups.com
Aaron Lunsford created an issue
 
Jenkins / Bug JENKINS-37929
WorkUnitContext.actions does not populate for Pipeline steps
Issue Type: Bug Bug
Assignee: Jesse Glick
Components: pipeline
Created: 2016/Sep/02 2:15 PM
Environment: Jenkins v2.13
Priority: Major Major
Reporter: Aaron Lunsford

I found this while filing JENKINS-37809. It seems like WorkUnitContext objects created by Pipeline steps do not have their parameters storied in the .actions field. The plugin works by calling getCurrentWorkUnit() on a node's Executor, uses that WorkUnit's .context to get the WorkUnitContext object, then gets its parameters by referencing the .actions field. That field is populated for builds running on executors for Freestyle jobs, but does not for Pipeline jobs.

I don't really know much Java or understand the internal workings of Jenkins, so I'm afraid I can't supply much more detail than that. I put as many relevant details as I could in JENKINS-37809 and decided to file a bug with the main pipeline component, as it seems like that is where the underlying issue exists.

Thanks!

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

jglick@cloudbees.com (JIRA)

unread,
Sep 9, 2016, 4:44:04 PM9/9/16
to jenkinsc...@googlegroups.com
Jesse Glick updated an issue
Change By: Jesse Glick
Component/s: workflow-durable-task-step-plugin
Component/s: pipeline

jglick@cloudbees.com (JIRA)

unread,
Sep 9, 2016, 4:48:03 PM9/9/16
to jenkinsc...@googlegroups.com
Jesse Glick resolved as Not A Defect
 

A Pipeline node block creates a PlaceholderTask, which is distinct from the WorkflowJob that represents the project as a whole. I am not sure which Action you are looking for specifically, but I would not expect there to be any here. ParametersAction would be associated with the WorkflowRun, not a PlaceholderExecutable within it. Anyway it seems dubious that this is really what you should be basing decisions on. I am not sure what the freestyle feature is intended to accomplish but it possibly does not translate.

Change By: Jesse Glick
Status: Open Resolved
Resolution: Not A Defect

jglick@cloudbees.com (JIRA)

unread,
Sep 9, 2016, 4:53:03 PM9/9/16
to jenkinsc...@googlegroups.com
Jesse Glick commented on Bug JENKINS-37929
 
Re: WorkUnitContext.actions does not populate for Pipeline steps

Possibly there is just no API for this. SubTask has getOwnerTask, but Executable has no getOwnerExecutable. Would require a core change to have a place to even offer the link from a PlaceholderExecutable to a WorkflowRun.

alunsford@webassign.net (JIRA)

unread,
Sep 11, 2016, 12:38:03 PM9/11/16
to jenkinsc...@googlegroups.com

Hey Jesse, thanks for the response. The intended use case was to get the parameters and their values from the currently running builds in a pipeline project. WorkUnitContext.actions seemed to be the way to do that in the past, but it doesn't look like the api supports it for pipelines.

In any case, thanks for taking a look. Much appreciated.

yeluolei@gmail.com (JIRA)

unread,
Feb 1, 2020, 7:37:02 AM2/1/20
to jenkinsc...@googlegroups.com
Rurui Ye commented on Bug JENKINS-37929

this is still a blocking issue for jenkins, way does it resolved?

This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

yeluolei@gmail.com (JIRA)

unread,
Feb 1, 2020, 7:37:03 AM2/1/20
to jenkinsc...@googlegroups.com
Rurui Ye reopened an issue
 
Change By: Rurui Ye
Resolution: Not A Defect
Status: Resolved Reopened

jglick@cloudbees.com (JIRA)

unread,
Feb 3, 2020, 10:47:04 AM2/3/20
to jenkinsc...@googlegroups.com
Jesse Glick resolved as Not A Defect
 

Rurui Ye see above comments. Jenkins is behaving as designed.

Change By: Jesse Glick
Status: Reopened Resolved
Resolution: Not A Defect
Reply all
Reply to author
Forward
0 new messages