Skip to content

Commit fb3cac4

Browse files
committed
Merge branch 'main' into speculation-helper-wip
2 parents dd829c4 + e24d886 commit fb3cac4

File tree

1,699 files changed

+8465
-10780
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,699 files changed

+8465
-10780
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
check-latest: true
7878
- run: npm ci
7979

80-
- uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
80+
- uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
8181
with:
8282
path: ~/.cache/dprint
8383
key: ${{ runner.os }}-dprint-${{ hashFiles('package-lock.json', '.dprint.jsonc') }}

.github/workflows/codeql.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646

4747
# Initializes the CodeQL tools for scanning.
4848
- name: Initialize CodeQL
49-
uses: github/codeql-action/init@47b3d888fe66b639e431abf22ebca059152f1eea # v3.24.5
49+
uses: github/codeql-action/init@8a470fddafa5cbb6266ee11b37ef4d8aae19c571 # v3.24.6
5050
with:
5151
config-file: ./.github/codeql/codeql-configuration.yml
5252
# Override language selection by uncommenting this and choosing your languages
@@ -56,7 +56,7 @@ jobs:
5656
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5757
# If this step fails, then you should remove it and run the build manually (see below).
5858
- name: Autobuild
59-
uses: github/codeql-action/autobuild@47b3d888fe66b639e431abf22ebca059152f1eea # v3.24.5
59+
uses: github/codeql-action/autobuild@8a470fddafa5cbb6266ee11b37ef4d8aae19c571 # v3.24.6
6060

6161
# ℹ️ Command-line programs to run using the OS shell.
6262
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -70,4 +70,4 @@ jobs:
7070
# make release
7171

7272
- name: Perform CodeQL Analysis
73-
uses: github/codeql-action/analyze@47b3d888fe66b639e431abf22ebca059152f1eea # v3.24.5
73+
uses: github/codeql-action/analyze@8a470fddafa5cbb6266ee11b37ef4d8aae19c571 # v3.24.6

.github/workflows/create-cherry-pick-pr.yml

+50-32
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: Create cherry pick PR
22

33
on:
4-
repository_dispatch:
5-
types: [create-cherry-pick-pr]
64
workflow_dispatch:
75
inputs:
86
pr:
@@ -13,10 +11,26 @@ on:
1311
description: Target branch to cherry-pick to
1412
required: true
1513
type: string
14+
15+
# Inputs provided by the bot
16+
distinct_id:
17+
description: '(bot) A distinct ID'
18+
required: false
19+
default: ''
20+
source_issue:
21+
description: '(bot) The issue that triggered this workflow'
22+
required: false
23+
default: ''
1624
requesting_user:
17-
description: User who requested the cherry-pick
18-
required: true
19-
type: string
25+
description: '(bot) The user who requested this workflow'
26+
required: false
27+
default: ''
28+
status_comment:
29+
description: '(bot) The comment to update with the status of this workflow'
30+
required: false
31+
default: ''
32+
33+
run-name: ${{ github.workflow }}${{ inputs.distinct_id && format(' (bot run {0})', inputs.distinct_id) || '' }}
2034

2135
permissions:
2236
contents: read
@@ -40,15 +54,27 @@ jobs:
4054
token: ${{ secrets.TS_BOT_GITHUB_TOKEN }}
4155

4256
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
57+
id: open-pr
4358
env:
44-
PR: ${{ inputs.pr || github.event.client_payload.pr }}
45-
TARGET_BRANCH: ${{ inputs.target_branch || github.event.client_payload.target_branch }}
46-
REQUESTING_USER: ${{ inputs.requesting_user || github.event.client_payload.requesting_user }}
59+
PR: ${{ inputs.pr }}
60+
TARGET_BRANCH: ${{ inputs.target_branch }}
61+
DISTINCT_ID: ${{ inputs.distinct_id }}
62+
SOURCE_ISSUE: ${{ inputs.source_issue }}
63+
REQUESTING_USER: ${{ inputs.requesting_user }}
64+
STATUS_COMMENT: ${{ inputs.status_comment }}
4765
with:
4866
retries: 3
4967
github-token: ${{ secrets.TS_BOT_GITHUB_TOKEN }}
68+
result-encoding: string
5069
script: |
51-
const { PR, TARGET_BRANCH, REQUESTING_USER } = process.env;
70+
const {
71+
PR,
72+
TARGET_BRANCH,
73+
DISTINCT_ID,
74+
SOURCE_ISSUE,
75+
REQUESTING_USER,
76+
STATUS_COMMENT,
77+
} = process.env;
5278
5379
const pr = await github.rest.pulls.get({
5480
owner: context.repo.owner,
@@ -75,6 +101,8 @@ jobs:
75101
head: `${context.repo.owner}:${pickBranch}`,
76102
});
77103
104+
let commentBody;
105+
78106
if (existingPulls.data.length === 0) {
79107
console.log(`No existing PRs found for ${pickBranch}`);
80108
@@ -91,12 +119,7 @@ jobs:
91119
reviewers: ["DanielRosenwasser", REQUESTING_USER],
92120
});
93121
94-
await github.rest.issues.createComment({
95-
owner: context.repo.owner,
96-
repo: context.repo.repo,
97-
issue_number: +PR,
98-
body: `Hey @${REQUESTING_USER}, I've created #${newPr.data.number} for you.`,
99-
});
122+
commentBody = `I've created #${newPr.data.number} for you.`;
100123
}
101124
else {
102125
const existing = existingPulls.data[0];
@@ -109,23 +132,18 @@ jobs:
109132
title,
110133
});
111134
112-
await github.rest.issues.createComment({
113-
owner: context.repo.owner,
114-
repo: context.repo.repo,
115-
issue_number: +PR,
116-
body: `Hey @${REQUESTING_USER}, I've updated #${existing.number} for you.`,
117-
});
135+
commentBody = `I've updated #${existing.number} for you.`;
118136
}
119137
120-
- run: |
121-
MESSAGE="Hey @$REQUESTING_USER, I was unable to cherry-pick this PR."
122-
MESSAGE+=$'\n\n'
123-
MESSAGE+="Check the logs at: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
138+
return commentBody;
124139
125-
gh pr comment "$PR" --repo ${{ github.repository }} --body "$MESSAGE"
126-
if: ${{ failure() }}
127-
env:
128-
PR: ${{ inputs.pr || github.event.client_payload.pr }}
129-
TARGET_BRANCH: ${{ inputs.target_branch || github.event.client_payload.target_branch }}
130-
REQUESTING_USER: ${{ inputs.requesting_user || github.event.client_payload.requesting_user }}
131-
GH_TOKEN: ${{ secrets.TS_BOT_GITHUB_TOKEN }}
140+
- uses: microsoft/typescript-bot-test-triggerer/.github/actions/post-workflow-result@master
141+
if: ${{ !cancelled() && inputs.distinct_id }}
142+
with:
143+
success_comment: ${{ steps.open-pr.outputs.result }}
144+
failure_comment: 'I was unable to cherry-pick this PR.'
145+
github_token: ${{ secrets.TS_BOT_GITHUB_TOKEN }}
146+
distinct_id: ${{ inputs.distinct_id }}
147+
source_issue: ${{ inputs.source_issue }}
148+
requesting_user: ${{ inputs.requesting_user }}
149+
status_comment: ${{ inputs.status_comment }}

.github/workflows/new-release-branch.yaml

+53-10
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,40 @@
11
name: New Release Branch
22

33
on:
4-
repository_dispatch:
5-
types: [new-release-branch]
4+
workflow_dispatch:
5+
inputs:
6+
branch_name:
7+
description: Release branch name to create
8+
required: true
9+
type: string
10+
package_version:
11+
description: Release package version
12+
required: true
13+
type: string
14+
core_major_minor:
15+
description: Release core major.minor version
16+
required: true
17+
type: string
18+
19+
# Inputs provided by the bot
20+
distinct_id:
21+
description: '(bot) A distinct ID'
22+
required: false
23+
default: ''
24+
source_issue:
25+
description: '(bot) The issue that triggered this workflow'
26+
required: false
27+
default: ''
28+
requesting_user:
29+
description: '(bot) The user who requested this workflow'
30+
required: false
31+
default: ''
32+
status_comment:
33+
description: '(bot) The comment to update with the status of this workflow'
34+
required: false
35+
default: ''
36+
37+
run-name: ${{ github.workflow }}${{ inputs.distinct_id && format(' (bot run {0})', inputs.distinct_id) || '' }}
638

739
permissions:
840
contents: read
@@ -30,12 +62,12 @@ jobs:
3062
npm install -g $(jq -r '.packageManager' < package.json)
3163
npm --version
3264
- run: |
33-
git checkout -b ${{ github.event.client_payload.branch_name }}
34-
sed -i -e 's/"version": ".*"/"version": "${{ github.event.client_payload.package_version }}"/g' package.json
35-
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ github.event.client_payload.core_major_minor }}"/g' src/compiler/corePublic.ts
36-
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ github.event.client_payload.core_major_minor }}"/g' tests/baselines/reference/api/typescript.d.ts
37-
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ github.event.client_payload.core_major_minor }}"/g' tests/baselines/reference/api/tsserverlibrary.d.ts
38-
sed -i -e 's/const version\(: string\)\{0,1\} = .*;/const version = "${{ github.event.client_payload.package_version }}" as string;/g' src/compiler/corePublic.ts
65+
git checkout -b ${{ inputs.branch_name }}
66+
sed -i -e 's/"version": ".*"/"version": "${{ inputs.package_version }}"/g' package.json
67+
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ inputs.core_major_minor }}"/g' src/compiler/corePublic.ts
68+
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ inputs.core_major_minor }}"/g' tests/baselines/reference/api/typescript.d.ts
69+
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ inputs.core_major_minor }}"/g' tests/baselines/reference/api/tsserverlibrary.d.ts
70+
sed -i -e 's/const version\(: string\)\{0,1\} = .*;/const version = "${{ inputs.package_version }}" as string;/g' src/compiler/corePublic.ts
3971
npm ci
4072
npm install # update package-lock.json to ensure the version bump is included
4173
npx hereby LKG
@@ -48,5 +80,16 @@ jobs:
4880
git add --force ./lib
4981
git config user.email "typescriptbot@microsoft.com"
5082
git config user.name "TypeScript Bot"
51-
git commit -m 'Bump version to ${{ github.event.client_payload.package_version }} and LKG'
52-
git push --set-upstream origin ${{ github.event.client_payload.branch_name }}
83+
git commit -m 'Bump version to ${{ inputs.package_version }} and LKG'
84+
git push --set-upstream origin ${{ inputs.branch_name }}
85+
86+
- uses: microsoft/typescript-bot-test-triggerer/.github/actions/post-workflow-result@master
87+
if: ${{ !cancelled() && inputs.distinct_id }}
88+
with:
89+
success_comment: "I've created ${{ inputs.branch_name }} with version ${{ inputs.package_version }} for you."
90+
failure_comment: 'I was unable to create the new release branch.'
91+
github_token: ${{ secrets.TS_BOT_GITHUB_TOKEN }}
92+
distinct_id: ${{ inputs.distinct_id }}
93+
source_issue: ${{ inputs.source_issue }}
94+
requesting_user: ${{ inputs.requesting_user }}
95+
status_comment: ${{ inputs.status_comment }}

.github/workflows/nightly.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ on:
55
- cron: '0 7 * * *'
66
# enable users to manually trigger with workflow_dispatch
77
workflow_dispatch: {}
8-
repository_dispatch:
9-
types: [publish-nightly]
108

119
permissions:
1210
contents: read

.github/workflows/scorecard.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ jobs:
5555

5656
# Upload the results to GitHub's code scanning dashboard.
5757
- name: 'Upload to code-scanning'
58-
uses: github/codeql-action/upload-sarif@47b3d888fe66b639e431abf22ebca059152f1eea # v3.24.5
58+
uses: github/codeql-action/upload-sarif@8a470fddafa5cbb6266ee11b37ef4d8aae19c571 # v3.24.6
5959
with:
6060
sarif_file: results.sarif

.github/workflows/set-version.yaml

+52-9
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,40 @@
11
name: Set branch version
22

33
on:
4-
repository_dispatch:
5-
types: [set-version]
4+
workflow_dispatch:
5+
inputs:
6+
branch_name:
7+
description: Release branch name to create
8+
required: true
9+
type: string
10+
package_version:
11+
description: Release package version
12+
required: true
13+
type: string
14+
core_major_minor:
15+
description: Release core major.minor version
16+
required: true
17+
type: string
18+
19+
# Inputs provided by the bot
20+
distinct_id:
21+
description: '(bot) A distinct ID'
22+
required: false
23+
default: ''
24+
source_issue:
25+
description: '(bot) The issue that triggered this workflow'
26+
required: false
27+
default: ''
28+
requesting_user:
29+
description: '(bot) The user who requested this workflow'
30+
required: false
31+
default: ''
32+
status_comment:
33+
description: '(bot) The comment to update with the status of this workflow'
34+
required: false
35+
default: ''
36+
37+
run-name: ${{ github.workflow }}${{ inputs.distinct_id && format(' (bot run {0})', inputs.distinct_id) || '' }}
638

739
permissions:
840
contents: read
@@ -19,7 +51,7 @@ jobs:
1951
steps:
2052
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
2153
with:
22-
ref: ${{ github.event.client_payload.branch_name }}
54+
ref: ${{ inputs.branch_name }}
2355
token: ${{ secrets.TS_BOT_GITHUB_TOKEN }}
2456
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
2557
- run: |
@@ -35,11 +67,11 @@ jobs:
3567
# package_version - the full version string (eg, `3.9.1-rc` or `3.9.2`)
3668
# core_major_minor - the major.minor pair associated with the desired package_version (eg, `3.9` for `3.9.3`)
3769
- run: |
38-
sed -i -e 's/"version": ".*"/"version": "${{ github.event.client_payload.package_version }}"/g' package.json
39-
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ github.event.client_payload.core_major_minor }}"/g' src/compiler/corePublic.ts
40-
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ github.event.client_payload.core_major_minor }}"/g' tests/baselines/reference/api/typescript.d.ts
41-
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ github.event.client_payload.core_major_minor }}"/g' tests/baselines/reference/api/tsserverlibrary.d.ts
42-
sed -i -e 's/const version\(: string\)\{0,1\} = .*;/const version = "${{ github.event.client_payload.package_version }}" as string;/g' src/compiler/corePublic.ts
70+
sed -i -e 's/"version": ".*"/"version": "${{ inputs.package_version }}"/g' package.json
71+
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ inputs.core_major_minor }}"/g' src/compiler/corePublic.ts
72+
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ inputs.core_major_minor }}"/g' tests/baselines/reference/api/typescript.d.ts
73+
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ inputs.core_major_minor }}"/g' tests/baselines/reference/api/tsserverlibrary.d.ts
74+
sed -i -e 's/const version\(: string\)\{0,1\} = .*;/const version = "${{ inputs.package_version }}" as string;/g' src/compiler/corePublic.ts
4375
npm ci
4476
npm install # update package-lock.json to ensure the version bump is included
4577
npx hereby LKG
@@ -52,5 +84,16 @@ jobs:
5284
git add --force ./lib
5385
git config user.email "typescriptbot@microsoft.com"
5486
git config user.name "TypeScript Bot"
55-
git commit -m 'Bump version to ${{ github.event.client_payload.package_version }} and LKG'
87+
git commit -m 'Bump version to ${{ inputs.package_version }} and LKG'
5688
git push
89+
90+
- uses: microsoft/typescript-bot-test-triggerer/.github/actions/post-workflow-result@master
91+
if: ${{ !cancelled() && inputs.distinct_id }}
92+
with:
93+
success_comment: "I've set the version of ${{ inputs.branch_name }} to ${{ inputs.package_version }} for you."
94+
failure_comment: 'I was unable set the version.'
95+
github_token: ${{ secrets.TS_BOT_GITHUB_TOKEN }}
96+
distinct_id: ${{ inputs.distinct_id }}
97+
source_issue: ${{ inputs.source_issue }}
98+
requesting_user: ${{ inputs.requesting_user }}
99+
status_comment: ${{ inputs.status_comment }}

0 commit comments

Comments
 (0)