Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into merge-main
Browse files Browse the repository at this point in the history
* upstream/main: (559 commits)
  Remove a few unused error codes (dotnet#54663)
  Use specific error message for wrong arity in async builder (dotnet#54632)
  Update azure-pipelines-richnav.yml (dotnet#54662)
  Capture file content on open instead of save (dotnet#54643)
  Add docs
  Further FAR simplifications
  Handle enhanced #line directive in DirectiveTriviaSyntax.DirectiveNameToken (dotnet#54636)
  move server name outside of loop
  Fix functionid
  Reduce telemetry output from find document in workspace
  Ensure we don't try and build an empty table when modifying entries with no values (dotnet#54639)
  Feedback
  Ensure we don't try and build an empty table when modifying entries with no values (dotnet#54639)
  No need to specialized logic for determining set of projects to search
  Defer group computation till reporting time
  Handle FAR for global suppressions in a consistent fashion
  Update status for enhanced `#line` directive (dotnet#54581)
  Split IOperationTests into one part per type
  [LSP] Revert semantic tokens change in main (dotnet#54570)
  Add exceptionutilities unreachable to catch blocks that should not be hit
  ...
  • Loading branch information
333fred committed Jul 8, 2021
2 parents 93b9822 + e59dbb8 commit 2b1004b
Show file tree
Hide file tree
Showing 1,194 changed files with 80,255 additions and 11,804 deletions.
27 changes: 27 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion

# Whitespace options
dotnet_style_allow_multiple_blank_lines_experimental = false

# Non-private static fields are PascalCase
dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.symbols = non_private_static_fields
Expand Down Expand Up @@ -182,6 +185,11 @@ csharp_indent_case_contents_when_block = true
csharp_indent_switch_labels = true
csharp_indent_labels = flush_left

# Whitespace options
csharp_style_allow_embedded_statements_on_same_line_experimental = false
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = false
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = false

# Prefer "var" everywhere
csharp_style_var_for_built_in_types = true:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion
Expand Down Expand Up @@ -233,6 +241,10 @@ csharp_prefer_braces = true:silent
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = true

# Currently only enabled for C# due to crash in VB analyzer. VB can be enabled once
# https://github.com/dotnet/roslyn/pull/54259 has been published.
dotnet_style_allow_statement_immediately_after_block_experimental = false

[src/CodeStyle/**.{cs,vb}]
# warning RS0005: Do not use generic CodeAction.Create to create CodeAction
dotnet_diagnostic.RS0005.severity = none
Expand Down Expand Up @@ -272,6 +284,21 @@ csharp_style_var_for_built_in_types = true:warning
csharp_style_var_when_type_is_apparent = true:warning
csharp_style_var_elsewhere = true:warning

# dotnet_style_allow_multiple_blank_lines_experimental
dotnet_diagnostic.IDE2000.severity = warning

# csharp_style_allow_embedded_statements_on_same_line_experimental
dotnet_diagnostic.IDE2001.severity = warning

# csharp_style_allow_blank_lines_between_consecutive_braces_experimental
dotnet_diagnostic.IDE2002.severity = warning

# dotnet_style_allow_statement_immediately_after_block_experimental
dotnet_diagnostic.IDE2003.severity = warning

# csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental
dotnet_diagnostic.IDE2004.severity = warning

[src/{VisualStudio}/**/*.{cs,vb}]
# CA1822: Make member static
# Not enforced as a build 'warning' for 'VisualStudio' layer due to large number of false positives from https://github.com/dotnet/roslyn-analyzers/issues/3857 and https://github.com/dotnet/roslyn-analyzers/issues/3858
Expand Down
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Dotnet-format -w Roslyn.sln
abce41d282ac631be5217140f1bd46d0e250ad02
245 changes: 134 additions & 111 deletions azure-pipelines-official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,25 @@ resources:
- repo: self
clean: true

# Variables defined in yml cannot be overridden at queue time instead overrideable variables must be defined in the web gui.
# Commenting out until AzDO supports something like the runtime parameters outlined here: https://github.com/Microsoft/azure-pipelines-yaml/pull/129
#variables:
# SignType: real
# SkipTests: false
# SkipApplyOptimizationData: false
# IbcDrop: 'default'
# PRNumber: 'default'
parameters:
- name: IbcDrop
type: string
default: default

- name: SignType
default: real
type: string
values:
- real
- test

- name: SkipApplyOptimizationData
type: boolean
default: false

- name: SkipTests
type: boolean
default: true

# The variables `_DotNetArtifactsCategory` and `_DotNetValidationArtifactsCategory` are required for proper publishing of build artifacts. See https://github.com/dotnet/roslyn/pull/38259
variables:
Expand All @@ -20,46 +31,36 @@ variables:
- group: DotNet-Roslyn-SDLValidation-Params

# To retrieve OptProf data we need to authenticate to the VS drop storage.
# If the pipeline is running in DevDiv, the account has access to the VS drop storage.
# Get $AccessToken-dotnet-build-bot-public-repo from DotNet-GitHub-Versions-Repo-Write
- ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}:
- group: DotNet-GitHub-Versions-Repo-Write
- name: _DevDivDropAccessToken
value: $(System.AccessToken)
# If the pipeline is running in dnceng:
# Get access token with $dn-bot-devdiv-drop-rw-code-rw and dn-bot-dnceng-build-rw-code-rw from DotNet-VSTS-Infra-Access
# Get $dotnetfeed-storage-access-key-1 from DotNet-Blob-Feed
# Get $microsoft-symbol-server-pat and $symweb-symbol-server-pat from DotNet-Symbol-Server-Pats
# Get $AccessToken-dotnet-build-bot-public-repo from DotNet-Versions-Publish
- ${{ if eq(variables['System.TeamProject'], 'internal') }}:
- group: DotNet-Blob-Feed
- group: DotNet-Symbol-Server-Pats
- group: DotNet-Versions-Publish
- group: DotNet-VSTS-Infra-Access
- group: DotNet-DevDiv-Insertion-Workflow-Variables
- name: _DevDivDropAccessToken
value: $(dn-bot-devdiv-drop-rw-code-rw)
- group: DotNet-Blob-Feed
- group: DotNet-Symbol-Server-Pats
- group: DotNet-Versions-Publish
- group: DotNet-VSTS-Infra-Access
- group: DotNet-DevDiv-Insertion-Workflow-Variables
- name: _DevDivDropAccessToken
value: $(dn-bot-devdiv-drop-rw-code-rw)
- group: ManagedLanguageSecrets

- name: BuildConfiguration
value: release
- name: Roslyn.GitHubEmail
value: dotnet-build-bot@microsoft.com
- name: Roslyn.GitHubToken
value: $(AccessToken-dotnet-build-bot-public-repo)
- name: Roslyn.GitHubUserName
value: dotnet-build-bot

- name: Insertion.InsertToolset
value: true
- name: Insertion.CreateDraftPR
value: true
- name: Insertion.TitlePrefix
value: '[Auto Insertion]'

stages:
- stage: setup
displayName: Build Setup

jobs:
- job: SetBuildNumber
pool:
vmImage: vs2017-win2016
steps:
# Make sure our two pipelines generate builds with distinct build numbers to avoid confliction.
# i.e. DevDiv builds will have even rev# whereas dnceng builds will be odd.
- task: PowerShell@2
displayName: Update BuildNumber
inputs:
filePath: 'eng\update-build-number.ps1'
${{ if eq(variables['System.TeamProject'], 'DevDiv') }}:
arguments: '-buildNumber $(Build.BuildNumber) -oddOrEven even'
${{ if eq(variables['System.TeamProject'], 'internal') }}:
arguments: '-buildNumber $(Build.BuildNumber) -oddOrEven odd'
condition: eq(variables['System.JobAttempt'], '1')

- stage: build
displayName: Build and Test
Expand All @@ -76,17 +77,9 @@ stages:
- job: OfficialBuild
displayName: Official Build
timeoutInMinutes: 360
# Conditionally set build pool so we can share this YAML when building with different pipeline (devdiv vs dnceng)
pool:
${{ if eq(variables['System.TeamProject'], 'DevDiv') }}:
name: VSEngSS-MicroBuild2017
demands:
- msbuild
- visualstudio
- DotNetFramework
${{ if eq(variables['System.TeamProject'], 'internal') }}:
name: NetCoreInternal-Pool
queue: BuildPool.Server.Amd64.VS2017
name: NetCoreInternal-Pool
queue: BuildPool.Server.Amd64.VS2017

steps:
- powershell: Write-Host "##vso[task.setvariable variable=SourceBranchName]$('$(Build.SourceBranch)'.Substring('refs/heads/'.Length))"
Expand All @@ -98,23 +91,7 @@ stages:
inputs:
type: 'Build'
tags: 'OfficialBuild'
condition: and(succeeded(), endsWith(variables['SourceBranchName'], '-vs-deps'), eq(variables['PRNumber'], 'default'))

- task: tagBuildOrRelease@0
displayName: Tag PR validation build
inputs:
type: 'Build'
tags: |
PRValidationBuild
PRNumber:$(PRNumber)
condition: and(succeeded(), ne(variables['PRNumber'], 'default'))

- task: PowerShell@2
displayName: Setup branch for insertion validation
inputs:
filePath: 'eng\setup-pr-validation.ps1'
arguments: '-sourceBranchName $(SourceBranchName) -prNumber $(PRNumber)'
condition: and(succeeded(), ne(variables['PRNumber'], 'default'))
condition: and(succeeded(), endsWith(variables['SourceBranchName'], '-vs-deps'))

- task: tagBuildOrRelease@0
displayName: Tag main validation build
Expand All @@ -128,8 +105,7 @@ stages:
displayName: Merge main-vs-deps into source branch
inputs:
filePath: 'scripts\merge-vs-deps.ps1'
${{ if eq(variables['System.TeamProject'], 'internal') }}:
arguments: '-accessToken $(dn-bot-dnceng-build-rw-code-rw)'
arguments: '-accessToken $(dn-bot-dnceng-build-rw-code-rw)'
condition: and(succeeded(), eq(variables['SourceBranchName'], 'main'))

- powershell: Write-Host "##vso[task.setvariable variable=VisualStudio.DropName]Products/$(System.TeamProject)/$(Build.Repository.Name)/$(SourceBranchName)/$(Build.BuildNumber)"
Expand All @@ -142,20 +118,15 @@ stages:
# Authenticate with service connections to be able to publish packages to external nuget feeds.
- task: NuGetAuthenticate@0
inputs:
${{ if eq(variables['System.TeamProject'], 'DevDiv') }}:
nuGetServiceConnections: azure-public/vs-impl, azure-public/vssdk
${{ if eq(variables['System.TeamProject'], 'internal') }}:
nuGetServiceConnections: azure-public/vs-impl, azure-public/vssdk, devdiv/engineering
nuGetServiceConnections: azure-public/vs-impl, azure-public/vssdk, devdiv/engineering

# Needed because the dnceng image we build on fails the next task without it
# Needed because the build fails the NuGet Tools restore without it
- task: UseDotNet@2
displayName: 'Use .NET Core sdk'
inputs:
packageType: sdk
useGlobalJson: true
workingDirectory: '$(Build.SourcesDirectory)'
installationPath: '$(Build.SourcesDirectory)/.dotnet'
condition: eq(variables['System.TeamProject'], 'internal')

# Needed to restore the Microsoft.DevDiv.Optimization.Data.PowerShell package
- task: NuGetCommand@2
Expand All @@ -171,9 +142,7 @@ stages:
inputs:
signType: $(SignType)
zipSources: false
# If running in dnceng, we need to use a feed different from default
${{ if eq(variables['System.TeamProject'], 'internal') }}:
feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json
feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json
condition: and(succeeded(), in(variables['SignType'], 'test', 'real'))

- task: PowerShell@2
Expand Down Expand Up @@ -212,7 +181,7 @@ stages:
inputs:
filePath: 'eng\publish-assets.ps1'
arguments: '-configuration $(BuildConfiguration) -branchName "$(SourceBranchName)"'
condition: and(succeeded(), eq(variables['PRNumber'], 'default'))
condition: succeeded()

# Publish OptProf configuration files
# The env variable is required to enable cross account access using PAT (dnceng -> devdiv)
Expand Down Expand Up @@ -282,12 +251,8 @@ stages:
command: push
packagesToPush: '$(Build.SourcesDirectory)\artifacts\VSSetup\$(BuildConfiguration)\DevDivPackages\**\*.nupkg'
allowPackageConflicts: true
${{ if eq(variables['System.TeamProject'], 'DevDiv') }}:
feedsToUse: config
publishVstsFeed: '97a41293-2972-4f48-8c0e-05493ae82010'
${{ if eq(variables['System.TeamProject'], 'internal') }}:
nuGetFeedType: external
publishFeedCredentials: 'DevDiv - VS package feed'
nuGetFeedType: external
publishFeedCredentials: 'DevDiv - VS package feed'
condition: succeeded()

# Publish an artifact that the RoslynInsertionTool is able to find by its name.
Expand Down Expand Up @@ -325,25 +290,89 @@ stages:
publishUsingPipelines: true
dependsOn:
- OfficialBuild
${{ if eq(variables['System.TeamProject'], 'DevDiv') }}:
queue:
name: Hosted VS2017
${{ if eq(variables['System.TeamProject'], 'internal') }}:
pool:
vmImage: vs2017-win2016

# We need to skip post-build stages for PR validation build, but it can only be identified by
# the runtime variable 'PRNumber', thus this dummy stage. Also the dummy job is required
# otherwise AzDO would just repeat jobs from previous stage.
- stage: SetValidateDependency
displayName: Setup the dependency for post-build stages
condition: and(succeeded(), eq(variables['PRNumber'], 'default'))
pool:
vmImage: vs2017-win2016

- stage: insert
dependsOn:
- build
- publish_using_darc
displayName: Insert to VS

jobs:
- job: Log
displayName: Log
- job: insert
displayName: Insert to VS
pool:
vmImage: windows-2019
steps:
- powershell: Write-Host "Setup the dependency for post-build stages."
displayName: Log
- checkout: none

- task: NuGetCommand@2
displayName: 'Install RIT from Azure Artifacts'
inputs:
command: custom
arguments: 'install RoslynTools.VisualStudioInsertionTool -PreRelease -Source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'

- powershell: |
$response = Invoke-RestMethod -Headers @{Authorization = "Bearer $(System.AccessToken)"} "https://dev.azure.com/dnceng/internal/_apis/git/repositories/dotnet-roslyn/items?path=eng/config/PublishData.json&api-version=6.0"
$branchName = "$(Build.SourceBranch)".Substring("refs/heads/".Length)
$branchData = $response.branches.$branchName
if (!$branchData)
{
Write-Host "No PublishData found for branch '$branchName'. Using PublishData for branch 'main'."
$branchData = $response.branches.main
}
if ($null -ne $branchData.insertionCreateDraftPR)
{
Write-Host "##vso[task.setvariable variable=Insertion.CreateDraftPR]$($branchData.insertionCreateDraftPR)"
}
if ($null -ne $branchData.insertionTitlePrefix)
{
Write-Host "##vso[task.setvariable variable=Insertion.TitlePrefix]$($branchData.insertionTitlePrefix)"
}
if ($null -ne $branchData.insertToolset)
{
Write-Host "##vso[task.setvariable variable=Insertion.InsertToolset]$($branchData.insertToolset)"
}
Write-Host "##vso[task.setvariable variable=Insertion.AutoComplete]$(-not $branchData.insertionCreateDraftPR)"
Write-Host "##vso[task.setvariable variable=ComponentBranchName]$branchName"
Write-Host "##vso[task.setvariable variable=VSBranchName]$($branchData.vsBranch)"
displayName: Set Insertion Variables
- powershell: |
mv RoslynTools.VisualStudioInsertionTool.* RIT
.\RIT\tools\OneOffInsertion.ps1 `
-autoComplete "$(Insertion.AutoComplete)" `
-buildQueueName "$(Build.DefinitionName)" `
-cherryPick "(default)" `
-clientId "$(ClientId)" `
-clientSecret "$(ClientSecret)" `
-componentAzdoUri "$(System.CollectionUri)" `
-componentBranchName "$(ComponentBranchName)" `
-componentGitHubRepoName "dotnet/roslyn" `
-componentName "Roslyn" `
-componentProjectName "internal" `
-createDraftPR "$(Insertion.CreateDraftPR)" `
-defaultValueSentinel "(default)" `
-dropPath "(default)" `
-insertCore "(default)" `
-insertDevDiv "(default)" `
-insertionCount "1" `
-insertToolset "$(Insertion.InsertToolset)" `
-titlePrefix "$(Insertion.TitlePrefix)" `
-queueValidation "true" `
-requiredValueSentinel "REQUIRED" `
-reviewerGUID "6c25b447-1d90-4840-8fde-d8b22cb8733e" `
-specificBuild "$(Build.BuildNumber)" `
-updateAssemblyVersions "(default)" `
-updateCoreXTLibraries "(default)" `
-visualStudioBranchName "$(VSBranchName)" `
-writePullRequest "prid.txt" `
displayName: 'Run OneOffInsertion.ps1'
- script: 'echo. && echo. && type "prid.txt" && echo. && echo.'
displayName: 'Report PR URL'

- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- template: eng\common\templates\post-build\post-build.yml
Expand All @@ -353,12 +382,6 @@ stages:
# https://github.com/dotnet/arcade/issues/2871 is resolved.
enableSymbolValidation: false
enableSourceLinkValidation: false
# It's important that post-build stages are depends on 'SetValidateDependency' stage instead of 'build',
# since we don't want to publish validation build.
validateDependsOn:
- SetValidateDependency
dependsOn:
- SetValidateDependency
# Enable SDL validation, passing through values from the 'DotNet-Roslyn-SDLValidation-Params' group.
SDLValidationParameters:
enable: true
Expand Down
Loading

0 comments on commit 2b1004b

Please sign in to comment.