[JIRA] (JENKINS-61795) Jenkins remote access api doesn't provide the job name for pipeline jobs when getting the build queue

4 views
Skip to first unread message

tavolodobela@protonmail.com (JIRA)

unread,
Apr 3, 2020, 3:12:03 AM4/3/20
to jenkinsc...@googlegroups.com
Bela Tavolodo updated an issue
 
Jenkins / Bug JENKINS-61795
Jenkins remote access api doesn't provide the job name for pipeline jobs when getting the build queue
Change By: Bela Tavolodo
I try to query the jobs in the build queue by using /queue/api/json?pretty url. I get the result, however, it doesn't contain the names of the pipeline jobs in certain cases.

If a pipeline job has concurrent builds disabled then I get the following:

{{}}  
{code:java}
{
  "_class" : "hudson.model.Queue$BlockedItem",
  "id" : 319,
  "task" : {
    "_class" : "org.jenkinsci.plugins.workflow.job.WorkflowJob",
    "name" : "test-pipeline1"
  },
  "why" : "Build #1 is already in progress (ETA: N/A)"
},{code}
{{}}  

{{}}

{{}}
So far so good, I can see the job name (test-pipeline1). However, if concurrent builds are enabled, then there's no "name" reference in the json result. Note that the pipeline job below uses lockable resources. And while waiting for the given resource to be available I get the results below, without the job name.

 

 
{code:java}
{
"_class" : "hudson.model.Queue$BuildableItem",
"actions" : [

],
"blocked" : False,
"buildable" : True,
"id" : 334,
"inQueueSince" : 1585896210314,
"params" : "",
"stuck" : False,
"task" : {
"_class" : "org.jenkinsci.plugins.workflow.support.steps.ExecutorStepExecution$PlaceholderTask"
},
"url" : "queue/item/334/",
"why" : "Waiting for next available executor on 'pod-name'",
"buildableStartMilliseconds" : 1585896210315,
"pending" : False
},
{code}
 

So my question is how to get the job name in the build queue api call. Btw. I tested with the xml and python output as well, they both miss the job name.

 

 
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

tavolodobela@protonmail.com (JIRA)

unread,
Apr 3, 2020, 3:12:03 AM4/3/20
to jenkinsc...@googlegroups.com
Bela Tavolodo created an issue
Issue Type: Bug Bug
Assignee: Tobias Gruetzmacher
Components: core, lockable-resources-plugin
Created: 2020-04-03 07:11
Environment: Jenkins 2.222.1
Lockable resources plugin 2.7
Labels: api build-queue
Priority: Major Major
Reporter: Bela Tavolodo

I try to query the jobs in the build queue by using /queue/api/json?pretty url. I get the result, however, it doesn't contain the names of the pipeline jobs in certain cases.

If a pipeline job has concurrent builds disabled then I get the following:

{{}}

{
  
"_class" : "hudson.model.Queue$BlockedItem",
  "id" : 319,
  "task" : {
    "_class" : "org.jenkinsci.plugins.workflow.job.WorkflowJob",
    "name" : "test-pipeline1"
  },
  "why" : "Build #1 is already in progress (ETA: N/A)"
},
 
                                                            

{{}}

{{}}

{{}}So far so good, I can see the job name (test-pipeline1). However, if concurrent builds are enabled, then there's no "name" reference in the json result. Note that the pipeline job below uses lockable resources. And while waiting for the given resource to be available I get the results below, without the job name.

 

 

{
 
"_class" : "hudson.model.Queue$BuildableItem",
 "actions" : [
 
 ],
 "blocked" : False,
 "buildable" : True,
 "id" : 334,
 "inQueueSince" : 1585896210314,
 "params" : "",
 "stuck" : False,
 "task" : {
 "_class" : "org.jenkinsci.plugins.workflow.support.steps.ExecutorStepExecution$PlaceholderTask"
 },
 "url" : "queue/item/334/",
 "why" : "Waiting for next available executor on 'pod-name'",
 "buildableStartMilliseconds" : 1585896210315,
 "pending" : False
 },
 
                                                            

 

So my question is how to get the job name in the build queue api call. Btw. I tested with the xml and python output as well, they both miss the job name.

 

 

Reply all
Reply to author
Forward
0 new messages