Skip to content

Commit 54952c4

Browse files
authored
[JENKINS-53535] Make Bitbucket Server, Owner and repository environment variables for Bitbucket Team/Project based jobs (#949)
Add as environment variables some bitbucket useful informations like: - repository name (slug); - owner name (slug); - project key; - the server URL.
1 parent 81c0685 commit 54952c4

21 files changed

+194
-35
lines changed

docs/USER_GUIDE.adoc

+12
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,18 @@ The STOPPED status prevents merge checks on Cloud, CANCELLED status should preve
239239
If this does not meet you need you can disable any notification to Bitbucket using the https://github.com/jenkinsci/skip-notifications-trait-plugin/[skip-notifications-trait-plugin] and provide notification about the build status yourself. This can be achieved via a curl shell command or by using build steps provided by the https://github.com/jenkinsci/bitbucket-build-status-notifier-plugin[bitbucket-build-status-notifier-plugin].
240240

241241

242+
[id=bitbucket-env-var]
243+
== Environment Variables
244+
245+
This plugin contribute to the enviroment with the following variables:
246+
247+
- BITBUCKET_REPOSITORY: the repository name/slug
248+
- BITBUCKET_OWNER: the repository owner name/slug, in Bitbucket Cloud is the equivalent of workspace name
249+
- BITBUCKET_PROJECT_KEY: the project key in which the repository is contained
250+
- BITBUCKET_SERVER_URL: the Bitbucket server URL
251+
252+
These variables were added to allow users to easily integrate calls to Bitbucket's REST APIs into their own pipelines to implement own business logics.
253+
242254
[id=bitbucket-misc-config]
243255
== Miscellaneous configuration
244256

src/main/java/com/cloudbees/jenkins/plugins/bitbucket/BitbucketApiUtils.java

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import com.cloudbees.jenkins.plugins.bitbucket.endpoints.BitbucketEndpointConfiguration;
1010
import com.cloudbees.plugins.credentials.CredentialsProvider;
1111
import com.cloudbees.plugins.credentials.common.StandardCredentials;
12+
import edu.umd.cs.findbugs.annotations.NonNull;
1213
import hudson.Util;
1314
import hudson.model.Item;
1415
import hudson.util.FormFillFailure;
@@ -29,6 +30,10 @@ public static boolean isCloud(BitbucketApi client) {
2930
return client instanceof BitbucketCloudApiClient;
3031
}
3132

33+
public static boolean isCloud(@NonNull String serverURL) {
34+
return StringUtils.startsWith(serverURL, BitbucketCloudEndpoint.SERVER_URL);
35+
}
36+
3237
public static ListBoxModel getFromBitbucket(SCMSourceOwner context,
3338
String serverUrl,
3439
String credentialsId,

src/main/java/com/cloudbees/jenkins/plugins/bitbucket/BitbucketGitSCMBuilder.java

+4-5
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRepository;
2929
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRepositoryProtocol;
3030
import com.cloudbees.jenkins.plugins.bitbucket.endpoints.AbstractBitbucketEndpoint;
31-
import com.cloudbees.jenkins.plugins.bitbucket.endpoints.BitbucketCloudEndpoint;
3231
import com.cloudbees.jenkins.plugins.bitbucket.endpoints.BitbucketEndpointConfiguration;
3332
import com.cloudbees.jenkins.plugins.bitbucket.endpoints.BitbucketServerEndpoint;
3433
import com.cloudbees.jenkins.plugins.sshcredentials.SSHUserPrivateKey;
@@ -107,11 +106,11 @@ public BitbucketGitSCMBuilder(@NonNull BitbucketSCMSource scmSource, @NonNull SC
107106
endpoint = new BitbucketServerEndpoint(null, serverURL, false, null);
108107
}
109108

110-
String repositoryUrl = endpoint.getRepositoryUrl(scmSource.getRepoOwner(), scmSource.getRepository());
111-
if (endpoint instanceof BitbucketCloudEndpoint) {
112-
withBrowser(new BitbucketWeb(repositoryUrl));
109+
String repositoryURL = endpoint.getRepositoryUrl(scmSource.getRepoOwner(), scmSource.getRepository());
110+
if (BitbucketApiUtils.isCloud(endpoint.getServerUrl())) {
111+
withBrowser(new BitbucketWeb(repositoryURL));
113112
} else {
114-
withBrowser(new BitbucketServer(repositoryUrl));
113+
withBrowser(new BitbucketServer(repositoryURL));
115114
}
116115

117116
// Test for protocol

src/main/java/com/cloudbees/jenkins/plugins/bitbucket/BitbucketSCMSource.java

+34-17
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketHref;
3333
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketMirroredRepository;
3434
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketMirroredRepositoryDescriptor;
35+
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketProject;
3536
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketPullRequest;
3637
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRepository;
3738
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException;
@@ -44,6 +45,8 @@
4445
import com.cloudbees.jenkins.plugins.bitbucket.endpoints.BitbucketEndpointConfiguration;
4546
import com.cloudbees.jenkins.plugins.bitbucket.endpoints.BitbucketServerEndpoint;
4647
import com.cloudbees.jenkins.plugins.bitbucket.hooks.HasPullRequests;
48+
import com.cloudbees.jenkins.plugins.bitbucket.impl.extension.BitbucketEnvVarExtension;
49+
import com.cloudbees.jenkins.plugins.bitbucket.impl.util.URLUtils;
4750
import com.cloudbees.jenkins.plugins.bitbucket.server.BitbucketServerWebhookImplementation;
4851
import com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient;
4952
import com.cloudbees.jenkins.plugins.bitbucket.server.client.repository.BitbucketServerRepository;
@@ -75,8 +78,6 @@
7578
import hudson.util.ListBoxModel;
7679
import java.io.IOException;
7780
import java.io.ObjectStreamException;
78-
import java.net.MalformedURLException;
79-
import java.net.URL;
8081
import java.util.ArrayList;
8182
import java.util.Arrays;
8283
import java.util.Collection;
@@ -128,6 +129,7 @@
128129
import org.jenkinsci.Symbol;
129130
import org.kohsuke.accmod.Restricted;
130131
import org.kohsuke.accmod.restrictions.NoExternalUse;
132+
import org.kohsuke.accmod.restrictions.ProtectedExternally;
131133
import org.kohsuke.stapler.AncestorInPath;
132134
import org.kohsuke.stapler.DataBoundConstructor;
133135
import org.kohsuke.stapler.DataBoundSetter;
@@ -385,6 +387,7 @@ public List<SCMSourceTrait> getTraits() {
385387
return Collections.unmodifiableList(traits);
386388
}
387389

390+
@Override
388391
@DataBoundSetter
389392
public void setTraits(@CheckForNull List<SCMSourceTrait> traits) {
390393
this.traits = new ArrayList<>(Util.fixNull(traits));
@@ -690,7 +693,7 @@ class Skip extends IOException {
690693
boolean fork = !fullName.equalsIgnoreCase(pull.getSource().getRepository().getFullName());
691694
String pullRepoOwner = pull.getSource().getRepository().getOwnerName();
692695
String pullRepository = pull.getSource().getRepository().getRepositoryName();
693-
final BitbucketApi pullBitbucket = fork && originBitbucket instanceof BitbucketCloudApiClient
696+
final BitbucketApi pullBitbucket = fork && BitbucketApiUtils.isCloud(originBitbucket)
694697
? BitbucketApiFactory.newInstance(
695698
getServerUrl(),
696699
authenticator(),
@@ -999,7 +1002,7 @@ private BitbucketCommit findPRDestinationCommit(BitbucketPullRequest pr, TaskLis
9991002
}
10001003

10011004
@Override
1002-
public SCM build(SCMHead head, SCMRevision revision) {
1005+
public SCM build(@NonNull SCMHead head, @CheckForNull SCMRevision revision) {
10031006
initCloneLinks();
10041007

10051008
String scmCredentialsId = credentialsId;
@@ -1027,26 +1030,38 @@ public SCM build(SCMHead head, SCMRevision revision) {
10271030
scmExtension = new GitClientAuthenticatorExtension(null);
10281031
}
10291032

1033+
String projectKey = getProjectKey();
1034+
10301035
return new BitbucketGitSCMBuilder(this, head, revision, scmCredentialsId)
10311036
.withExtension(scmExtension)
1037+
.withExtension(new BitbucketEnvVarExtension(getRepoOwner(), getRepository(), projectKey, getServerUrl()))
10321038
.withCloneLinks(primaryCloneLinks, mirrorCloneLinks)
10331039
.withTraits(traits)
10341040
.build();
10351041
}
10361042

1043+
@CheckForNull
1044+
@Restricted(ProtectedExternally.class)
1045+
protected String getProjectKey() {
1046+
String projectKey = null;
1047+
try {
1048+
BitbucketProject project = buildBitbucketClient().getRepository().getProject();
1049+
if (project != null) {
1050+
projectKey = project.getKey();
1051+
}
1052+
} catch (IOException | InterruptedException e) {
1053+
LOGGER.severe("Failure getting the project key of repository " + getRepository() + " : " + e.getMessage());
1054+
}
1055+
return projectKey;
1056+
}
1057+
10371058
private void setPrimaryCloneLinks(List<BitbucketHref> links) {
10381059
links.forEach(link -> {
10391060
if (StringUtils.startsWithIgnoreCase(link.getName(), "http")) {
1040-
try {
1041-
URL linkURL = new URL(link.getHref());
1042-
// Remove the username from URL because it will be set into the GIT_URL variable
1043-
// credentials used to clone or for push/pull could be different than this will cause a failure
1044-
// Restore the behaviour before mirror link feature.
1045-
URL cleanURL = new URL(linkURL.getProtocol(), linkURL.getHost(), linkURL.getPort(), linkURL.getFile());
1046-
link.setHref(cleanURL.toExternalForm());
1047-
} catch (MalformedURLException e) {
1048-
// do nothing, URL can not be parsed, leave as is
1049-
}
1061+
// Remove the username from URL because it will be set into the GIT_URL variable
1062+
// credentials used to clone or for push/pull could be different than this will cause a failure
1063+
// Restore the behaviour before mirror link feature.
1064+
link.setHref(URLUtils.removeAuthority(link.getHref()));
10501065
}
10511066
});
10521067
primaryCloneLinks = links;
@@ -1112,13 +1127,15 @@ protected List<Action> retrieveActions(@CheckForNull SCMSourceEvent event,
11121127
result.add(new BitbucketDefaultBranch(repoOwner, repository, defaultBranch));
11131128
}
11141129
UriTemplate template;
1115-
if (BitbucketCloudEndpoint.SERVER_URL.equals(getServerUrl())) {
1130+
if (BitbucketApiUtils.isCloud(getServerUrl())) {
11161131
template = UriTemplate.fromTemplate(getServerUrl() + CLOUD_REPO_TEMPLATE);
11171132
} else {
11181133
template = UriTemplate.fromTemplate(getServerUrl() + SERVER_REPO_TEMPLATE);
11191134
}
1120-
template.set("owner", repoOwner).set("repo", repository);
1121-
String url = template.expand();
1135+
String url = template
1136+
.set("owner", repoOwner)
1137+
.set("repo", repository)
1138+
.expand();
11221139
result.add(new BitbucketLink("icon-bitbucket-repo", url));
11231140
result.add(new ObjectMetadataAction(r.getRepositoryName(), null, url));
11241141
return result;

src/main/java/com/cloudbees/jenkins/plugins/bitbucket/FallbackToOtherRepositoryGitSCMExtension.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import hudson.plugins.git.extensions.GitSCMExtension;
99
import java.net.URISyntaxException;
1010
import java.util.List;
11-
import java.util.stream.Collectors;
1211
import org.eclipse.jgit.transport.RefSpec;
1312
import org.eclipse.jgit.transport.URIish;
1413
import org.jenkinsci.plugins.gitclient.FetchCommand;
@@ -18,6 +17,7 @@
1817
* If specified commit hashes are not found in repository then fetch
1918
* specified branches from remote.
2019
*/
20+
//TODO be attention serialized in config.xml of the job as extension child of hudson.plugins.git.GitSCM. Provide a xml alias when move to package com.cloudbees.jenkins.plugins.bitbucket.impl.extension
2121
public class FallbackToOtherRepositoryGitSCMExtension extends GitSCMExtension {
2222

2323
private final String cloneLink;
@@ -49,7 +49,7 @@ public Revision decorateRevisionToBuild(
4949
String branch = branchWithHash.getBranch();
5050
return new RefSpec("+refs/heads/" + branch + ":refs/remotes/" + remoteName + "/" + branch);
5151
})
52-
.collect(Collectors.toList());
52+
.toList();
5353

5454
if (!refSpecs.isEmpty()) {
5555
FetchCommand fetchCommand = git.fetch_();

src/main/java/com/cloudbees/jenkins/plugins/bitbucket/GitClientAuthenticatorExtension.java

+2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
import hudson.plugins.git.extensions.GitSCMExtension;
77
import org.jenkinsci.plugins.gitclient.GitClient;
88

9+
// TODO be attention serialized in config.xml of the job as extension child of hudson.plugins.git.GitSCM. Provide a xml alias when move to package com.cloudbees.jenkins.plugins.bitbucket.impl.extension
910
public class GitClientAuthenticatorExtension extends GitSCMExtension {
1011

12+
// TODO remove this because it is serialized in config.xml with username and secret (password or token could change/expiry specially with OAuth2)
1113
private final StandardUsernameCredentials credentials;
1214

1315
public GitClientAuthenticatorExtension(StandardUsernameCredentials credentials) {

src/main/java/com/cloudbees/jenkins/plugins/bitbucket/client/BitbucketCloudApiClient.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
*/
2525
package com.cloudbees.jenkins.plugins.bitbucket.client;
2626

27-
import com.cloudbees.jenkins.plugins.bitbucket.JsonParser;
2827
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketApi;
2928
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketAuthenticator;
3029
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketBuildStatus;
@@ -50,6 +49,7 @@
5049
import com.cloudbees.jenkins.plugins.bitbucket.client.repository.UserRoleInRepository;
5150
import com.cloudbees.jenkins.plugins.bitbucket.credentials.BitbucketUsernamePasswordAuthenticator;
5251
import com.cloudbees.jenkins.plugins.bitbucket.filesystem.BitbucketSCMFile;
52+
import com.cloudbees.jenkins.plugins.bitbucket.impl.util.JsonParser;
5353
import com.cloudbees.jenkins.plugins.bitbucket.internal.api.AbstractBitbucketApi;
5454
import com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials;
5555
import com.damnhandy.uri.template.UriTemplate;

src/main/java/com/cloudbees/jenkins/plugins/bitbucket/client/BitbucketCloudWebhookPayload.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
*/
2424
package com.cloudbees.jenkins.plugins.bitbucket.client;
2525

26-
import com.cloudbees.jenkins.plugins.bitbucket.JsonParser;
2726
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketPullRequestEvent;
2827
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketPushEvent;
2928
import com.cloudbees.jenkins.plugins.bitbucket.client.events.BitbucketCloudPullRequestEvent;
3029
import com.cloudbees.jenkins.plugins.bitbucket.client.events.BitbucketCloudPushEvent;
30+
import com.cloudbees.jenkins.plugins.bitbucket.impl.util.JsonParser;
3131
import edu.umd.cs.findbugs.annotations.CheckForNull;
3232
import edu.umd.cs.findbugs.annotations.NonNull;
3333
import java.io.IOException;

src/main/java/com/cloudbees/jenkins/plugins/bitbucket/credentials/BitbucketOAuthAuthenticator.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,7 @@ public void configureRequest(HttpRequest request) {
8585
@Override
8686
public StandardUsernameCredentials getCredentialsForSCM() {
8787
try {
88-
return new UsernamePasswordCredentialsImpl(
89-
CredentialsScope.GLOBAL, getId(), null, "x-token-auth", getToken().getAccessToken());
88+
return new UsernamePasswordCredentialsImpl(CredentialsScope.GLOBAL, getId(), null, "x-token-auth", getToken().getAccessToken());
9089
} catch (FormException e) {
9190
throw new RuntimeException(e);
9291
}

src/main/java/com/cloudbees/jenkins/plugins/bitbucket/hooks/NativeServerPullRequestHookProcessor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525

2626
import com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource;
2727
import com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSourceContext;
28-
import com.cloudbees.jenkins.plugins.bitbucket.JsonParser;
2928
import com.cloudbees.jenkins.plugins.bitbucket.PullRequestSCMHead;
3029
import com.cloudbees.jenkins.plugins.bitbucket.PullRequestSCMRevision;
3130
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketPullRequest;
3231
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRepository;
32+
import com.cloudbees.jenkins.plugins.bitbucket.impl.util.JsonParser;
3333
import com.cloudbees.jenkins.plugins.bitbucket.server.client.repository.BitbucketServerRepository;
3434
import com.cloudbees.jenkins.plugins.bitbucket.server.events.NativeServerPullRequestEvent;
3535
import com.google.common.base.Ascii;

src/main/java/com/cloudbees/jenkins/plugins/bitbucket/hooks/NativeServerPushHookProcessor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
import com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSourceContext;
2828
import com.cloudbees.jenkins.plugins.bitbucket.BitbucketTagSCMHead;
2929
import com.cloudbees.jenkins.plugins.bitbucket.BranchSCMHead;
30-
import com.cloudbees.jenkins.plugins.bitbucket.JsonParser;
3130
import com.cloudbees.jenkins.plugins.bitbucket.PullRequestSCMHead;
3231
import com.cloudbees.jenkins.plugins.bitbucket.PullRequestSCMRevision;
3332
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketPullRequest;
33+
import com.cloudbees.jenkins.plugins.bitbucket.impl.util.JsonParser;
3434
import com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient;
3535
import com.cloudbees.jenkins.plugins.bitbucket.server.client.pullrequest.BitbucketServerPullRequest;
3636
import com.cloudbees.jenkins.plugins.bitbucket.server.client.repository.BitbucketServerRepository;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package com.cloudbees.jenkins.plugins.bitbucket.impl.extension;
2+
3+
import com.cloudbees.jenkins.plugins.bitbucket.impl.util.URLUtils;
4+
import edu.umd.cs.findbugs.annotations.NonNull;
5+
import edu.umd.cs.findbugs.annotations.Nullable;
6+
import hudson.plugins.git.GitSCM;
7+
import hudson.plugins.git.extensions.GitSCMExtension;
8+
import java.util.Map;
9+
10+
public class BitbucketEnvVarExtension extends GitSCMExtension {
11+
12+
private final String owner;
13+
private final String repository;
14+
private final String projectKey;
15+
private final String serverURL;
16+
17+
public BitbucketEnvVarExtension(@Nullable String owner, @NonNull String repository, @Nullable String projectKey, @NonNull String serverURL) {
18+
this.owner = owner;
19+
this.repository = repository;
20+
this.projectKey = projectKey;
21+
this.serverURL = URLUtils.removeAuthority(serverURL);
22+
}
23+
24+
/**
25+
* Contribute additional environment variables about the target branch.
26+
* Since source branch could be from a forked repository, for which the
27+
* credentials in use are not allowed to do nothing, is discarded.
28+
*
29+
* @param scm GitSCM used as reference
30+
* @param env environment variables to be added
31+
*/
32+
@Override
33+
public void populateEnvironmentVariables(GitSCM scm, Map<String, String> env) {
34+
env.put("BITBUCKET_REPOSITORY", repository);
35+
env.put("BITBUCKET_OWNER", owner);
36+
env.put("BITBUCKET_PROJECT_KEY", projectKey);
37+
env.put("BITBUCKET_SERVER_URL", serverURL);
38+
}
39+
}

src/main/java/com/cloudbees/jenkins/plugins/bitbucket/JsonParser.java src/main/java/com/cloudbees/jenkins/plugins/bitbucket/impl/util/JsonParser.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
* THE SOFTWARE.
2323
*/
24-
package com.cloudbees.jenkins.plugins.bitbucket;
24+
package com.cloudbees.jenkins.plugins.bitbucket.impl.util;
2525

2626
import com.fasterxml.jackson.databind.DeserializationFeature;
2727
import com.fasterxml.jackson.databind.ObjectMapper;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.cloudbees.jenkins.plugins.bitbucket.impl.util;
2+
3+
import edu.umd.cs.findbugs.annotations.CheckForNull;
4+
import edu.umd.cs.findbugs.annotations.Nullable;
5+
import java.net.MalformedURLException;
6+
import java.net.URL;
7+
8+
public final class URLUtils {
9+
10+
private URLUtils() {
11+
}
12+
13+
@Nullable
14+
public static String removeAuthority(@CheckForNull String url) {
15+
if (url != null) {
16+
try {
17+
URL linkURL = new URL(url);
18+
URL cleanURL = new URL(linkURL.getProtocol(), linkURL.getHost(), linkURL.getPort(), linkURL.getFile());
19+
return cleanURL.toExternalForm();
20+
} catch (MalformedURLException e) {
21+
// do nothing, URL can not be parsed, leave as is
22+
}
23+
}
24+
return url;
25+
}
26+
}

src/main/java/com/cloudbees/jenkins/plugins/bitbucket/server/client/BitbucketServerAPIClient.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
*/
2424
package com.cloudbees.jenkins.plugins.bitbucket.server.client;
2525

26-
import com.cloudbees.jenkins.plugins.bitbucket.JsonParser;
2726
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketApi;
2827
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketAuthenticator;
2928
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketBuildStatus;
@@ -42,6 +41,7 @@
4241
import com.cloudbees.jenkins.plugins.bitbucket.endpoints.BitbucketEndpointConfiguration;
4342
import com.cloudbees.jenkins.plugins.bitbucket.endpoints.BitbucketServerEndpoint;
4443
import com.cloudbees.jenkins.plugins.bitbucket.filesystem.BitbucketSCMFile;
44+
import com.cloudbees.jenkins.plugins.bitbucket.impl.util.JsonParser;
4545
import com.cloudbees.jenkins.plugins.bitbucket.internal.api.AbstractBitbucketApi;
4646
import com.cloudbees.jenkins.plugins.bitbucket.server.BitbucketServerVersion;
4747
import com.cloudbees.jenkins.plugins.bitbucket.server.BitbucketServerWebhookImplementation;

src/main/java/com/cloudbees/jenkins/plugins/bitbucket/server/client/BitbucketServerWebhookPayload.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
*/
2424
package com.cloudbees.jenkins.plugins.bitbucket.server.client;
2525

26-
import com.cloudbees.jenkins.plugins.bitbucket.JsonParser;
2726
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketPullRequestEvent;
2827
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketPushEvent;
28+
import com.cloudbees.jenkins.plugins.bitbucket.impl.util.JsonParser;
2929
import com.cloudbees.jenkins.plugins.bitbucket.server.events.BitbucketServerPullRequestEvent;
3030
import com.cloudbees.jenkins.plugins.bitbucket.server.events.BitbucketServerPushEvent;
3131
import edu.umd.cs.findbugs.annotations.CheckForNull;

0 commit comments

Comments
 (0)