Skip to content

Commit 4902437

Browse files
committed
Limit the success range check to >= 1000 to check against to avoid false positives
1 parent 3b3ed01 commit 4902437

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Sources/App/Commands/Alerting.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ extension Alerting {
102102
builds.validateSwiftVersionsSuccessful().log(check: "CHECK_BUILDS_SWIFT_VERSIONS_SUCCESSFUL")
103103
builds.validateRunnerIdsPresent().log(check: "CHECK_BUILDS_RUNNER_IDS_PRESENT")
104104
builds.validateRunnerIdsSuccessful().log(check: "CHECK_BUILDS_RUNNER_IDS_SUCCESSFUL")
105-
builds.validateSuccessRateInRange().log(check: "CHECK_BUILDS_SUCCESS_RATE_IN_RANGE")
105+
if builds.count >= 1000 { // only run this test if we have a decent number of builds
106+
builds.validateSuccessRateInRange().log(check: "CHECK_BUILDS_SUCCESS_RATE_IN_RANGE")
107+
}
106108
}
107109

108110
static func fetchBuilds(on database: Database, timePeriod: TimeAmount, limit: Int) async throws -> [Alerting.BuildInfo] {

0 commit comments

Comments
 (0)