Skip to content
Permalink
Browse files

Merge pull request #11 from Flagbit/fix-long-names-jenkins-32781

[Fix JENKINS-32781] Fix bug long bitbucket key
  • Loading branch information
Antonio Mansilla committed Mar 3, 2016
2 parents 539baf9 + 0f5cc60 commit d73ec91ad424e4f885a7961579a55ccf1299d5e2
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/main/java/org/jenkinsci/plugins/bitbucket/BitbucketBuildStatusNotifier.java
@@ -21,6 +21,7 @@
import java.util.logging.Level;
import java.util.logging.Logger;
import jenkins.model.Jenkins;
import org.apache.commons.codec.digest.DigestUtils;
import org.eclipse.jgit.transport.RemoteConfig;
import org.eclipse.jgit.transport.URIish;
import org.jenkinsci.plugins.bitbucket.api.*;
@@ -214,16 +215,15 @@ private void notifyBuildStatus(final BitbucketBuildStatusResource buildStatusRes
Token token = apiService.getAccessToken(OAuthConstants.EMPTY_TOKEN, verifier);
apiService.signRequest(token, request);

logger.info("This response was received:");

Response response = request.send();
logger.info("This response was received:" + response.getBody());
}

private BitbucketBuildStatus createBitbucketBuildStatusFromBuild(AbstractBuild build) {

String buildState = this.guessBitbucketBuildState(build.getResult());

String buildKey = build.getProject().getFullDisplayName() + "#" + build.getNumber();
// bitbucket requires the key to be shorter than 40 chars
String buildKey = DigestUtils.md5Hex(build.getProject().getFullDisplayName() + "#" + build.getNumber());
String buildUrl = build.getProject().getAbsoluteUrl() + build.getNumber() + '/';
String buildName = build.getProject().getFullDisplayName() + " #" + build.getNumber();

0 comments on commit d73ec91

Please sign in to comment.