Skip to content
Open
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
10 changes: 5 additions & 5 deletions src/ci/citool/src/jobs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ pub fn load_job_db(db: &str) -> anyhow::Result<JobDatabase> {
/// modulo certain carve-outs" in [`validate_job_database`].
///
/// This invariant is important to make sure that it's not easily possible (without modifying
/// `citool`) to have PRs with red PR-only CI jobs merged into `master`, causing all subsequent PR
/// `citool`) to have PRs with red PR-only CI jobs merged into `main`, causing all subsequent PR
/// CI runs to be red until the cause is fixed.
fn register_pr_jobs_as_auto_jobs(db: &mut JobDatabase) -> anyhow::Result<()> {
for pr_job in &db.pr_jobs {
Expand Down Expand Up @@ -273,7 +273,7 @@ pub enum RunType {
/// Merge attempt workflow
AutoJob,
/// Fake job only used for sharing Github Actions cache.
MasterJob,
MainJob,
}

/// Maximum number of custom try jobs that can be requested in a single
Expand Down Expand Up @@ -323,7 +323,7 @@ fn calculate_jobs(
(jobs, "try", &db.envs.try_env)
}
RunType::AutoJob => (db.auto_jobs.clone(), "auto", &db.envs.auto_env),
RunType::MasterJob => return Ok(vec![]),
RunType::MainJob => return Ok(vec![]),
};
let jobs = substitute_github_vars(jobs.clone())
.context("Failed to substitute GitHub context variables in jobs")?;
Expand Down Expand Up @@ -376,15 +376,15 @@ pub fn calculate_job_matrix(
eprintln!("Run type: {run_type:?}");

let jobs = calculate_jobs(&run_type, &db, channel)?;
if jobs.is_empty() && !matches!(run_type, RunType::MasterJob) {
if jobs.is_empty() && !matches!(run_type, RunType::MainJob) {
return Err(anyhow::anyhow!("Computed job list is empty"));
}

let run_type = match run_type {
RunType::PullRequest => "pr",
RunType::TryJob { .. } => "try",
RunType::AutoJob => "auto",
RunType::MasterJob => "master",
RunType::MainJob => "main",
};

eprintln!("Output");
Expand Down
2 changes: 1 addition & 1 deletion src/ci/citool/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl GitHubContext {
Some(RunType::TryJob { job_patterns: patterns })
}
("push", "refs/heads/auto") => Some(RunType::AutoJob),
("push", "refs/heads/master") => Some(RunType::MasterJob),
("push", "refs/heads/main") => Some(RunType::MainJob),
_ => None,
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/ci/citool/tests/jobs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ fn pr_jobs() {
}

#[test]
fn master_jobs() {
let stdout = get_matrix("push", "commit", "refs/heads/master");
fn main_jobs() {
let stdout = get_matrix("push", "commit", "refs/heads/main");
insta::assert_snapshot!(stdout, @r#"
jobs=[]
run_type=master
run_type=main
"#);
}

Expand Down
Loading