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

Allow Bitbucket build status text to be overridden

    XMLWordPrintable

Details

    Description

      Currently the text sent to Bitbucket as build status for a commit is hardcoded with messages that could be misleading (such as "This commit has test failures") if the job uses build statuses differently (i.e. UNSTABLE happens to mean something else).  At the very least the text should say "The commit is unstable".

      https://github.com/jenkinsci/bitbucket-branch-source-plugin/blob/master/src/main/java/com/cloudbees/jenkins/plugins/bitbucket/BitbucketBuildStatusNotifications.java#L73

       

      if (Result.SUCCESS.equals(result)) {
      status = new BitbucketBuildStatus(hash, "This commit looks good", "SUCCESSFUL", url, key, name);
      } else if (Result.UNSTABLE.equals(result)) {
      status = new BitbucketBuildStatus(hash, "This commit has test failures", "FAILED", url, key, name);
      } else if (Result.FAILURE.equals(result)) {
      status = new BitbucketBuildStatus(hash, "There was a failure building this commit", "FAILED", url, key,
      name);
      } else if (result != null) { // ABORTED etc.
      status = new BitbucketBuildStatus(hash, "Something is wrong with the build of this commit", "FAILED", url,
      key, name);
      } else {
      status = new BitbucketBuildStatus(hash, "The tests have started...", "INPROGRESS", url, key, name);
      }
      

        

      Attachments

        Issue Links

          Activity

            ncosta Nuno Costa added a comment -

            pixman20, thanks for the code.

            I will probably test it on my jenkins instance.

            It would be nice to try to push it upstream

             

            ncosta Nuno Costa added a comment - pixman20 , thanks for the code. I will probably test it on my jenkins instance. It would be nice to try to push it upstream  

            Another "disable-bitbucket-multibranch-status" plugin was announced in JENKINS-36755. There is a hosting request, too. The code looks very similar to pixman20's "bitbucket-branch-source-disable-status" plugin but the user interface is worded differently.

            kon Kalle Niemitalo added a comment - Another "disable-bitbucket-multibranch-status" plugin was announced in JENKINS-36755 . There is a hosting request, too. The code looks very similar to pixman20 's "bitbucket-branch-source-disable-status" plugin but the user interface is worded differently.
            michelzanini Michel Zanini added a comment -

            I have found a plugin that is published and does this:
            https://github.com/jenkinsci/skip-notifications-trait-plugin

            If any one reads this you can find it there, I have not tested it yet, but it seems that will work.

            michelzanini Michel Zanini added a comment - I have found a plugin that is published and does this: https://github.com/jenkinsci/skip-notifications-trait-plugin If any one reads this you can find it there, I have not tested it yet, but it seems that will work.
            kon Kalle Niemitalo added a comment - - edited

            See also [BSERV-3857] Add 'Unstable' Build Status, in Atlassian's Bitbucket Server bug tracker.

            (Edit: My original comment belongs to JENKINS-36755 instead.)

            kon Kalle Niemitalo added a comment - - edited See also [BSERV-3857] Add 'Unstable' Build Status , in Atlassian's Bitbucket Server bug tracker. (Edit: My original comment belongs to JENKINS-36755 instead.)
            llibicpep Dee Kryvenko added a comment -

            I have created a separate https://issues.jenkins.io/browse/JENKINS-65741 to cover part of what being discussed here in the comments - adding Jenkins instance identifier to the commit status. Changing the project name workaround doesn't always apply - i.e. Bitbucket Project Folder you do not really control names of jobs. For JENKINS-65741 I have already submitted a PR https://github.com/jenkinsci/bitbucket-branch-source-plugin/pull/454.

            llibicpep Dee Kryvenko added a comment - I have created a separate https://issues.jenkins.io/browse/JENKINS-65741  to cover part of what being discussed here in the comments - adding Jenkins instance identifier to the commit status. Changing the project name workaround doesn't always apply - i.e. Bitbucket Project Folder you do not really control names of jobs. For  JENKINS-65741 I have already submitted a PR  https://github.com/jenkinsci/bitbucket-branch-source-plugin/pull/454 .

            People

              Unassigned Unassigned
              pixman20 pixman20
              Votes:
              5 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated: