Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/mergify-ci/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ publish = false
chrono = { version = "0.4", default-features = false, features = ["clock", "serde", "std"] }
flate2 = "1"
getrandom = "0.3"
glob = "0.3"
globset = "0.4"
mergify-config = { path = "../mergify-config" }
mergify-core = { path = "../mergify-core" }
Expand Down
10 changes: 10 additions & 0 deletions crates/mergify-ci/src/detector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,16 @@ fn non_empty_env(name: &str) -> Option<String> {
env::var(name).ok().filter(|s| !s.is_empty())
}

/// Branch the quarantine API should look up tests for. Mirrors
/// Python's `get_tests_target_branch`: the PR base branch when
/// available, otherwise the head branch — i.e. "the branch the
/// tests *will* land on" so quarantine decisions match where
/// the merge will go.
#[must_use]
pub fn get_tests_target_branch() -> Option<String> {
get_base_ref_name().or_else(get_head_ref_name)
}

#[cfg(test)]
mod tests {
use super::*;
Expand Down
Loading
Loading