Class BitbucketServerBuildWarningsUpdater
java.lang.Object
com.atlassian.bamboo.plugins.stash.v2.AbstractBitbucketServerExecutor
com.atlassian.bamboo.plugins.stash.BitbucketServerBuildWarningsUpdater
- All Implemented Interfaces:
IdentifyingExecutor<VcsBuildWarningsUpdater>
,VcsBuildWarningsUpdater
public class BitbucketServerBuildWarningsUpdater
extends AbstractBitbucketServerExecutor
implements VcsBuildWarningsUpdater
-
Field Summary
Fields inherited from class com.atlassian.bamboo.plugins.stash.v2.AbstractBitbucketServerExecutor
vcsRepositoryManager
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
deleteBuildWarnings
(@NotNull VcsRepositoryData repository, @NotNull String changeSetId, @NotNull ImmutableChainResultsSummary resultsSummary) Removes all warnings previously sent by Bamboo for the given repository used in a build.@Nullable ContextualVcsId<VcsBuildWarningsUpdater>
getVcsIdForExecutor
(@NotNull VcsRepositoryData repository) 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
sendBuildWarnings
(@NotNull VcsRepositoryData repository, @NotNull String changesetId, @NotNull ImmutableChainResultsSummary resultsSummary, @NotNull BuildWarningSummary warningSummary, @NotNull Iterable<WarningAnnotation> warnings) Sends build warnings for the given repository used in a build.boolean
supportsBuildWarnings
(@NotNull VcsRepositoryData repository) Returns true if build warnings are supported by the givenrepository
.Methods inherited from class com.atlassian.bamboo.plugins.stash.v2.AbstractBitbucketServerExecutor
bitbucketServerToGitData, executeOnMirrorWithPrimaryFallback, executeOnMirrorWithPrimaryFallback, getGitModuleDescriptor, shouldFallbackToPolling
-
Constructor Details
-
BitbucketServerBuildWarningsUpdater
public BitbucketServerBuildWarningsUpdater()
-
-
Method Details
-
getVcsIdForExecutor
@Nullable public @Nullable ContextualVcsId<VcsBuildWarningsUpdater> getVcsIdForExecutor(@NotNull @NotNull VcsRepositoryData repository) 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<VcsBuildWarningsUpdater>
- Returns:
- the id of repository, can be null if no feasible identification algorithm exists
-
supportsBuildWarnings
Description copied from interface:VcsBuildWarningsUpdater
Returns true if build warnings are supported by the givenrepository
.- Specified by:
supportsBuildWarnings
in interfaceVcsBuildWarningsUpdater
-
sendBuildWarnings
public boolean sendBuildWarnings(@NotNull @NotNull VcsRepositoryData repository, @NotNull @NotNull String changesetId, @NotNull @NotNull ImmutableChainResultsSummary resultsSummary, @NotNull @NotNull BuildWarningSummary warningSummary, @NotNull @NotNull Iterable<WarningAnnotation> warnings) throws RepositoryException Description copied from interface:VcsBuildWarningsUpdater
Sends build warnings for the given repository used in a build.This method can be called multiple times to send warnings incrementally, to allow external data batching.
- Specified by:
sendBuildWarnings
in interfaceVcsBuildWarningsUpdater
- Parameters:
repository
- repository for which to send code warningschangesetId
- commit identifierresultsSummary
- summary of the build result which generated the warningswarningSummary
- summary of the warningswarnings
- batch of warnings to send- Returns:
true
if annotations have been successfully sent,false
otherwise. Whenfalse
is returned, no further calls to this method should be performed for the same repository and result.- Throws:
RepositoryException
- if for any reason the build warnings could not have been sent.
-
deleteBuildWarnings
public void deleteBuildWarnings(@NotNull @NotNull VcsRepositoryData repository, @NotNull @NotNull String changeSetId, @NotNull @NotNull ImmutableChainResultsSummary resultsSummary) throws RepositoryException Description copied from interface:VcsBuildWarningsUpdater
Removes all warnings previously sent by Bamboo for the given repository used in a build.- Specified by:
deleteBuildWarnings
in interfaceVcsBuildWarningsUpdater
- Parameters:
repository
- repository for which to delete code warningschangeSetId
- commit identifierresultsSummary
- summary of the build result which generated the warnings- Throws:
RepositoryException
- if for any reason the build warnings could not have been deleted.
-