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

Jenkins job created by seed job using jobdsl script does't shows JMS message checks on job UI.

    • Icon: Task Task
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • jms-messaging-plugin
    • None
    • jenkins version : 2.156 and 2.174

      job DSL Version : 1.72
      JMS version : 1.1.4

      I have Jenkins seed job which include DSL script for creating new jobs.

      in which i have passed JMS message checks, when seed job triggers it created job but not showing message checks on job UI, but it shows message checks in job/config.xml 

       

      DSL script includes following : 

      • checks {
      • msgCheck {
      • field(String value)
      • expectedValue(String value)}}
      • name(String value)
      • overrides { * [topic|https://platform-stg-jenkins.rhev-ci-vms.eng.rdu2.redhat.com/plugin/job-dsl/api-viewer/index.html#path/job-steps-ciMessageSubscriberBuilder-providerData-activeMQSubscriberProviderData-overrides-topic](String value)}
      • // JMS selector to choose messages that will fire the trigger.selector(String value) 

       

       

      Please see the attachment

        1. created-job_ui.png
          created-job_ui.png
          45 kB
        2. dsl_script.png
          dsl_script.png
          78 kB
        3. image-2019-05-24-10-28-55-246.png
          image-2019-05-24-10-28-55-246.png
          125 kB
        4. image-2019-05-24-10-29-04-077.png
          image-2019-05-24-10-29-04-077.png
          66 kB
        5. image-2019-05-24-10-32-46-026.png
          image-2019-05-24-10-32-46-026.png
          182 kB
        6. job_config.png
          job_config.png
          104 kB
        7. message-checks.png
          message-checks.png
          143 kB

          [JENKINS-57581] Jenkins job created by seed job using jobdsl script does't shows JMS message checks on job UI.

          Scott Hebert added a comment -

          I was not able to reproduce your issue.

          Here is the script I was using:

          pipelineJob("trigger") {
          
              definition {
          
                  parameters {
                      stringParam('CI_MESSAGE', '', 'contents of message')
                  }
          
                  triggers {
                      ciBuildTrigger {
                          providerData {
                              activeMQSubscriberProviderData {
                                  name("UMB")
                                  overrides {
                                      topic("Consumer.rh-jenkins-ci-plugin.8dad9900-abcdef.VirtualTopic.eng.brew.build.complete")
                                  }
                                  checks {
                                      msgCheck {
                                          field('$.info.extra.container_koji_task_id')
                                          expectedValue("\\d+")
                                      }
                                  }
                                  selector("mtype = 'scott'")
                              }
                          }
                          noSquash(true)
                      }
                  }
          
                  cps {
                      sandbox(false)
                      script("""
          node('master') {
            echo CI_MESSAGE
          }
          """)
                  }
              }
          }
          

          Here is my job config:

          Scott Hebert added a comment - I was not able to reproduce your issue. Here is the script I was using: pipelineJob( "trigger" ) { definition { parameters { stringParam( 'CI_MESSAGE' , '', ' contents of message') } triggers { ciBuildTrigger { providerData { activeMQSubscriberProviderData { name( "UMB" ) overrides { topic( "Consumer.rh-jenkins-ci-plugin.8dad9900-abcdef.VirtualTopic.eng.brew.build.complete" ) } checks { msgCheck { field( '$.info.extra.container_koji_task_id' ) expectedValue( "\\d+" ) } } selector( "mtype = 'scott' " ) } } noSquash( true ) } } cps { sandbox( false ) script(""" node( 'master' ) { echo CI_MESSAGE } """) } } } Here is my job config:

          sachin pathare added a comment - - edited

          scoheb,

          your using a Pipline script and I am using DSL script to create job, On my side also it shows in config.xml  file but not on the JOB UI. 

           

          See attachment

           

           

          Created job does't shows that mesg checks on the UI but it does shows in config.xml file : 

           

           

           

           

          Config.xml file for job shows mesg checks :

           

           

          sachin pathare added a comment - - edited scoheb , your using a Pipline script and I am using DSL script to create job, On my side also it shows in config.xml  file but not on the JOB UI.    See attachment     Created job does't shows that mesg checks on the UI but it does shows in config.xml file :          Config.xml file for job shows mesg checks :    

          reopening issue as still it exits have attached exact steps and screen for the issue 

          sachin pathare added a comment - reopening issue as still it exits have attached exact steps and screen for the issue 

          Scott Hebert added a comment -

          So 3 things.

          1. my script is not a pipeline script. it is a DSL script.
          2. You mis-spelled msgCheck.
          3. Using your method of configure is not correctly creating the CIBuildTrigger object in that Jenkins complains that it is missing a parameter from a class that CIBuildTrigger inherited.

           

          Here is my version of your DSL script that works for me:

           

          import groovy.json.JsonSlurper
          def uuid = UUID.randomUUID().toString()
          
          folder('test-job')  {
               description ('folder containing jobs for Rhel-8')
          }
          
          
          
          job("test-job/job-2") {
          	description()
          	keepDependencies(false)
            
              multiscm {
                git{
                  
                  remote{
                    url("https://gitlab.cee.redhat.com/g11n-qe/Rhel-8.0-Automation.git")
                  credentials ("demo-creds")
                    
                 
                }
                branch("*/master")
                }
              }
            
           //label('pooja-openqa')
          
          	disabled(false)
          	concurrentBuild(false)
          	steps {
          		shell("""sudo cp -R * /var/lib/openqa/tests/
          ls""")
               }
          triggers {
                      ciBuildTrigger {
                          providerData {
                              activeMQSubscriberProviderData {
                                          checks {       
                                            msgCheck { 
                                                	expectedValue("RHEL-7.7")
                                                  field("release-id")   
                                                  }
                                          }             
                                          name ("Red Hat UMB")
                                          overrides
                                                  {
                                                      topic("Consumer.rh-jenkins-ci-plugin."+uuid+".VirtualTopic.distill.compose-moved")
                                                  }
                                          selector("mtype =  'compose-moved' AND environment = 'prod' AND service = 'distill'")
                              }
                          }
                          noSquash(true)
                      }
                  }
                       
          
          }
          

          At this point, I will not be addressing any code changes for this issue. I am closing the ticket.

          Scott Hebert added a comment - So 3 things. my script is not a pipeline script. it is a DSL script. You mis-spelled msgCheck. Using your method of configure is not correctly creating the CIBuildTrigger object in that Jenkins complains that it is missing a parameter from a class that CIBuildTrigger inherited.   Here is my version of your DSL script that works for me:   import groovy.json.JsonSlurper def uuid = UUID.randomUUID().toString() folder('test-job') { description ('folder containing jobs for Rhel-8') } job("test-job/job-2") { description() keepDependencies(false) multiscm { git{ remote{ url("https://gitlab.cee.redhat.com/g11n-qe/Rhel-8.0-Automation.git") credentials ("demo-creds") } branch("*/master") } } //label('pooja-openqa') disabled(false) concurrentBuild(false) steps { shell("""sudo cp -R * /var/lib/openqa/tests/ ls""") } triggers { ciBuildTrigger { providerData { activeMQSubscriberProviderData { checks { msgCheck { expectedValue("RHEL-7.7") field("release-id") } } name ("Red Hat UMB") overrides { topic("Consumer.rh-jenkins-ci-plugin."+uuid+".VirtualTopic.distill.compose-moved") } selector("mtype = 'compose-moved' AND environment = 'prod' AND service = 'distill'") } } noSquash(true) } } } At this point, I will not be addressing any code changes for this issue. I am closing the ticket.

          Hey thank you very much scoheb, it solved my issue. 

          sachin pathare added a comment - Hey thank you very much scoheb , it solved my issue. 

            scoheb Scott Hebert
            spathare sachin pathare
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: