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

Add option to only show latest build status for each commit

      The build key uses the build number, so if things go wrong in a build environment that aren't related to the code itself, the overall commit is marked as failed, even if subsequent builds pass.

      An option such as "Only show latest build status for each commit" that if toggled excludes the build number from the build key would allow commits to be rebuilt upon error.

      Bitbucket has done a write up on this problem - Commit build status is always red even if other builds succeed

      It looks like it may be simply updating BitbucketBuildStatusNotifier.java:299 to exclude the number if the configuration option is on.

          [JENKINS-35083] Add option to only show latest build status for each commit

          The functionality was implemented and will be available in the next plugin release.

          Antonio Mansilla added a comment - The functionality was implemented and will be available in the next plugin release.

          It seems this issue was not resolved, tried this with the latest version and the build status would stay failed in Bitbucket.
          Test case flow:

          1. Launch a pipeline job for any branch (FAILED):

          bitbucketStatusNotify( buildState: 'FAILED', buildKey: "batman", buildName: "batman", buildDescription: 'Something went wrong with build!', repoSlug: "${env.REPO_SLUG}", commitId: "${env.GIT_COMMIT_FULL}" )
          

          2. Launch the job for the same branch with (SUCCESSFUL):

          bitbucketStatusNotify( buildState: 'SUCCESSFUL', buildKey: "batman", buildName: "batman", buildDescription: 'Something went wrong with build!', repoSlug: "${env.REPO_SLUG}", commitId: "${env.GIT_COMMIT_FULL}" )
          

          3. The Bitbucket Cloud UI shows that the branch build has failed (Inside 1 successful and 1 failed)

          Andrius Versockas added a comment - It seems this issue was not resolved, tried this with the latest version and the build status would stay failed in Bitbucket. Test case flow: 1. Launch a pipeline job for any branch (FAILED): bitbucketStatusNotify( buildState: 'FAILED' , buildKey: "batman" , buildName: "batman" , buildDescription: 'Something went wrong with build!' , repoSlug: "${env.REPO_SLUG}" , commitId: "${env.GIT_COMMIT_FULL}" ) 2. Launch the job for the same branch with (SUCCESSFUL): bitbucketStatusNotify( buildState: 'SUCCESSFUL' , buildKey: "batman" , buildName: "batman" , buildDescription: 'Something went wrong with build!' , repoSlug: "${env.REPO_SLUG}" , commitId: "${env.GIT_COMMIT_FULL}" ) 3. The Bitbucket Cloud UI shows that the branch build has failed (Inside 1 successful and 1 failed)

          Sai Kiran added a comment - - edited

          flagbitI am using your Plugin for last 6 months, It is a great feature. But Soon as I moved to Pipeline I am having Trouble
          1. There is no option to implement to show only the latest Builds On PR Builds sections, It shows All Builds Failure & Success Both.
          2. Bitbucket Has released a new check for PR's, "1 successful build on last commit" if we have any history of Failed Builds he doesn't allow the author to merge.
          in this case admin must be present every time to merge a PR & vice-versa with this PR check also "No failed builds on last commit".

          It would be a great help if you give the "only Show Latest build" option with pipeline also, It will be a great help.

          Sai Kiran added a comment - - edited flagbit I am using your Plugin for last 6 months, It is a great feature. But Soon as I moved to Pipeline I am having Trouble 1. There is no option to implement to show only the latest Builds On PR Builds sections, It shows All Builds Failure & Success Both. 2. Bitbucket Has released a new check for PR's, "1 successful build on last commit" if we have any history of Failed Builds he doesn't allow the author to merge. in this case admin must be present every time to merge a PR & vice-versa with this PR check also "No failed builds on last commit". It would be a great help if you give the "only Show Latest build" option with pipeline also, It will be a great help.

          Tarun added a comment -

          This is required in Pipeline. 

          Tarun added a comment - This is required in Pipeline. 

            flagbit Antonio Mansilla
            kurt_wagner Kurt
            Votes:
            4 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: