-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IOSP-196] Include config to only consider *required* checks to merge (…
…#31) * Original Implementation (pending tests) * [Tests] makeState() -> MergeService.State.stub() For consistency with other test files * Avoid fetching required statuses if all success * Create more stub methods for GitHub models Fix tests * Code cleanup and documentation * Fix logic, using MergeState.unstable * sendStatusEvent test helper * Add tests for new feature * 🧹 * Address PR feedback * Rename `strict` to `isStrict`
- Loading branch information
1 parent
7edb5bc
commit 312c739
Showing
19 changed files
with
532 additions
and
272 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import Foundation | ||
|
||
public struct RequiredStatusChecks: Decodable, Equatable { | ||
/// Require branches to be up to date before merging? | ||
public let isStrict: Bool | ||
/// Names of status checks marked as Required | ||
public let contexts: [String] | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case isStrict = "strict" | ||
case contexts | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
import Foundation | ||
|
||
let GitHubPullRequestEvent: String = """ | ||
{ | ||
"action": "closed", | ||
|
17 changes: 17 additions & 0 deletions
17
Tests/BotTests/Canned Data/GitHubRequiredStatusChecks.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
let GitHubRequiredStatusChecks: String = """ | ||
{ | ||
"url": "https://api.github.com/repos/babylonhealth/babylon-ios/branches/develop/protection/required_status_checks", | ||
"strict": true, | ||
"contexts": [ | ||
"ci/circleci: Build: SDK", | ||
"ci/circleci: UnitTests: Ascension", | ||
"ci/circleci: UnitTests: BabylonKSA", | ||
"ci/circleci: UnitTests: BabylonUS", | ||
"ci/circleci: UnitTests: Telus", | ||
"ci/circleci: SnapshotTests: BabylonChatBotUI", | ||
"ci/circleci: SnapshotTests: BabylonUI", | ||
"ci/circleci: SnapshotTests: Babylon" | ||
], | ||
"contexts_url": "https://api.github.com/repos/babylonhealth/babylon-ios/branches/develop/protection/required_status_checks/contexts" | ||
} | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
import Foundation | ||
|
||
let GitHubStatusEvent: String = """ | ||
{ | ||
"id": 5018968172, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.