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

promotion conditions to support OR condition

    Details

    • Similar Issues:

      Description

      I have selected "Promote immediately once the build is complete based on build parameters" with:
      Parameter Name: ${AUTO_APPROVE}
      Parameter Value: true
      or
      Parameter Name: AUTO_APPROVE
      Parameter Value: true

      In the build,
      when Boolean paramter AUTO_APPROVE is set to true,
      the promotion job doesn't start.

        Attachments

        1. build-97.xml
          18 kB
        2. build-98.xml
          43 kB
        3. Selection_003.png
          Selection_003.png
          40 kB
        4. Selection_004.png
          Selection_004.png
          60 kB
        5. Selection_026.png
          Selection_026.png
          8 kB
        6. Selection_027.png
          Selection_027.png
          44 kB
        7. Selection_028.png
          Selection_028.png
          25 kB
        8. Selection_029.png
          Selection_029.png
          26 kB

          Activity

          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          t should work well according to the code. Could you please provide full build.xml file?

          Show
          oleg_nenashev Oleg Nenashev added a comment - t should work well according to the code. Could you please provide full build.xml file?
          Hide
          totoroliu Rick Liu added a comment - - edited

          Attached build.xml

          build-97 is a rebuild from build#96.
          build-97 is a fresh clean build.

          Both have the same issue.

          Show
          totoroliu Rick Liu added a comment - - edited Attached build.xml build-97 is a rebuild from build#96. build-97 is a fresh clean build. Both have the same issue.
          Hide
          totoroliu Rick Liu added a comment - - edited

          Hi Oleg~

          After some job config cleanup and retry,
          now I'm able to see:
          *******************
          Met Qualification
          Automatically promoted immediately after the build because parameter was matched
          *******************
          Unmet Qualification
          Manual Approval
          *******************

          Refer to the screensot attachment.

          I'd think the issue right now it's the code is using boolean 'AND' to chain-up the criterias.
          But it should use boolean 'OR' to meet the meaning of "Promote immediately once the build is complete based on build parameters".

          Show
          totoroliu Rick Liu added a comment - - edited Hi Oleg~ After some job config cleanup and retry, now I'm able to see: ******************* Met Qualification Automatically promoted immediately after the build because parameter was matched ******************* Unmet Qualification Manual Approval ******************* Refer to the screensot attachment. I'd think the issue right now it's the code is using boolean ' AND ' to chain-up the criterias. But it should use boolean ' OR ' to meet the meaning of " Promote immediately once the build is complete based on build parameters ".
          Show
          oleg_nenashev Oleg Nenashev added a comment - The plugin behaves as documented in the code: https://github.com/jenkinsci/promoted-builds-plugin/blob/f7589c3c3e76f357393c6431a6412f2bc1e55ee7/src/main/java/hudson/plugins/promoted_builds/PromotionProcess.java#L73 . I agree it needs to be documented in https://github.com/jenkinsci/promoted-builds-plugin/blob/master/src/main/resources/hudson/plugins/promoted_builds/PromotionProcess/process-config.jelly and in README, but it is not a defect
          Hide
          totoroliu Rick Liu added a comment -

          ok I agree with you ~

          In addition to document improvement,
          maybe add a new feature to choose AND or OR for promote conditions.

          Show
          totoroliu Rick Liu added a comment - ok I agree with you ~ In addition to document improvement, maybe add a new feature to choose AND or OR for promote conditions.
          Hide
          totoroliu Rick Liu added a comment -
          Show
          totoroliu Rick Liu added a comment - Pull request prepared: https://github.com/jenkinsci/promoted-builds-plugin/pull/115

            People

            • Assignee:
              Unassigned
              Reporter:
              totoroliu Rick Liu
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: