Class BitbucketCloudCommitCommenter
java.lang.Object
com.atlassian.bamboo.plugins.bitbucket.v2.BitbucketCloudRestApiClient
com.atlassian.bamboo.plugins.bitbucket.v2.BitbucketCloudCommitCommenter
- All Implemented Interfaces:
IdentifyingExecutor<VcsCommitCommenter>
,VcsCommitCommenter
public class BitbucketCloudCommitCommenter
extends BitbucketCloudRestApiClient
implements VcsCommitCommenter
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
static class
-
Field Summary
Fields inherited from class com.atlassian.bamboo.plugins.bitbucket.v2.BitbucketCloudRestApiClient
bitbucketClientSupplier
-
Constructor Summary
ConstructorDescriptionBitbucketCloudCommitCommenter
(AdministrationConfigurationAccessor administrationConfigurationAccessor, CredentialsAccessor credentialsAccessor, DeploymentProjectService deploymentProjectService, ProjectManager projectManager, RepositoryDefinitionManager repositoryDefinitionManager, RepositoryStoredSpecsLogService repositoryStoreSpecsLogService, TemplateRenderer templateRenderer) -
Method Summary
Modifier and TypeMethodDescription@Nullable ContextualVcsId<VcsCommitCommenter>
getVcsIdForExecutor
(@NotNull VcsRepositoryData vcsRepositoryData) Returned id has to fulfill the following: Given two VcsRepositoryData objects A and B, and executor e returning equal ContextualVcsId (in terms of equals()), for any operation foo() provided by the executor, the calls e::foo(A) and e::foo(B) should be equivalent.boolean
publishComment
(@NotNull VcsRepositoryData repositoryData, @NotNull String commitId, @NotNull String payload) Publish comment to repository commit.boolean
publishRssStatus
(@NotNull VcsRepositoryData repositoryData, @NotNull String commitId, @NotNull BambooEvent event) Publish Bamboo Specs execution status to repository commit.Methods inherited from class com.atlassian.bamboo.plugins.bitbucket.v2.BitbucketCloudRestApiClient
addFeatures, getAuthFeature, getLoggingFeature, prepareResourceCall, prepareResourceCall
-
Constructor Details
-
BitbucketCloudCommitCommenter
@Inject public BitbucketCloudCommitCommenter(AdministrationConfigurationAccessor administrationConfigurationAccessor, CredentialsAccessor credentialsAccessor, DeploymentProjectService deploymentProjectService, ProjectManager projectManager, RepositoryDefinitionManager repositoryDefinitionManager, RepositoryStoredSpecsLogService repositoryStoreSpecsLogService, TemplateRenderer templateRenderer)
-
-
Method Details
-
publishRssStatus
public boolean publishRssStatus(@NotNull @NotNull VcsRepositoryData repositoryData, @NotNull @NotNull String commitId, @NotNull @NotNull BambooEvent event) throws RepositoryException Description copied from interface:VcsCommitCommenter
Publish Bamboo Specs execution status to repository commit.- Specified by:
publishRssStatus
in interfaceVcsCommitCommenter
commitId
- identifier of commit which should receive comment. For git-based repos it's SHA.event
- isBambooEvent
from bamboo-core.- Returns:
- true if published comment successfully.
- Throws:
RepositoryException
- when commit not found or credentials are wrong
-
publishComment
public boolean publishComment(@NotNull @NotNull VcsRepositoryData repositoryData, @NotNull @NotNull String commitId, @NotNull @NotNull String payload) throws RepositoryException Description copied from interface:VcsCommitCommenter
Publish comment to repository commit.- Specified by:
publishComment
in interfaceVcsCommitCommenter
commitId
- identifier of commit which should receive comment. For git-based repos it's SHA.payload
- content of comment- Returns:
- true if published comment successfully.
- Throws:
RepositoryException
- when commit not found or credentials are wrong
-
getVcsIdForExecutor
@Nullable public @Nullable ContextualVcsId<VcsCommitCommenter> getVcsIdForExecutor(@NotNull @NotNull VcsRepositoryData vcsRepositoryData) Description copied from interface:IdentifyingExecutor
Returned id has to fulfill the following: Given two VcsRepositoryData objects A and B, and executor e returning equal ContextualVcsId (in terms of equals()), for any operation foo() provided by the executor, the calls e::foo(A) and e::foo(B) should be equivalent. To be more precise: given any time point t and any variable context v, calling a::foo(A) should yield the same results as calling e::foo(B). Given the above it follows that - calculation of the id should take into account global and plan variables. This means, that calling this method on the same object in different variable context can (possibly must) yield different results. - equal ids need not (and should not) guarantee equal call results over indefinite time. In particular, result of e:foo(A).equals(e::foo(A)) is allowed to be false, since 2 calls to e::foo(A) do not happen at the same time. Example: 2 git repositories with the same url and credentials are considered equal in context ofVcsBranchDetector
. If they also point to the same branch, they are considered equal in context ofVcsChangeDetector
- Specified by:
getVcsIdForExecutor
in interfaceIdentifyingExecutor<VcsCommitCommenter>
- Returns:
- the id of repository, can be null if no feasible identification algorithm exists
-