Skip to content

Commit e356059

Browse files
committed
Reduce complexity, always sync
1 parent 466551a commit e356059

23 files changed

+22
-1231
lines changed

Diff for: .github/workflows/sync.yml

+21-13
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
# Based on https://www.growingwiththeweb.com/2016/07/enabling-pull-requests-on-github-wikis.html
22
name: Sync Two Wiki Repos
3+
34
on:
5+
# Merged PRs
46
push:
57
branches: [master]
8+
# Weekly
9+
schedule:
10+
# https://crontab.guru/#0_12_*_*_1
11+
- cron: "0 12 * * 1"
12+
# Whenever someone asks
13+
workflow_dispatch:
614

715
jobs:
816
sync:
@@ -14,19 +22,19 @@ jobs:
1422
- run: git config user.name "typescript-bot"
1523
- run: git config user.email "[email protected]"
1624

17-
# Add the authed remotes for .
18-
- run: git remote add upstream https://[email protected]/microsoft/TypeScript.wiki.git > /dev/null 2>&1
25+
# Replace remotes with auth'd versions, then pull the .wiki version (the one people can't PR to)
26+
# then merge in any changes from here and push
27+
-
28+
run: |
29+
git remote add upstream https://[email protected]/microsoft/TypeScript.wiki.git > /dev/null 2>&1
30+
git remote remove origin
31+
git remote add origin https://[email protected]/microsoft/TypeScript-wiki.git > /dev/null 2>&1
32+
git remote add upstream https://[email protected]/microsoft/TypeScript.wiki.git > /dev/null 2>&1
33+
git fetch origin
34+
git fetch upstream
35+
git merge upstream/master --no-edit
36+
git push origin HEAD:master > /dev/null 2>&1
37+
git push upstream HEAD:master > /dev/null 2>&1
1938
env:
2039
GITHUB_TOKEN: ${{ secrets.TS_BOT_TOKEN }}
2140

22-
# Update search links from the origin repo before pushing to the upstream
23-
- run: git clone --depth 1 https://github.com/microsoft/TypeScript.git TypeScript
24-
- run: npm i
25-
- run: node scripts/convertRelativeLinksToHardcoded.js "**/*.md" --write
26-
- run: rm -rf TypeScript
27-
28-
- run: git add .
29-
- run: git commit --amend --no-edit
30-
31-
# Push to the auth'd branch
32-
- run: git push upstream HEAD:master -f > /dev/null 2>&1

Diff for: Spec conformance testing.md

+1-24
Original file line numberDiff line numberDiff line change
@@ -1,24 +1 @@
1-
When a spec change is checked in (for example [#589](https://github.com/Microsoft/TypeScript/pull/589)), it is necessary to ensure thorough test coverage for all the areas that have changed. In other words, all changes in the spec should be observable somewhere in the tests/cases/conformance folder. The following process explains how to ensure this coverage.
2-
3-
For each spec change:
4-
5-
1. Try to find a bug for the spec change. Also look at any pull requests associated with that bug.
6-
7-
1. If there is a pull request that changed the compiler’s behavior, inspect the tests that were added as part of that pull request. If they look fitting, move them to the appropriate spot in the conformance suite. Update the baselines (the only change should be the path of the test they reference).
8-
9-
1. If there is no pull request or no bug, try to find a test in [`tests/cases/conformance`](https://github.com/Microsoft/TypeScript/tree/master/tests/cases/conformance/) that exercises this scenario. If there is, verify that the baseline agrees with the spec.
10-
11-
1. If there is no test in conformance, but there is a test in compiler that looks suitable, move it into conformance, and again verify that the baseline agrees with the spec.
12-
13-
1. If there is no existing test, or you’re unable to find one, write a test in the conformance suite. Then verify that the baselines match the spec.
14-
15-
1. If in any of the steps above, the baseline did not match the spec, try to find a bug that says to change the compiler or to change the spec. Make sure that bug is up to date, and add the test info to the bug. If it is closed, reopen it.
16-
17-
1. If there is no bug, find out if the spec or the implementation should be changed, and log a bug for it.
18-
19-
When this process is complete, send a pull request for any tests you have added. Check it in as a normal code change (an example pull request is [#621](https://github.com/Microsoft/TypeScript/pull/621)). Make sure to reference the spec change pull request in your pull request.
20-
21-
Some guidelines and examples for specific test:
22-
* Sometimes if there is a code change associated with a spec change, the tests that have been added along with the code change are sufficient, and merely need to be moved. An example is [`tests/cases/compiler/indexSignatureTypeInference.ts`](https://github.com/Microsoft/TypeScript/tree/master/tests/cases/compiler/indexSignatureTypeInference.ts) in pull request [#196](https://github.com/Microsoft/TypeScript/pull/196). You can see in pull request [#621](https://github.com/Microsoft/TypeScript/pull/621), this file was just moved into the conformance folder.
23-
* Other changes are in broad areas that are very well tested already. For example, the change to best common type (section 3.10) in [#589](https://github.com/Microsoft/TypeScript/pull/589) has an entire folder under [`tests/cases/conformance/types/typeRelationships/bestCommonType`](https://github.com/Microsoft/TypeScript/tree/master/tests/cases/conformance/types/typeRelationships/bestCommonType). To verify that this is sufficient, make sure that every bullet in the changed spec has some code in the test folder that exercises it.
24-
* Lastly, for new sections of the spec, and for sections where we have poor coverage, it may be necessary to add some amount of new test material. An example is the change to type queries (section 3.6.3) in change [#589](https://github.com/Microsoft/TypeScript/pull/589). Take a look at file [`tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithTypeof.ts`](https://github.com/Microsoft/TypeScript/blob/specConformanceTests/tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithTypeof.ts) in [#621](https://github.com/Microsoft/TypeScript/pull/621) to see an example of adding tests for a change like this. The amount of testing necessary here is based on judgment of how complex the changed area is.
1+
## This page is deprecated

Diff for: _Footer.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
### Want to contribute to this Wiki?
22

3-
43
[Fork it and send a pull request.](https://github.com/Microsoft/TypeScript-wiki)

Diff for: learn/compiler-glossary.md

-270
This file was deleted.

Diff for: learn/compiler/compiler-checker-inferrence.md

-25
This file was deleted.

0 commit comments

Comments
 (0)