Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-29784

DSL Job View shows many copies of Generated Items

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: job-dsl-plugin
    • Labels:
    • Environment:
      Job DSL plugin version 1.35
      Jenkins version 1.612
    • Similar Issues:

      Description

      I am creating a DSL job that creates and administrates the building of 3 other jobs. I want to watch the progress of each job's build, and when one finishes successfully, create the next job and kick off a build, then watch it and so on. I have done this successfully by creating 3 separate DSL scripts in the DSL job, which are separated by a groovy script in between that watches and waits for each job to finish as it is created and built. However, doing so creates multiple copies of "Generated Items" on the main view of the DSL job (picture attached). Based on what I can tell, it seems that if you create multiple jobs within one DSL script, this does not happen, but only when you create jobs with multiple different DSL scripts in the same DSL job.

      This is a small issue but eventually I hope to have a DSL job that created many more than just 3 other jobs, doing this would greatly clutter the DSL job's view. I hope this is an easy thing to fix!

      Thank you!

        Attachments

          Issue Links

            Activity

            thetaiter Ian Tait created issue -
            rtyler R. Tyler Croy made changes -
            Field Original Value New Value
            Workflow JNJira [ 164860 ] JNJira + In-Review [ 181716 ]
            lopatinik Nikita Lopatin made changes -
            Hide
            lopatinik Nikita Lopatin added a comment -

            Same here. I am using Jenkins v2.46.3 and Job DSL v1.63

            When I configure my seed job to generate other jobs depending on the items I checked from checkbox list, and then check more that one, I get copies of these "generated projects" list:

             

            This seed job is also generated by a dsl job, so I am using a following simple code in a .groovy script:

             

            // simple code
            job('projects_seed') {
                label('publisher')
                logRotator(-1, 10, -1, -1)
                parameters {
                    booleanParam('project1',false)
                    booleanParam('project2',false)
                    booleanParam('project3',false)
                    booleanParam('project4',false)
                    booleanParam('project5',false)
                }
                steps {
                    batchFile('svn checkout %REPO% %WORKSPACE% --username %SVN_USER% --password %SVN_PASS%')
                    conditionalSteps {
                            condition {booleanCondition ('${project1}')}
                            runner('DontRun')
                            steps {
                                dsl {
                                    external('jobs/project1.groovy')
                                }
                            }
                    }
                    conditionalSteps {
                        condition {booleanCondition ('${project2}')}
                        runner('DontRun')
                        steps {
                            dsl {
                                external('jobs/project2.groovy')
                            }
                        }
                    }
                    conditionalSteps {
                        condition {booleanCondition ('${project3}')}
                        runner('DontRun')
                        steps {
                            dsl {
                                external('jobs/project3.groovy')
                            }
                        }
                    }
                    conditionalSteps {
                        condition {booleanCondition ('${project4}')}
                        runner('DontRun')
                        steps {
                            dsl {
                                external('jobs/project4.groovy')
                            }
                        }
                    }
                    conditionalSteps {
                        condition {booleanCondition ('${project5}')}
                        runner('DontRun')
                        steps {
                            dsl {
                                external('jobs/project5.groovy')
                            }
                        }
                    }
                }
            
                publishers {
                    wsCleanup()
                }
                wrappers {
                    preBuildCleanup()
                    timestamps()
                    injectPasswords {
                        injectGlobalPasswords()
                    }
                }
            
            }
            

             

            One of the generated .groovy scripts generates more than one job if that means something. 

             

            This is not a critical problem, but kina hurts eyes a bit, so I'm looking forward to hear from you

             

            Show
            lopatinik Nikita Lopatin added a comment - Same here. I am using Jenkins v2.46.3 and Job DSL v1.63 When I configure my seed job to generate other jobs depending on the items I checked from checkbox list, and then check more that one, I get copies of these "generated projects" list:   This seed job is also generated by a dsl job, so I am using a following simple code in a .groovy script:   // simple code job( 'projects_seed' ) { label( 'publisher' ) logRotator(-1, 10, -1, -1) parameters { booleanParam( 'project1' , false ) booleanParam( 'project2' , false ) booleanParam( 'project3' , false ) booleanParam( 'project4' , false ) booleanParam( 'project5' , false ) } steps { batchFile( 'svn checkout %REPO% %WORKSPACE% --username %SVN_USER% --password %SVN_PASS%' ) conditionalSteps { condition {booleanCondition ( '${project1}' )} runner( 'DontRun' ) steps { dsl { external( 'jobs/project1.groovy' ) } } } conditionalSteps { condition {booleanCondition ( '${project2}' )} runner( 'DontRun' ) steps { dsl { external( 'jobs/project2.groovy' ) } } } conditionalSteps { condition {booleanCondition ( '${project3}' )} runner( 'DontRun' ) steps { dsl { external( 'jobs/project3.groovy' ) } } } conditionalSteps { condition {booleanCondition ( '${project4}' )} runner( 'DontRun' ) steps { dsl { external( 'jobs/project4.groovy' ) } } } conditionalSteps { condition {booleanCondition ( '${project5}' )} runner( 'DontRun' ) steps { dsl { external( 'jobs/project5.groovy' ) } } } } publishers { wsCleanup() } wrappers { preBuildCleanup() timestamps() injectPasswords { injectGlobalPasswords() } } }   One of the generated .groovy scripts generates more than one job if that means something.    This is not a critical problem, but kina hurts eyes a bit, so I'm looking forward to hear from you  
            daspilker Daniel Spilker made changes -
            Link This issue is duplicated by JENKINS-48223 [ JENKINS-48223 ]

              People

              • Assignee:
                daspilker Daniel Spilker
                Reporter:
                thetaiter Ian Tait
              • Votes:
                2 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: