Skip to content

Switch references to master to main in the codebase + validating infra post-main migration #44347

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 1, 2021
Merged
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
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ Thank you for submitting a pull request!

Please verify that:
* [ ] There is an associated issue in the `Backlog` milestone (**required**)
* [ ] Code is up-to-date with the `master` branch
* [ ] Code is up-to-date with the `main` branch
* [ ] You've successfully run `gulp runtests` locally
* [ ] There are new or updated unit tests validating the change

Refer to CONTRIBUTING.MD for more details.
https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md
https://github.com/Microsoft/TypeScript/blob/main/CONTRIBUTING.md
-->

Fixes #
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ name: CI
on:
push:
branches:
- master
- main
- release-*
pull_request:
branches:
- master
- main
- release-*

jobs:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sync-branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:
- run: |
git config user.email "[email protected]"
git config user.name "TypeScript Bot"
git fetch origin master
git merge origin/master --no-ff
git fetch origin main
git merge origin/main --no-ff
npm ci
npm test
git push
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ You will need to complete a Contributor License Agreement (CLA). Briefly, this a
Your pull request should:

* Include a description of what your change intends to do
* Be based on reasonably recent commit in the **master** branch
* Be based on reasonably recent commit in the **main** branch
* Include adequate tests
* At least one test should fail in the absence of your non-test code changes. If your PR does not match this criteria, please specify why
* Tests should include reasonable permutations of the target fix/change
Expand All @@ -118,7 +118,7 @@ There are three relevant locations to be aware of when it comes to TypeScript's
* `lib`: the location of the last-known-good (LKG) versions of the files which are updated periodically.
* `built/local`: the build output location, including where `src/lib` files will be copied to.

Any changes should be made to [src/lib](https://github.com/Microsoft/TypeScript/tree/master/src/lib). **Most** of these files can be updated by hand, with the exception of any generated files (see below).
Any changes should be made to [src/lib](https://github.com/Microsoft/TypeScript/tree/main/src/lib). **Most** of these files can be updated by hand, with the exception of any generated files (see below).

Library files in `built/local/` are updated automatically by running the standard build task:

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ npm install -g typescript@next

## Contribute

There are many ways to [contribute](https://github.com/microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript.
There are many ways to [contribute](https://github.com/microsoft/TypeScript/blob/main/CONTRIBUTING.md) to TypeScript.
* [Submit bugs](https://github.com/microsoft/TypeScript/issues) and help us verify fixes as they are checked in.
* Review the [source code changes](https://github.com/microsoft/TypeScript/pulls).
* Engage with other TypeScript users and developers on [StackOverflow](https://stackoverflow.com/questions/tagged/typescript).
* Help each other in the [TypeScript Community Discord](https://discord.gg/typescript).
* Join the [#typescript](https://twitter.com/search?q=%23TypeScript) discussion on Twitter.
* [Contribute bug fixes](https://github.com/microsoft/TypeScript/blob/master/CONTRIBUTING.md).
* Read the archived language specification ([docx](https://github.com/microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification%20-%20ARCHIVED.docx?raw=true),
[pdf](https://github.com/microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification%20-%20ARCHIVED.pdf?raw=true), [md](https://github.com/microsoft/TypeScript/blob/master/doc/spec-ARCHIVED.md)).
* [Contribute bug fixes](https://github.com/microsoft/TypeScript/blob/main/CONTRIBUTING.md).
* Read the archived language specification ([docx](https://github.com/microsoft/TypeScript/blob/main/doc/TypeScript%20Language%20Specification%20-%20ARCHIVED.docx?raw=true),
[pdf](https://github.com/microsoft/TypeScript/blob/main/doc/TypeScript%20Language%20Specification%20-%20ARCHIVED.pdf?raw=true), [md](https://github.com/microsoft/TypeScript/blob/main/doc/spec-ARCHIVED.md)).

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see
the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected])
Expand Down
10 changes: 5 additions & 5 deletions scripts/open-user-pr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ const userName = process.env.GH_USERNAME || "typescript-bot";
const reviewers = process.env.REQUESTING_USER ? [process.env.REQUESTING_USER] : ["weswigham", "sandersn", "RyanCavanaugh"];
const now = new Date();
const masterBranchname = `user-baseline-updates`;
const targetBranch = process.env.TARGET_BRANCH || "master";
const branchName = process.env.TARGET_FORK?.toLowerCase() === "microsoft" && (targetBranch === "master" || targetBranch === "refs/heads/master")
const targetBranch = process.env.TARGET_BRANCH || "main";
const branchName = process.env.TARGET_FORK?.toLowerCase() === "microsoft" && (targetBranch === "main" || targetBranch === "refs/heads/main")
? masterBranchname
: `user-update-${process.env.TARGET_FORK}-${process.env.TARGET_BRANCH ? "-" + process.env.TARGET_BRANCH : ""}`;
const remoteUrl = `https://${process.argv[2]}@github.com/${userName}/TypeScript.git`;
const baseRef = branchName === masterBranchname ? "master" : masterBranchname;
const baseRef = branchName === masterBranchname ? "main" : masterBranchname;
runSequence([
["git", ["remote", "add", "fork", remoteUrl]], // Add the remote fork
["git", ["checkout", "."]], // reset any changes
["git", ["fetch", baseRef === "master" ? "origin" : "fork", baseRef]], // fetch target ref in case it's not present locally
["git", ["fetch", baseRef === "main" ? "origin" : "fork", baseRef]], // fetch target ref in case it's not present locally
["git", ["checkout", baseRef]], // move head to target
["node", ["./node_modules/gulp/bin/gulp.js", "baseline-accept"]], // accept baselines
["git", ["checkout", "-b", branchName]], // create a branch
Expand All @@ -36,7 +36,7 @@ gh.pulls.create({
maintainer_can_modify: true,
title: `🤖 User test baselines have changed` + (process.env.TARGET_BRANCH ? ` for ${process.env.TARGET_BRANCH}` : ""),
head: `${userName}:${branchName}`,
base: branchName === masterBranchname ? "master" : masterBranchname,
base: branchName === masterBranchname ? "main" : masterBranchname,
body:
`${process.env.SOURCE_ISSUE ? `This test run was triggerd by a request on https://github.com/Microsoft/TypeScript/pull/${process.env.SOURCE_ISSUE} `+"\n" : ""}Please review the diff and merge if no changes are unexpected.
You can view the build log [here](https://typescript.visualstudio.com/TypeScript/_build/index?buildId=${process.env.BUILD_BUILDID}&_a=summary).
Expand Down
12 changes: 6 additions & 6 deletions scripts/update-experimental-branches.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ async function main() {
// Forcibly cleanup workspace
runSequence([
["git", ["checkout", "."]],
["git", ["fetch", "-fu", "origin", "master:master"]],
["git", ["checkout", "master"]],
["git", ["fetch", "-fu", "origin", "main:main"]],
["git", ["checkout", "main"]],
["git", ["remote", "add", "fork", remoteUrl]], // Add the remote fork
]);

Expand All @@ -51,15 +51,15 @@ async function main() {
owner: "Microsoft",
repo: "TypeScript",
issue_number: num,
body: `This PR is configured as an experiment, and currently has rebase conflicts with master - please rebase onto master and fix the conflicts.`
body: `This PR is configured as an experiment, and currently has rebase conflicts with main - please rebase onto main and fix the conflicts.`
});
}
throw new Error(`Rebase conflict detected in PR ${num} with master`); // A PR is currently in conflict, give up
throw new Error(`Rebase conflict detected in PR ${num} with main`); // A PR is currently in conflict, give up
}
runSequence([
["git", ["fetch", "origin", `pull/${num}/head:${num}`]],
["git", ["checkout", `${num}`]],
["git", ["rebase", "master"]],
["git", ["rebase", "main"]],
["git", ["push", "-f", "-u", "fork", `${num}`]], // Keep a rebased copy of this branch in our fork
]);

Expand All @@ -71,7 +71,7 @@ async function main() {

// Return to `master` and make a new `experimental` branch
runSequence([
["git", ["checkout", "master"]],
["git", ["checkout", "main"]],
["git", ["checkout", "-b", "experimental"]],
]);

Expand Down