Switch references to master to main in the codebase + validating infra post-main migration (#44347)
* Update package.json * Remove references to master in the codebase * Add more master - main
This commit is contained in:
parent
4c018818c1
commit
b603a04eed
4
.github/pull_request_template.md
vendored
4
.github/pull_request_template.md
vendored
|
@ -3,12 +3,12 @@ Thank you for submitting a pull request!
|
||||||
|
|
||||||
Please verify that:
|
Please verify that:
|
||||||
* [ ] There is an associated issue in the `Backlog` milestone (**required**)
|
* [ ] 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
|
* [ ] You've successfully run `gulp runtests` locally
|
||||||
* [ ] There are new or updated unit tests validating the change
|
* [ ] There are new or updated unit tests validating the change
|
||||||
|
|
||||||
Refer to CONTRIBUTING.MD for more details.
|
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 #
|
Fixes #
|
||||||
|
|
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
|
@ -3,11 +3,11 @@ name: CI
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- main
|
||||||
- release-*
|
- release-*
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- main
|
||||||
- release-*
|
- release-*
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
4
.github/workflows/sync-branch.yaml
vendored
4
.github/workflows/sync-branch.yaml
vendored
|
@ -28,8 +28,8 @@ jobs:
|
||||||
- run: |
|
- run: |
|
||||||
git config user.email "typescriptbot@microsoft.com"
|
git config user.email "typescriptbot@microsoft.com"
|
||||||
git config user.name "TypeScript Bot"
|
git config user.name "TypeScript Bot"
|
||||||
git fetch origin master
|
git fetch origin main
|
||||||
git merge origin/master --no-ff
|
git merge origin/main --no-ff
|
||||||
npm ci
|
npm ci
|
||||||
npm test
|
npm test
|
||||||
git push
|
git push
|
||||||
|
|
|
@ -102,7 +102,7 @@ You will need to complete a Contributor License Agreement (CLA). Briefly, this a
|
||||||
Your pull request should:
|
Your pull request should:
|
||||||
|
|
||||||
* Include a description of what your change intends to do
|
* 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
|
* 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
|
* 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
|
* Tests should include reasonable permutations of the target fix/change
|
||||||
|
@ -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.
|
* `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.
|
* `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:
|
Library files in `built/local/` are updated automatically by running the standard build task:
|
||||||
|
|
||||||
|
|
|
@ -26,15 +26,15 @@ npm install -g typescript@next
|
||||||
|
|
||||||
## Contribute
|
## 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.
|
* [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).
|
* 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).
|
* 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).
|
* Help each other in the [TypeScript Community Discord](https://discord.gg/typescript).
|
||||||
* Join the [#typescript](https://twitter.com/search?q=%23TypeScript) discussion on Twitter.
|
* Join the [#typescript](https://twitter.com/search?q=%23TypeScript) discussion on Twitter.
|
||||||
* [Contribute bug fixes](https://github.com/microsoft/TypeScript/blob/master/CONTRIBUTING.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/master/doc/TypeScript%20Language%20Specification%20-%20ARCHIVED.docx?raw=true),
|
* 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/master/doc/TypeScript%20Language%20Specification%20-%20ARCHIVED.pdf?raw=true), [md](https://github.com/microsoft/TypeScript/blob/master/doc/spec-ARCHIVED.md)).
|
[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
|
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 [opencode@microsoft.com](mailto:opencode@microsoft.com)
|
the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com)
|
||||||
|
|
|
@ -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 reviewers = process.env.REQUESTING_USER ? [process.env.REQUESTING_USER] : ["weswigham", "sandersn", "RyanCavanaugh"];
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const masterBranchname = `user-baseline-updates`;
|
const masterBranchname = `user-baseline-updates`;
|
||||||
const targetBranch = process.env.TARGET_BRANCH || "master";
|
const targetBranch = process.env.TARGET_BRANCH || "main";
|
||||||
const branchName = process.env.TARGET_FORK?.toLowerCase() === "microsoft" && (targetBranch === "master" || targetBranch === "refs/heads/master")
|
const branchName = process.env.TARGET_FORK?.toLowerCase() === "microsoft" && (targetBranch === "main" || targetBranch === "refs/heads/main")
|
||||||
? masterBranchname
|
? masterBranchname
|
||||||
: `user-update-${process.env.TARGET_FORK}-${process.env.TARGET_BRANCH ? "-" + process.env.TARGET_BRANCH : ""}`;
|
: `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 remoteUrl = `https://${process.argv[2]}@github.com/${userName}/TypeScript.git`;
|
||||||
const baseRef = branchName === masterBranchname ? "master" : masterBranchname;
|
const baseRef = branchName === masterBranchname ? "main" : masterBranchname;
|
||||||
runSequence([
|
runSequence([
|
||||||
["git", ["remote", "add", "fork", remoteUrl]], // Add the remote fork
|
["git", ["remote", "add", "fork", remoteUrl]], // Add the remote fork
|
||||||
["git", ["checkout", "."]], // reset any changes
|
["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
|
["git", ["checkout", baseRef]], // move head to target
|
||||||
["node", ["./node_modules/gulp/bin/gulp.js", "baseline-accept"]], // accept baselines
|
["node", ["./node_modules/gulp/bin/gulp.js", "baseline-accept"]], // accept baselines
|
||||||
["git", ["checkout", "-b", branchName]], // create a branch
|
["git", ["checkout", "-b", branchName]], // create a branch
|
||||||
|
@ -36,7 +36,7 @@ gh.pulls.create({
|
||||||
maintainer_can_modify: true,
|
maintainer_can_modify: true,
|
||||||
title: `🤖 User test baselines have changed` + (process.env.TARGET_BRANCH ? ` for ${process.env.TARGET_BRANCH}` : ""),
|
title: `🤖 User test baselines have changed` + (process.env.TARGET_BRANCH ? ` for ${process.env.TARGET_BRANCH}` : ""),
|
||||||
head: `${userName}:${branchName}`,
|
head: `${userName}:${branchName}`,
|
||||||
base: branchName === masterBranchname ? "master" : masterBranchname,
|
base: branchName === masterBranchname ? "main" : masterBranchname,
|
||||||
body:
|
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.
|
`${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).
|
You can view the build log [here](https://typescript.visualstudio.com/TypeScript/_build/index?buildId=${process.env.BUILD_BUILDID}&_a=summary).
|
||||||
|
|
|
@ -34,8 +34,8 @@ async function main() {
|
||||||
// Forcibly cleanup workspace
|
// Forcibly cleanup workspace
|
||||||
runSequence([
|
runSequence([
|
||||||
["git", ["checkout", "."]],
|
["git", ["checkout", "."]],
|
||||||
["git", ["fetch", "-fu", "origin", "master:master"]],
|
["git", ["fetch", "-fu", "origin", "main:main"]],
|
||||||
["git", ["checkout", "master"]],
|
["git", ["checkout", "main"]],
|
||||||
["git", ["remote", "add", "fork", remoteUrl]], // Add the remote fork
|
["git", ["remote", "add", "fork", remoteUrl]], // Add the remote fork
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -51,15 +51,15 @@ async function main() {
|
||||||
owner: "Microsoft",
|
owner: "Microsoft",
|
||||||
repo: "TypeScript",
|
repo: "TypeScript",
|
||||||
issue_number: num,
|
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([
|
runSequence([
|
||||||
["git", ["fetch", "origin", `pull/${num}/head:${num}`]],
|
["git", ["fetch", "origin", `pull/${num}/head:${num}`]],
|
||||||
["git", ["checkout", `${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
|
["git", ["push", "-f", "-u", "fork", `${num}`]], // Keep a rebased copy of this branch in our fork
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ async function main() {
|
||||||
|
|
||||||
// Return to `master` and make a new `experimental` branch
|
// Return to `master` and make a new `experimental` branch
|
||||||
runSequence([
|
runSequence([
|
||||||
["git", ["checkout", "master"]],
|
["git", ["checkout", "main"]],
|
||||||
["git", ["checkout", "-b", "experimental"]],
|
["git", ["checkout", "-b", "experimental"]],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue