Package com.atlassian.bamboo.build
Class BuildStatusHelper
- java.lang.Object
-
- com.atlassian.bamboo.build.BuildStatusHelper
-
public class BuildStatusHelper extends Object
-
-
Constructor Summary
Constructors Constructor Description BuildStatusHelper(@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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @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
getCountSucceedingSince()
@Nullable ResultsSummary
getFailingSinceBuild()
If the currentBuildResult is set and failing then return first failed BuildResultSummary in series.@Nullable ResultsSummary
getFirstBuildInSequence()
Poorly named method.@Nullable ResultsSummary
getFixedInBuild()
If the currentBuildResult is set and not successful then return first successful BuildResultSummary after this one.@Nullable ResultsSummary
getFixesBuild()
If the currentBuildResult is set and successful then return first failed BuildResultSummary in series that preceded currentBuildResult.int
getPrecedingConsecutiveFailuresCount()
@Nullable ResultsSummary
getPreviousSuccessfulBuild()
@Nullable ResultsSummary
getSucceedingSinceBuild()
If the currentBuildResult is set and successful then return first successful BuildResultSummary in series.
-
-
-
Constructor Detail
-
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 Detail
-
getFixedInBuild
@Nullable public @Nullable ResultsSummary 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
@Nullable public @Nullable ResultsSummary getPreviousSuccessfulBuild()
- Returns:
- previous successful BuildResultSummary or null if none found
-
getFailingSinceBuild
@Nullable public @Nullable ResultsSummary 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
@Nullable public @Nullable ResultsSummary 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
@Nullable public @Nullable ResultsSummary 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
@NotNull public @NotNull ImmutablePlan getBuild()
-
getFirstBuildInSequence
@Nullable public @Nullable ResultsSummary 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
public int getCountOfPrecedingResultsInState(int lowerBuildNumber, BuildState buildState)
Returns count of preceding results in state buildState with range starting with build lowerBuildNumber (inclusive). The count does not include the current result.
-
-