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

Support for override Latest Build option with pipeline builds

      Same as JENKINS-35083 for pipelines.

      The code to fix should be straight forward to address.

      Update BitbucketBuildStatusNotifierStep.java
      add a new variable for the override Latest Build.

      private boolean overrideLatestBuild;
          public boolean isOverrideLatestBuild() { return this.overrideLatestBuild; }
          @DataBoundSetter public void setOverrideLatestBuild(boolean overrideLatestBuild) {
              this.overrideLatestBuild = overrideLatestBuild;
      
      }
      

      then in the run method

      reference isOverideLatestBuild instead of passing in false

      BitbucketBuildStatusHelper.notifyBuildStatus(step.getCredentials(build), step.isOverideLatestBuild(), build, taskListener, buildStatus);
      

          [JENKINS-40998] Support for override Latest Build option with pipeline builds

          Alex Juarez added a comment -

          This should be a very localized change in BitbucketBuildStatusNotifierStep.java where a new DataBound setter should be added to obtain the user-provided value for the override flag. this flag should then be used when getting the build key to use when notifying BitBucket.

          Alex Juarez added a comment - This should be a very localized change in BitbucketBuildStatusNotifierStep.java where a new DataBound setter should be added to obtain the user-provided value for the override flag. this flag should then be used when getting the build key to use when notifying BitBucket.

          I created an alternative pull request for this: https://github.com/jenkinsci/bitbucket-build-status-notifier-plugin/pull/42.
          I think this fix is better because it stays closer to the actual Bitbucket API.

          Mark Lagendijk added a comment - I created an alternative pull request for this: https://github.com/jenkinsci/bitbucket-build-status-notifier-plugin/pull/42 . I think this fix is better because it stays closer to the actual Bitbucket API.

            alex_juarez Alex Juarez
            jmontanari joseph montanari
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: