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

Invoking properties / promotions / promotion twice results in inconsistent configuration

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      When creating jobs via DSL we run them though a chain of decorators, relying heavily on the intelligent append/replace behavior of dsl elements.

      This works fine e.g. for the archiveArtifacts publisher.

      However when one invokes the promotion call twice like this:

                  job.with {
                              properties{
                                          promotions {
                                                  promotion {
                                                          name "First promotion"
      //...
                                                  }
                                          }
                              } 
                  }
      
                  job.with {              
                              properties{
                                          promotions {
                                                  promotion {
                                                          name "Second promotion"
      //...
                                                  }
                                          }
                              }                 
                   }       
      

       
      The result is:

      • if one views the web ui confiuguration form only the "Second promotion" is displayed
      • if one views the Promotion Status (buildUrl/promotion/) for the build or for the whole job only the "First promotion" is displayed
      • there are two "Promotion Status" links in the job sidebar and two badges (or how you call that) on the job status page
      • there is only a single "Promotion Status" link and badge on the build status page

        Attachments

          Activity

          Hide
          jbochenski Jakub Bochenski added a comment -

          Merging the above code into a single promotions invocation fixes it:

                      job.with {
                                  properties{
                                              promotions {
                                                      promotion {
                                                              name "First promotion"
          //...
                                                      }
                                                      promotion {
                                                              name "Second promotion"
          //...
                                                      }
                                              }
                                  }                 
                       }       
          

          it's not that easy in our real setup though as the promotions are added by different parts of our code

          Show
          jbochenski Jakub Bochenski added a comment - Merging the above code into a single promotions invocation fixes it: job.with { properties{ promotions { promotion { name "First promotion" //... } promotion { name "Second promotion" //... } } } } it's not that easy in our real setup though as the promotions are added by different parts of our code
          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          Should be fixed by somebody as a part of JENKINS-44837

          Show
          oleg_nenashev Oleg Nenashev added a comment - Should be fixed by somebody as a part of JENKINS-44837

            People

            • Assignee:
              Unassigned
              Reporter:
              jbochenski Jakub Bochenski
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: