Skip to content

Commit c7db4e2

Browse files
committed
Rename master branch references to main
1 parent 00426d6 commit c7db4e2

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

src/ci/citool/src/jobs.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ pub fn load_job_db(db: &str) -> anyhow::Result<JobDatabase> {
123123
/// modulo certain carve-outs" in [`validate_job_database`].
124124
///
125125
/// This invariant is important to make sure that it's not easily possible (without modifying
126-
/// `citool`) to have PRs with red PR-only CI jobs merged into `master`, causing all subsequent PR
126+
/// `citool`) to have PRs with red PR-only CI jobs merged into `main`, causing all subsequent PR
127127
/// CI runs to be red until the cause is fixed.
128128
fn register_pr_jobs_as_auto_jobs(db: &mut JobDatabase) -> anyhow::Result<()> {
129129
for pr_job in &db.pr_jobs {
@@ -273,7 +273,7 @@ pub enum RunType {
273273
/// Merge attempt workflow
274274
AutoJob,
275275
/// Fake job only used for sharing Github Actions cache.
276-
MasterJob,
276+
MainJob,
277277
}
278278

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

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

383383
let run_type = match run_type {
384384
RunType::PullRequest => "pr",
385385
RunType::TryJob { .. } => "try",
386386
RunType::AutoJob => "auto",
387-
RunType::MasterJob => "master",
387+
RunType::MainJob => "main",
388388
};
389389

390390
eprintln!("Output");

src/ci/citool/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ impl GitHubContext {
4747
Some(RunType::TryJob { job_patterns: patterns })
4848
}
4949
("push", "refs/heads/auto") => Some(RunType::AutoJob),
50-
("push", "refs/heads/master") => Some(RunType::MasterJob),
50+
("push", "refs/heads/main") => Some(RunType::MainJob),
5151
_ => None,
5252
}
5353
}

src/ci/citool/tests/jobs.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ fn pr_jobs() {
4646
}
4747

4848
#[test]
49-
fn master_jobs() {
50-
let stdout = get_matrix("push", "commit", "refs/heads/master");
49+
fn main_jobs() {
50+
let stdout = get_matrix("push", "commit", "refs/heads/main");
5151
insta::assert_snapshot!(stdout, @r#"
5252
jobs=[]
53-
run_type=master
53+
run_type=main
5454
"#);
5555
}
5656

src/ci/publish_toolstate.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ for RETRY_COUNT in 1 2 3 4 5; do
3434
FAILURE=0
3535
git commit -a -F "$MESSAGE_FILE" || break
3636
# On failure randomly sleep for 0 to 3 seconds as a crude way to introduce jittering.
37-
git push origin master && break || sleep $(LC_ALL=C tr -cd 0-3 < /dev/urandom | head -c 1)
37+
git push origin main && break || sleep $(LC_ALL=C tr -cd 0-3 < /dev/urandom | head -c 1)
3838
FAILURE=1
39-
git fetch origin master
40-
git reset --hard origin/master
39+
git fetch origin main
40+
git reset --hard origin/main
4141
done

0 commit comments

Comments
 (0)