Skip to content

Commit 2dd3bfb

Browse files
authored
Merge branch 'main' into ber.a/defaultSeverity
2 parents 1ba0ab1 + da3cf8b commit 2dd3bfb

File tree

12 files changed

+83
-41
lines changed

12 files changed

+83
-41
lines changed

.github/workflows/commands.yml

Lines changed: 48 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,45 @@ on:
55
types: [created]
66

77
jobs:
8+
authorize_commenter:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
pull-requests: read
13+
outputs:
14+
allowed: ${{ steps.check.outputs.allowed }}
15+
steps:
16+
- name: Check commenter write access
17+
id: check
18+
uses: actions/github-script@v7
19+
with:
20+
github-token: ${{ secrets.GITHUB_TOKEN }}
21+
script: |
22+
const actor = context.payload.comment.user.login;
23+
const repo_owner = context.payload.repository.owner.login;
24+
const repo_name = context.payload.repository.name;
25+
try {
26+
const { data: permission } = await github.rest.repos.getCollaboratorPermissionLevel({
27+
owner: repo_owner,
28+
repo: repo_name,
29+
username: actor
30+
});
31+
const allowed = ['admin', 'write'].includes(permission.permission);
32+
core.setOutput('allowed', allowed ? 'true' : 'false');
33+
} catch (e) {
34+
core.setOutput('allowed', 'false');
35+
}
36+
837
parsing_job:
38+
needs: authorize_commenter
939
runs-on: ubuntu-latest
1040
permissions:
1141
issues: write # Allow adding a reaction via the comment-pipeline
1242
pull-requests: write
1343
outputs:
1444
command: ${{ steps.parse.outputs.command }}
1545
arg: ${{ steps.parse.outputs.arguments }}
16-
if: github.event.issue.pull_request
46+
if: needs.authorize_commenter.outputs.allowed == 'true' && github.event.issue.pull_request
1747
steps:
1848
- name: Parse comment
1949
id: parse
@@ -27,13 +57,13 @@ jobs:
2757
/run test-baseline
2858
github-token: ${{ secrets.GITHUB_TOKEN }}
2959

30-
# This second job by definiton runs user-supplied code - you must NOT elevate its permissions to `write`
31-
# Malicious code could change nuget source URL, build targets or even compiler itself to pass a GH token
32-
# And use it to create branches, spam issues etc. Any write-actions happen in the second job, which does not allow
33-
# user extension points (i.e. plain scripts, must NOT run scripts from within checked-out code)
60+
# This second job by definition runs user-supplied code - you must NOT elevate its permissions to `write`
3461
run-parsed-command:
3562
needs: parsing_job
3663
runs-on: ubuntu-latest
64+
permissions:
65+
contents: read
66+
pull-requests: read
3767
if: needs.parsing_job.outputs.command != ''
3868
steps:
3969

@@ -130,6 +160,19 @@ jobs:
130160
echo "run_step_outcome=$run_step_outcome" >> $GITHUB_OUTPUT
131161
echo "hasPatch=$hasPatch" >> $GITHUB_OUTPUT
132162
163+
- name: Validate patch paths
164+
if: ${{ steps.read-meta.outputs.run_step_outcome == 'success' && steps.read-meta.outputs.hasPatch == 'true' }}
165+
run: |
166+
# Forbid any .git* paths anywhere
167+
if grep -E '^(\+\+\+|---) ' repo.patch | grep -E '(^|/)\.git(/|$)|(^|/)\.git'; then
168+
echo "Patch touches .git paths; aborting"; exit 1
169+
fi
170+
171+
# Allow only top-level src/, tests/, vsintegration/ changes
172+
if grep -E '^(\+\+\+|---) ' repo.patch | grep -Ev '^(---|\+\+\+) (a|b)/(src|tests|vsintegration)/' | grep -E '^(---|\+\+\+) '; then
173+
echo "Patch touches files outside allowed directories (src/tests/vsintegration); aborting"; exit 1
174+
fi
175+
133176
- name: Apply and push patch
134177
if: ${{ steps.read-meta.outputs.run_step_outcome == 'success' && steps.read-meta.outputs.hasPatch == 'true' }}
135178
run: |
@@ -142,7 +185,6 @@ jobs:
142185
echo "Pushing to origin $branch"
143186
git push origin HEAD:"$branch"
144187
145-
146188
- name: Count stats
147189
id: stats
148190
if: ${{ steps.read-meta.outputs.run_step_outcome == 'success' && steps.read-meta.outputs.hasPatch == 'true' }}
@@ -189,8 +231,6 @@ jobs:
189231
if: always()
190232
env:
191233
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
192-
PR_NUMBER: ${{ env.PR_NUMBER }}
193234
run: |
194-
# Use gh CLI to comment with multi-line markdown
195235
gh pr comment ${{ github.event.issue.number }} \
196236
--body-file pr_report.md

eng/Version.Details.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ This file should be imported by eng/Versions.props
2727
<MicrosoftCodeAnalysisFeaturesPackageVersion>5.0.0-2.25480.7</MicrosoftCodeAnalysisFeaturesPackageVersion>
2828
<MicrosoftVisualStudioLanguageServicesPackageVersion>5.0.0-2.25480.7</MicrosoftVisualStudioLanguageServicesPackageVersion>
2929
<!-- dotnet/arcade dependencies -->
30-
<MicrosoftDotNetArcadeSdkPackageVersion>11.0.0-beta.25603.2</MicrosoftDotNetArcadeSdkPackageVersion>
30+
<MicrosoftDotNetArcadeSdkPackageVersion>11.0.0-beta.25612.6</MicrosoftDotNetArcadeSdkPackageVersion>
3131
<!-- _git/dotnet-optimization dependencies -->
3232
<optimizationlinuxarm64MIBCRuntimePackageVersion>1.0.0-prerelease.25502.1</optimizationlinuxarm64MIBCRuntimePackageVersion>
3333
<optimizationlinuxx64MIBCRuntimePackageVersion>1.0.0-prerelease.25502.1</optimizationlinuxx64MIBCRuntimePackageVersion>

eng/Version.Details.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@
7676
</Dependency>
7777
</ProductDependencies>
7878
<ToolsetDependencies>
79-
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="11.0.0-beta.25603.2">
79+
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="11.0.0-beta.25612.6">
8080
<Uri>https://github.com/dotnet/arcade</Uri>
81-
<Sha>9851192f7f7a7ee352358cce2627160fd1f2a54e</Sha>
81+
<Sha>8adf115288fa51feaa30d063b946478054c7f7b4</Sha>
8282
</Dependency>
8383
<Dependency Name="optimization.windows_nt-x64.MIBC.Runtime" Version="1.0.0-prerelease.25502.1">
8484
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-optimization</Uri>

eng/Versions.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
<MicrosoftVisualStudioLanguageIntellisenseVersion>$(VisualStudioEditorPackagesVersion)</MicrosoftVisualStudioLanguageIntellisenseVersion>
134134
<MicrosoftVisualStudioPlatformVSEditorVersion>$(VisualStudioEditorPackagesVersion)</MicrosoftVisualStudioPlatformVSEditorVersion>
135135
<MicrosoftVisualStudioTextUIWpfVersion>$(VisualStudioEditorPackagesVersion)</MicrosoftVisualStudioTextUIWpfVersion>
136-
<NuGetSolutionRestoreManagerInteropVersion>5.6.0</NuGetSolutionRestoreManagerInteropVersion>
136+
<NuGetVisualStudioVersion>17.14.0</NuGetVisualStudioVersion>
137137
<MicrosoftVisualStudioExtensibilityTestingVersion>0.1.800-beta</MicrosoftVisualStudioExtensibilityTestingVersion>
138138
<MicrosoftVisualStudioExtensibilityTestingSourceGeneratorVersion>$(MicrosoftVisualStudioExtensibilityTestingVersion)</MicrosoftVisualStudioExtensibilityTestingSourceGeneratorVersion>
139139

eng/common/core-templates/job/source-index-stage1.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ parameters:
33
sourceIndexBuildCommand: powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -Command "eng/common/build.ps1 -restore -build -binarylog -ci"
44
preSteps: []
55
binlogPath: artifacts/log/Debug/Build.binlog
6-
condition: ''
6+
condition: eq(variables['Build.SourceBranch'], 'refs/heads/main')
77
dependsOn: ''
88
pool: ''
99
is1ESPipeline: ''
@@ -41,4 +41,4 @@ jobs:
4141

4242
- template: /eng/common/core-templates/steps/source-index-stage1-publish.yml
4343
parameters:
44-
binLogPath: ${{ parameters.binLogPath }}
44+
binLogPath: ${{ parameters.binLogPath }}

eng/common/internal-feed-operations.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function SetupCredProvider {
2626
$url = 'https://raw.githubusercontent.com/microsoft/artifacts-credprovider/master/helpers/installcredprovider.ps1'
2727

2828
Write-Host "Writing the contents of 'installcredprovider.ps1' locally..."
29-
Invoke-WebRequest $url -OutFile installcredprovider.ps1
29+
Invoke-WebRequest $url -UseBasicParsing -OutFile installcredprovider.ps1
3030

3131
Write-Host 'Installing plugin...'
3232
.\installcredprovider.ps1 -Force

eng/common/post-build/nuget-verification.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ if ($NuGetExePath) {
6565
Write-Host "Downloading nuget.exe from $nugetExeUrl..."
6666
$ProgressPreference = 'SilentlyContinue'
6767
try {
68-
Invoke-WebRequest $nugetExeUrl -OutFile $downloadedNuGetExe
68+
Invoke-WebRequest $nugetExeUrl -UseBasicParsing -OutFile $downloadedNuGetExe
6969
$ProgressPreference = 'Continue'
7070
} catch {
7171
$ProgressPreference = 'Continue'

eng/common/tools.ps1

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,6 @@ function InitializeDotNetCli([bool]$install, [bool]$createSdkLocationFile) {
157157
return $global:_DotNetInstallDir
158158
}
159159

160-
# Don't resolve runtime, shared framework, or SDK from other locations to ensure build determinism
161-
$env:DOTNET_MULTILEVEL_LOOKUP=0
162-
163160
# Disable first run since we do not need all ASP.NET packages restored.
164161
$env:DOTNET_NOLOGO=1
165162

@@ -225,7 +222,6 @@ function InitializeDotNetCli([bool]$install, [bool]$createSdkLocationFile) {
225222
# Make Sure that our bootstrapped dotnet cli is available in future steps of the Azure Pipelines build
226223
Write-PipelinePrependPath -Path $dotnetRoot
227224

228-
Write-PipelineSetVariable -Name 'DOTNET_MULTILEVEL_LOOKUP' -Value '0'
229225
Write-PipelineSetVariable -Name 'DOTNET_NOLOGO' -Value '1'
230226

231227
return $global:_DotNetInstallDir = $dotnetRoot
@@ -277,7 +273,7 @@ function GetDotNetInstallScript([string] $dotnetRoot) {
277273

278274
Retry({
279275
Write-Host "GET $uri"
280-
Invoke-WebRequest $uri -OutFile $installScript
276+
Invoke-WebRequest $uri -UseBasicParsing -OutFile $installScript
281277
})
282278
}
283279

@@ -510,7 +506,7 @@ function InitializeXCopyMSBuild([string]$packageVersion, [bool]$install) {
510506
Write-Host "Downloading $packageName $packageVersion"
511507
$ProgressPreference = 'SilentlyContinue' # Don't display the console progress UI - it's a huge perf hit
512508
Retry({
513-
Invoke-WebRequest "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/flat2/$packageName/$packageVersion/$packageName.$packageVersion.nupkg" -OutFile $packagePath
509+
Invoke-WebRequest "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/flat2/$packageName/$packageVersion/$packageName.$packageVersion.nupkg" -UseBasicParsing -OutFile $packagePath
514510
})
515511

516512
if (!(Test-Path $packagePath)) {
@@ -556,23 +552,30 @@ function LocateVisualStudio([object]$vsRequirements = $null){
556552
Write-Host "Downloading vswhere $vswhereVersion"
557553
$ProgressPreference = 'SilentlyContinue' # Don't display the console progress UI - it's a huge perf hit
558554
Retry({
559-
Invoke-WebRequest "https://netcorenativeassets.blob.core.windows.net/resource-packages/external/windows/vswhere/$vswhereVersion/vswhere.exe" -OutFile $vswhereExe
555+
Invoke-WebRequest "https://netcorenativeassets.blob.core.windows.net/resource-packages/external/windows/vswhere/$vswhereVersion/vswhere.exe" -UseBasicParsing -OutFile $vswhereExe
560556
})
561557
}
562558

563-
if (!$vsRequirements) { $vsRequirements = $GlobalJson.tools.vs }
559+
if (!$vsRequirements) {
560+
if (Get-Member -InputObject $GlobalJson.tools -Name 'vs' -ErrorAction SilentlyContinue) {
561+
$vsRequirements = $GlobalJson.tools.vs
562+
} else {
563+
$vsRequirements = $null
564+
}
565+
}
566+
564567
$args = @('-latest', '-format', 'json', '-requires', 'Microsoft.Component.MSBuild', '-products', '*')
565568

566569
if (!$excludePrereleaseVS) {
567570
$args += '-prerelease'
568571
}
569572

570-
if (Get-Member -InputObject $vsRequirements -Name 'version') {
573+
if ($vsRequirements -and (Get-Member -InputObject $vsRequirements -Name 'version' -ErrorAction SilentlyContinue)) {
571574
$args += '-version'
572575
$args += $vsRequirements.version
573576
}
574577

575-
if (Get-Member -InputObject $vsRequirements -Name 'components') {
578+
if ($vsRequirements -and (Get-Member -InputObject $vsRequirements -Name 'components' -ErrorAction SilentlyContinue)) {
576579
foreach ($component in $vsRequirements.components) {
577580
$args += '-requires'
578581
$args += $component

eng/common/tools.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,6 @@ function InitializeDotNetCli {
115115

116116
local install=$1
117117

118-
# Don't resolve runtime, shared framework, or SDK from other locations to ensure build determinism
119-
export DOTNET_MULTILEVEL_LOOKUP=0
120-
121118
# Disable first run since we want to control all package sources
122119
export DOTNET_NOLOGO=1
123120

@@ -166,7 +163,6 @@ function InitializeDotNetCli {
166163
# build steps from using anything other than what we've downloaded.
167164
Write-PipelinePrependPath -path "$dotnet_root"
168165

169-
Write-PipelineSetVariable -name "DOTNET_MULTILEVEL_LOOKUP" -value "0"
170166
Write-PipelineSetVariable -name "DOTNET_NOLOGO" -value "1"
171167

172168
# return value

global.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "10.0.100-rc.2.25502.107",
3+
"version": "10.0.100",
44
"allowPrerelease": true,
55
"paths": [
66
".dotnet",
@@ -9,7 +9,7 @@
99
"errorMessage": "The .NET SDK could not be found, please run ./eng/common/dotnet.sh."
1010
},
1111
"tools": {
12-
"dotnet": "10.0.100-rc.2.25502.107",
12+
"dotnet": "10.0.100",
1313
"vs": {
1414
"version": "18.0",
1515
"components": [
@@ -22,7 +22,7 @@
2222
"perl": "5.38.2.2"
2323
},
2424
"msbuild-sdks": {
25-
"Microsoft.DotNet.Arcade.Sdk": "11.0.0-beta.25603.2",
25+
"Microsoft.DotNet.Arcade.Sdk": "11.0.0-beta.25612.6",
2626
"Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.23255.2"
2727
}
2828
}

0 commit comments

Comments
 (0)