From 4eb0beb3d9aea77406b9742e3832cbfa9940f94b Mon Sep 17 00:00:00 2001 From: Redddy Date: Mon, 10 Nov 2025 20:29:33 +0900 Subject: [PATCH] Rename master branch references to main --- src/ci/citool/src/jobs.rs | 10 +++++----- src/ci/citool/src/main.rs | 2 +- src/ci/citool/tests/jobs.rs | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/ci/citool/src/jobs.rs b/src/ci/citool/src/jobs.rs index 47516cbc1f4cd..245ab31fa6446 100644 --- a/src/ci/citool/src/jobs.rs +++ b/src/ci/citool/src/jobs.rs @@ -123,7 +123,7 @@ pub fn load_job_db(db: &str) -> anyhow::Result { /// 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 { @@ -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 @@ -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")?; @@ -376,7 +376,7 @@ 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")); } @@ -384,7 +384,7 @@ pub fn calculate_job_matrix( RunType::PullRequest => "pr", RunType::TryJob { .. } => "try", RunType::AutoJob => "auto", - RunType::MasterJob => "master", + RunType::MainJob => "main", }; eprintln!("Output"); diff --git a/src/ci/citool/src/main.rs b/src/ci/citool/src/main.rs index 255d39846da1f..4fe9cee900ca6 100644 --- a/src/ci/citool/src/main.rs +++ b/src/ci/citool/src/main.rs @@ -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, } } diff --git a/src/ci/citool/tests/jobs.rs b/src/ci/citool/tests/jobs.rs index 24e0b85cab22f..5231d4616e049 100644 --- a/src/ci/citool/tests/jobs.rs +++ b/src/ci/citool/tests/jobs.rs @@ -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 "#); }