Skip to content

Commit 26ab7f5

Browse files
committed
Merge remote-tracking branch 'upstream/main' into otel
2 parents ad91f8b + ddbaafd commit 26ab7f5

File tree

108 files changed

+2360
-730
lines changed

Some content is hidden

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

108 files changed

+2360
-730
lines changed

.github/workflows/add_to_project.yml

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
name: Add all issues to F# project
1+
name: Add all issues to F# project, assign milestone and labels
22

33
on:
44
issues:
55
types:
66
- opened
77
- transferred
88

9+
permissions:
10+
issues: write
11+
repository-projects: write
12+
913
jobs:
1014
cleanup_old_runs:
1115
runs-on: ubuntu-20.04
@@ -21,11 +25,38 @@ jobs:
2125
gh api -X GET "$_UrlPath/$_CurrentWorkflowID/runs" --paginate \
2226
| jq '.workflow_runs[] | select(.status == "completed") | .id' \
2327
| xargs -I{} gh api -X DELETE "/repos/$GITHUB_REPOSITORY/actions/runs"/{}
24-
add-to-project:
28+
add_to_project:
2529
name: Add issue to project
2630
runs-on: ubuntu-latest
31+
permissions:
32+
issues: write
33+
repository-projects: write
2734
steps:
2835
- uses: actions/add-to-project@v0.3.0
2936
with:
3037
project-url: https://github.com/orgs/dotnet/projects/126/
31-
github-token: ${{ secrets.GITHUB_TOKEN }}
38+
github-token: ${{ secrets.REPO_PROJECT_PAT }}
39+
apply-label:
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/github-script@v6
43+
with:
44+
script: |
45+
github.rest.issues.addLabels({
46+
issue_number: context.issue.number,
47+
owner: context.repo.owner,
48+
repo: context.repo.repo,
49+
labels: ['Needs-Triage']
50+
})
51+
apply-milestone:
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/github-script@v6
55+
with:
56+
script: |
57+
github.rest.issues.update({
58+
issue_number: context.issue.number,
59+
owner: context.repo.owner,
60+
repo: context.repo.repo,
61+
milestone: 29
62+
})

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,4 @@ nCrunchTemp_*
125125
/test.fsx
126126

127127
tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.actual
128+
*.vsp

.vscode/launch.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
],
1212
"configurations": [
1313
{
14-
"name": "Launch FSI (Debug, .NET 6.0)",
14+
"name": "Launch FSI (Debug, .NET 7.0)",
1515
"type": "coreclr",
1616
"request": "launch",
1717
// TODO: Shall we assume that it's already been built, or build it every time we debug?
@@ -36,7 +36,7 @@
3636
},
3737
},
3838
{
39-
"name": "Launch FSC (Debug, .NET 6.0)",
39+
"name": "Launch FSC (Debug, .NET 7.0)",
4040
"type": "coreclr",
4141
"request": "launch",
4242
// TODO: Shall we assume that it's already been built, or build it every time we debug?
@@ -77,4 +77,4 @@
7777
"enableStepFiltering": false,
7878
}
7979
]
80-
}
80+
}

VisualFSharp.sln

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "fsiAnyCpu", "src\fsi\fsiAny
184184
EndProject
185185
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "fsiArm64", "src\fsi\fsiArm64Project\fsiArm64.fsproj", "{EB015235-1E07-4CDA-9CC6-3FBCC27910D1}"
186186
EndProject
187-
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "HistoricalBenchmark", "tests\benchmarks\FCSBenchmarks\BenchmarkComparison\HistoricalBenchmark.fsproj", "{583182E1-3484-4A8F-AC06-7C0D232C0CA4}"
187+
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "HistoricalBenchmark", "tests\benchmarks\FCSBenchmarks\BenchmarkComparison\HistoricalBenchmark.fsproj", "{583182E1-3484-4A8F-AC06-7C0D232C0CA4}"
188188
EndProject
189189
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "FCSBenchmarks", "FCSBenchmarks", "{39CDF34B-FB23-49AE-AB27-0975DA379BB5}"
190190
ProjectSection(SolutionItems) = preProject
@@ -193,6 +193,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "FCSBenchmarks", "FCSBenchma
193193
tests\benchmarks\FCSBenchmarks\SmokeTestAllBenchmarks.ps1 = tests\benchmarks\FCSBenchmarks\SmokeTestAllBenchmarks.ps1
194194
EndProjectSection
195195
EndProject
196+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Fsharp.ProfilingStartpointProject", "tests\benchmarks\Fsharp.ProfilingStartpointProject\Fsharp.ProfilingStartpointProject.fsproj", "{FE23BB65-276A-4E41-8CC7-F7752241DEBA}"
197+
EndProject
196198
Global
197199
GlobalSection(SolutionConfigurationPlatforms) = preSolution
198200
Debug|Any CPU = Debug|Any CPU
@@ -1019,6 +1021,18 @@ Global
10191021
{583182E1-3484-4A8F-AC06-7C0D232C0CA4}.Release|Any CPU.Build.0 = Release|Any CPU
10201022
{583182E1-3484-4A8F-AC06-7C0D232C0CA4}.Release|x86.ActiveCfg = Release|Any CPU
10211023
{583182E1-3484-4A8F-AC06-7C0D232C0CA4}.Release|x86.Build.0 = Release|Any CPU
1024+
{FE23BB65-276A-4E41-8CC7-F7752241DEBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1025+
{FE23BB65-276A-4E41-8CC7-F7752241DEBA}.Debug|Any CPU.Build.0 = Debug|Any CPU
1026+
{FE23BB65-276A-4E41-8CC7-F7752241DEBA}.Debug|x86.ActiveCfg = Debug|Any CPU
1027+
{FE23BB65-276A-4E41-8CC7-F7752241DEBA}.Debug|x86.Build.0 = Debug|Any CPU
1028+
{FE23BB65-276A-4E41-8CC7-F7752241DEBA}.Proto|Any CPU.ActiveCfg = Debug|Any CPU
1029+
{FE23BB65-276A-4E41-8CC7-F7752241DEBA}.Proto|Any CPU.Build.0 = Debug|Any CPU
1030+
{FE23BB65-276A-4E41-8CC7-F7752241DEBA}.Proto|x86.ActiveCfg = Debug|Any CPU
1031+
{FE23BB65-276A-4E41-8CC7-F7752241DEBA}.Proto|x86.Build.0 = Debug|Any CPU
1032+
{FE23BB65-276A-4E41-8CC7-F7752241DEBA}.Release|Any CPU.ActiveCfg = Release|Any CPU
1033+
{FE23BB65-276A-4E41-8CC7-F7752241DEBA}.Release|Any CPU.Build.0 = Release|Any CPU
1034+
{FE23BB65-276A-4E41-8CC7-F7752241DEBA}.Release|x86.ActiveCfg = Release|Any CPU
1035+
{FE23BB65-276A-4E41-8CC7-F7752241DEBA}.Release|x86.Build.0 = Release|Any CPU
10221036
EndGlobalSection
10231037
GlobalSection(SolutionProperties) = preSolution
10241038
HideSolutionNode = FALSE
@@ -1089,16 +1103,17 @@ Global
10891103
{B5A9BBD9-2F45-4722-A6CA-BAE3C64CD4E2} = {3881429D-A97A-49EB-B7AE-A82BA5FE9C77}
10901104
{14F3D3D6-5C8E-43C2-98A2-17EA704D4DEA} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}
10911105
{A422D673-8E3B-4924-821B-DD3174173426} = {4C7B48D7-19AF-4AE7-9D1D-3BB289D5480D}
1106+
{564E7DC5-11CB-4FCF-ABDD-23AD93AF3A61} = {39CDF34B-FB23-49AE-AB27-0975DA379BB5}
10921107
{B1E30F2C-894F-47A9-9C8A-3324831E7D26} = {4C7B48D7-19AF-4AE7-9D1D-3BB289D5480D}
10931108
{597D9896-4B90-4E9E-9C99-445C2CB9FF60} = {B8DDA694-7939-42E3-95E5-265C2217C142}
10941109
{0973C362-585C-4838-9459-D7E45C6B784B} = {B8DDA694-7939-42E3-95E5-265C2217C142}
10951110
{E54456F4-D51A-4334-B225-92EBBED92B40} = {B8DDA694-7939-42E3-95E5-265C2217C142}
10961111
{511C95D9-3BA6-451F-B6F8-F033F40878A5} = {B8DDA694-7939-42E3-95E5-265C2217C142}
10971112
{37EB3E54-ABC6-4CF5-8273-7CE4B61A42C1} = {B8DDA694-7939-42E3-95E5-265C2217C142}
10981113
{EB015235-1E07-4CDA-9CC6-3FBCC27910D1} = {B8DDA694-7939-42E3-95E5-265C2217C142}
1099-
{39CDF34B-FB23-49AE-AB27-0975DA379BB5} = {DFB6ADD7-3149-43D9-AFA0-FC4A818B472B}
1100-
{564E7DC5-11CB-4FCF-ABDD-23AD93AF3A61} = {39CDF34B-FB23-49AE-AB27-0975DA379BB5}
11011114
{583182E1-3484-4A8F-AC06-7C0D232C0CA4} = {39CDF34B-FB23-49AE-AB27-0975DA379BB5}
1115+
{39CDF34B-FB23-49AE-AB27-0975DA379BB5} = {DFB6ADD7-3149-43D9-AFA0-FC4A818B472B}
1116+
{FE23BB65-276A-4E41-8CC7-F7752241DEBA} = {39CDF34B-FB23-49AE-AB27-0975DA379BB5}
11021117
EndGlobalSection
11031118
GlobalSection(ExtensibilityGlobals) = postSolution
11041119
SolutionGuid = {48EDBBBE-C8EE-4E3C-8B19-97184A487B37}

buildtools/AssemblyCheck/SkipVerifyEmbeddedPdb.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
FSharp.Build.UnitTests.dll
22
FSharp.Compiler.Benchmarks.dll
3+
Fsharp.ProfilingStartpointProject.dll
34
FSharp.Compiler.ComponentTests.dll
45
FSharp.Test.Utilities.dll
56
FSharp.Compiler.Private.Scripting.UnitTests.dll

eng/Build.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,10 @@ try {
497497
}
498498

499499
if ($pack) {
500+
$properties_storage = $properties
501+
$properties += "/p:GenerateSbom=false"
500502
BuildSolution "Microsoft.FSharp.Compiler.sln"
503+
$properties = $properties_storage
501504
}
502505
if ($build) {
503506
VerifyAssemblyVersionsAndSymbols

eng/Version.Details.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
</Dependency>
99
</ProductDependencies>
1010
<ToolsetDependencies>
11-
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="8.0.0-beta.22512.1">
11+
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="8.0.0-beta.22513.2">
1212
<Uri>https://github.com/dotnet/arcade</Uri>
13-
<Sha>508fe921a748de6efc8b5d979e17beb88ccf5bcf</Sha>
13+
<Sha>32f13f8a8af8085ca09fbf93513ac848582c4a41</Sha>
1414
<SourceBuild RepoName="arcade" ManagedOnly="true" />
1515
</Dependency>
16-
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="8.0.0-beta.22512.1">
16+
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="8.0.0-beta.22513.2">
1717
<Uri>https://github.com/dotnet/arcade</Uri>
18-
<Sha>508fe921a748de6efc8b5d979e17beb88ccf5bcf</Sha>
18+
<Sha>32f13f8a8af8085ca09fbf93513ac848582c4a41</Sha>
1919
</Dependency>
2020
</ToolsetDependencies>
2121
</Dependencies>

eng/actions/backport/action.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: 'PR Backporter'
2+
description: 'Backports a pull request to a branch using the "/backport to <branch>" comment'
3+
inputs:
4+
target_branch:
5+
description: 'Backport target branch.'
6+
auth_token:
7+
description: 'The token used to authenticate to GitHub.'
8+
pr_title_template:
9+
description: 'The template used for the PR title. Special placeholder tokens that will be replaced with a value: %target_branch%, %source_pr_title%, %source_pr_number%, %cc_users%.'
10+
default: '[%target_branch%] %source_pr_title%'
11+
pr_description_template:
12+
description: 'The template used for the PR description. Special placeholder tokens that will be replaced with a value: %target_branch%, %source_pr_title%, %source_pr_number%, %cc_users%.'
13+
default: |
14+
Backport of #%source_pr_number% to %target_branch%
15+
16+
/cc %cc_users%
17+
18+
runs:
19+
using: 'node12'
20+
main: 'index.js'

eng/actions/backport/index.js

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
function BackportException(message, postToGitHub = true) {
5+
this.message = message;
6+
this.postToGitHub = postToGitHub;
7+
}
8+
9+
async function run() {
10+
const util = require("util");
11+
const jsExec = util.promisify(require("child_process").exec);
12+
13+
console.log("Installing npm dependencies");
14+
const { stdout, stderr } = await jsExec("npm install @actions/core @actions/github @actions/exec");
15+
console.log("npm-install stderr:\n\n" + stderr);
16+
console.log("npm-install stdout:\n\n" + stdout);
17+
console.log("Finished installing npm dependencies");
18+
19+
const core = require("@actions/core");
20+
const github = require("@actions/github");
21+
const exec = require("@actions/exec");
22+
23+
const repo_owner = github.context.payload.repository.owner.login;
24+
const repo_name = github.context.payload.repository.name;
25+
const pr_number = github.context.payload.issue.number;
26+
const comment_user = github.context.payload.comment.user.login;
27+
28+
let octokit = github.getOctokit(core.getInput("auth_token", { required: true }));
29+
let target_branch = core.getInput("target_branch", { required: true });
30+
31+
try {
32+
// verify the comment user is a repo collaborator
33+
try {
34+
await octokit.rest.repos.checkCollaborator({
35+
owner: repo_owner,
36+
repo: repo_name,
37+
username: comment_user
38+
});
39+
console.log(`Verified ${comment_user} is a repo collaborator.`);
40+
} catch (error) {
41+
console.log(error);
42+
throw new BackportException(`Error: @${comment_user} is not a repo collaborator, backporting is not allowed. If you're a collaborator please make sure your ${repo_owner} team membership visibility is set to Public on https://github.com/orgs/${repo_owner}/people?query=${comment_user}`);
43+
}
44+
45+
try { await exec.exec(`git ls-remote --exit-code --heads origin ${target_branch}`) } catch { throw new BackportException(`Error: The specified backport target branch ${target_branch} wasn't found in the repo.`); }
46+
console.log(`Backport target branch: ${target_branch}`);
47+
48+
console.log("Applying backport patch");
49+
50+
await exec.exec(`git checkout ${target_branch}`);
51+
await exec.exec(`git clean -xdff`);
52+
53+
// configure git
54+
await exec.exec(`git config user.name "github-actions"`);
55+
await exec.exec(`git config user.email "github-actions@github.com"`);
56+
57+
// create temporary backport branch
58+
const temp_branch = `backport/pr-${pr_number}-to-${target_branch}`;
59+
await exec.exec(`git checkout -b ${temp_branch}`);
60+
61+
// skip opening PR if the branch already exists on the origin remote since that means it was opened
62+
// by an earlier backport and force pushing to the branch updates the existing PR
63+
let should_open_pull_request = true;
64+
try {
65+
await exec.exec(`git ls-remote --exit-code --heads origin ${temp_branch}`);
66+
should_open_pull_request = false;
67+
} catch { }
68+
69+
// download and apply patch
70+
await exec.exec(`curl -sSL "${github.context.payload.issue.pull_request.patch_url}" --output changes.patch`);
71+
72+
const git_am_command = "git am --3way --ignore-whitespace --keep-non-patch changes.patch";
73+
let git_am_output = `$ ${git_am_command}\n\n`;
74+
let git_am_failed = false;
75+
try {
76+
await exec.exec(git_am_command, [], {
77+
listeners: {
78+
stdout: function stdout(data) { git_am_output += data; },
79+
stderr: function stderr(data) { git_am_output += data; }
80+
}
81+
});
82+
} catch (error) {
83+
git_am_output += error;
84+
git_am_failed = true;
85+
}
86+
87+
if (git_am_failed) {
88+
const git_am_failed_body = `@${github.context.payload.comment.user.login} backporting to ${target_branch} failed, the patch most likely resulted in conflicts:\n\n\`\`\`shell\n${git_am_output}\n\`\`\`\n\nPlease backport manually!`;
89+
await octokit.rest.issues.createComment({
90+
owner: repo_owner,
91+
repo: repo_name,
92+
issue_number: pr_number,
93+
body: git_am_failed_body
94+
});
95+
throw new BackportException("Error: git am failed, most likely due to a merge conflict.", false);
96+
}
97+
else {
98+
// push the temp branch to the repository
99+
await exec.exec(`git push --force --set-upstream origin HEAD:${temp_branch}`);
100+
}
101+
102+
if (!should_open_pull_request) {
103+
console.log("Backport temp branch already exists, skipping opening a PR.");
104+
return;
105+
}
106+
107+
// prepate the GitHub PR details
108+
let backport_pr_title = core.getInput("pr_title_template");
109+
let backport_pr_description = core.getInput("pr_description_template");
110+
111+
// get users to cc (append PR author if different from user who issued the backport command)
112+
let cc_users = `@${comment_user}`;
113+
if (comment_user != github.context.payload.issue.user.login) cc_users += ` @${github.context.payload.issue.user.login}`;
114+
115+
// replace the special placeholder tokens with values
116+
backport_pr_title = backport_pr_title
117+
.replace(/%target_branch%/g, target_branch)
118+
.replace(/%source_pr_title%/g, github.context.payload.issue.title)
119+
.replace(/%source_pr_number%/g, github.context.payload.issue.number)
120+
.replace(/%cc_users%/g, cc_users);
121+
122+
backport_pr_description = backport_pr_description
123+
.replace(/%target_branch%/g, target_branch)
124+
.replace(/%source_pr_title%/g, github.context.payload.issue.title)
125+
.replace(/%source_pr_number%/g, github.context.payload.issue.number)
126+
.replace(/%cc_users%/g, cc_users);
127+
128+
// open the GitHub PR
129+
await octokit.rest.pulls.create({
130+
owner: repo_owner,
131+
repo: repo_name,
132+
title: backport_pr_title,
133+
body: backport_pr_description,
134+
head: temp_branch,
135+
base: target_branch
136+
});
137+
138+
console.log("Successfully opened the GitHub PR.");
139+
} catch (error) {
140+
141+
core.setFailed(error);
142+
143+
if (error.postToGitHub === undefined || error.postToGitHub == true) {
144+
// post failure to GitHub comment
145+
const unknown_error_body = `@${comment_user} an error occurred while backporting to ${target_branch}, please check the run log for details!\n\n${error.message}`;
146+
await octokit.rest.issues.createComment({
147+
owner: repo_owner,
148+
repo: repo_name,
149+
issue_number: pr_number,
150+
body: unknown_error_body
151+
});
152+
}
153+
}
154+
}
155+
156+
run();

global.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"perl": "5.32.1.1"
1919
},
2020
"msbuild-sdks": {
21-
"Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.22512.1",
22-
"Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.22512.1"
21+
"Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.22513.2",
22+
"Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.22513.2"
2323
}
2424
}

0 commit comments

Comments
 (0)