• Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Minor Minor
    • promoted-builds-plugin
    • Ubuntu 16.04
      Jenkins ver. 2.46.2 LTS
      promoted builds plugin v2.28.1

      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.

        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

          [JENKINS-49488] promotion conditions to support OR condition

          Oleg Nenashev added a comment -

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

          Oleg Nenashev added a comment - t should work well according to the code. Could you please provide full build.xml file?

          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.

          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.

          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".

          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 ".

          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

          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.

          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.

          Rick Liu added a comment -

          Rick Liu added a comment - Pull request prepared: https://github.com/jenkinsci/promoted-builds-plugin/pull/115

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

              Created:
              Updated: