Package com.atlassian.bamboo.build
Class BuildStatusHelper
java.lang.Object
com.atlassian.bamboo.build.BuildStatusHelper
-
Constructor Summary
ConstructorDescriptionBuildStatusHelper
(@Nullable ImmutableBuildable buildable, @NotNull PlanKey planKey, int buildNumber, @NotNull ResultsSummaryManager resultsSummaryManager) BuildStatusHelper
(@Nullable ImmutablePlan plan, @NotNull PlanKey planKey, @NotNull ResultsSummary currentBuildResult, @NotNull ResultsSummaryManager resultsSummaryManager) -
Method Summary
Modifier and TypeMethodDescription@NotNull ImmutablePlan
getBuild()
int
getCountOfPrecedingResultsInState
(int lowerBuildNumber, BuildState buildState) Returns count of preceding results in state buildState with range starting with build lowerBuildNumber (inclusive).int
@Nullable ResultsSummary
If the currentBuildResult is set and failing then return first failed BuildResultSummary in series.@Nullable ResultsSummary
Poorly named method.@Nullable ResultsSummary
If the currentBuildResult is set and not successful then return first successful BuildResultSummary after this one.@Nullable ResultsSummary
If the currentBuildResult is set and successful then return first failed BuildResultSummary in series that preceded currentBuildResult.int
@Nullable ResultsSummary
@Nullable ResultsSummary
If the currentBuildResult is set and successful then return first successful BuildResultSummary in series.
-
Constructor Details
-
BuildStatusHelper
public BuildStatusHelper(@Nullable @Nullable ImmutablePlan plan, @NotNull @NotNull PlanKey planKey, @NotNull @NotNull ResultsSummary currentBuildResult, @NotNull @NotNull ResultsSummaryManager resultsSummaryManager) -
BuildStatusHelper
public BuildStatusHelper(@Nullable @Nullable ImmutableBuildable buildable, @NotNull @NotNull PlanKey planKey, int buildNumber, @NotNull @NotNull ResultsSummaryManager resultsSummaryManager)
-
-
Method Details
-
getFixedInBuild
If the currentBuildResult is set and not successful then return first successful BuildResultSummary after this one. Returns null if currentBuildResult is not set or currentBuildResult is set and successful or if there was no successful build after this one.- Returns:
- first successful BuildResultSummary after this one
-
getPreviousSuccessfulBuild
- Returns:
- previous successful BuildResultSummary or null if none found
-
getFailingSinceBuild
If the currentBuildResult is set and failing then return first failed BuildResultSummary in series. Returns null if: - currentBuildResult is not set, or - currentBuildResult is set and not failing- Returns:
- first failing BuildResultSummary in a series that contains currentBuildResult
-
getFixesBuild
If the currentBuildResult is set and successful then return first failed BuildResultSummary in series that preceded currentBuildResult. Returns null if: - currentBuildResult is not set, or - currentBuildResult is set and not successful, or - previous successful BuildResultSummary is not found, or - failing build not found between previous successful BuildResultSummary and currentBuildResult- Returns:
- first failed BuildResultSummary in series that preceded currentBuildResult
-
getPrecedingConsecutiveFailuresCount
public int getPrecedingConsecutiveFailuresCount()- Returns:
- number of consecutive failures preceding the current BuildResultSummary. 0 if conditions for getFailingSinceBuild() are not met
-
getSucceedingSinceBuild
If the currentBuildResult is set and successful then return first successful BuildResultSummary in series. Returns null if: - currentBuildResult is not set, or - currentBuildResult is set and not successful- Returns:
- first successful BuildResultSummary in a series that contains currentBuildResult
-
getCountSucceedingSince
public int getCountSucceedingSince()- Returns:
- number of successful BuildResultSummary preceding and including currentBuildResult in a series, 0 if conditions for getSucceedingSinceBuild() are not met
-
getBuild
-
getFirstBuildInSequence
Poorly named method. Returns the firstBuildResultsSummary
in this sequence. Essentially, it tries to find the first failing build, failing that it finds the build that this build fixes- Returns:
- May return null if neither conditions are met
-
getCountOfPrecedingResultsInState
Returns count of preceding results in state buildState with range starting with build lowerBuildNumber (inclusive). The count does not include the current result.
-