-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #846 from AArnott/libtemplateUpdate
* Detect more test assemblies * Hide the codecov publish task if it won't run Instead of showing it as a skipped task, just hide it if we won't run it because no codecov_token is provided. * Add warning about squashing a Lib.Template update * Bump Microsoft.NET.Test.Sdk from 17.2.0 to 17.3.1 (#175) Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.2.0 to 17.3.1. - [Release notes](https://github.com/microsoft/vstest/releases) - [Commits](microsoft/vstest@v17.2.0...v17.3.1) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump Nerdbank.GitVersioning from 3.5.108 to 3.5.109 (#174) Bumps [Nerdbank.GitVersioning](https://github.com/dotnet/Nerdbank.GitVersioning) from 3.5.108 to 3.5.109. - [Release notes](https://github.com/dotnet/Nerdbank.GitVersioning/releases) - [Commits](dotnet/Nerdbank.GitVersioning@v3.5.108...v3.5.109) --- updated-dependencies: - dependency-name: Nerdbank.GitVersioning dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump xunit from 2.4.1 to 2.4.2 (#173) Bumps [xunit](https://github.com/xunit/xunit) from 2.4.1 to 2.4.2. - [Release notes](https://github.com/xunit/xunit/releases) - [Commits](xunit/xunit@2.4.1...2.4.2) --- updated-dependencies: - dependency-name: xunit dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Remove en-US from URL to docs * Update doc links * Force non-shallow clones Fixes issue 176 * Switch to using dotnet-coverage Now that the merge bug has been fixed, this should provide a better report than `dotnet-reportgenerator-globaltool` because methods with `#if` blocks will now still be merged in the report instead of being listed multiple times. * Update NuGetAuthenticate task version * Update NuGetAuthenticate task version * Document that we return the installed package path * Install .NET SDK before authenticating nuget This may be important because how can NuGetAuthenticate decide to authenticate the `dotnet nuget` commands if `dotnet` isn't already there. * Split out the symbol archive and package push stages into a shareable yml file * Add validation pipeline (targeted as a PR policy) * Update docs in validation PRs * Add reasonable default person as a reviewer on insertion PRs * Add source code archival pipeline * Touch up on icons in pipeline * Make `notes` parameter optional This works around lack of support by using a blank space as a default value. See https://developercommunity.visualstudio.com/idea/975396/optional-runtime-parameter.html * Update macOS agent to OS12 * Add more analyzers * Switch to one nuget.config feed * Add commented nuget source for non-OSS repos * Use VS-Platform as the internal consumption feed * Fix key to match the packageSource no matter which is kept * Authenticate to azure-public/msft_consumption to allow ingestion of packages in official builds * Revert "Authenticate to azure-public/msft_consumption to allow ingestion of packages in official builds" This led to the error in AzP: > ##[error]Error: The service connection for 'https://pkgs.dev.azure.com/azure-public/vside/_packaging/msft_consumption/nuget/v3/index.json' is not valid. ApiKey service connections are not supported in this task. Instead, use -ApiKey (NuGet) or --api-key (dotnet) when invoking the tool itself. See the task documentation for more details. This reverts commit 1066a18. * Authenticate to azure-public/msft_consumption to allow ingestion of packages in official builds This reverts commit f056977. * Fix new doc warnings Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Loading branch information
Showing
50 changed files
with
709 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.5 BLOCK --> | ||
|
||
## Security | ||
|
||
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). | ||
|
||
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below. | ||
|
||
## Reporting Security Issues | ||
|
||
**Please do not report security vulnerabilities through public GitHub issues.** | ||
|
||
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report). | ||
|
||
If you prefer to submit without logging in, send email to [[email protected]](mailto:[email protected]). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/msrc/pgp-key-msrc). | ||
|
||
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). | ||
|
||
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: | ||
|
||
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) | ||
* Full paths of source file(s) related to the manifestation of the issue | ||
* The location of the affected source code (tag/branch/commit or direct URL) | ||
* Any special configuration required to reproduce the issue | ||
* Step-by-step instructions to reproduce the issue | ||
* Proof-of-concept or exploit code (if possible) | ||
* Impact of the issue, including how an attacker might exploit the issue | ||
|
||
This information will help us triage your report more quickly. | ||
|
||
If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs. | ||
|
||
## Preferred Languages | ||
|
||
We prefer all communications to be in English. | ||
|
||
## Policy | ||
|
||
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/msrc/cvd). | ||
|
||
<!-- END MICROSOFT SECURITY.MD BLOCK --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,220 @@ | ||
#Requires -PSEdition Core -Version 7 | ||
<# | ||
.SYNOPSIS | ||
Submits a source archival request for this repo. | ||
.PARAMETER Requester | ||
The alias for the user requesting this backup. | ||
.PARAMETER ManagerAlias | ||
The alias of the manager that owns the repo. | ||
.PARAMETER TeamAlias | ||
The alias of the team that owns the repo. | ||
.PARAMETER BusinessGroupName | ||
A human-readable title for your team or business group. | ||
.PARAMETER ProductionType | ||
.PARAMETER ReleaseType | ||
The type of release being backed up. | ||
.PARAMETER ReleaseDate | ||
The date of the release of your software. Defaults to today. | ||
.PARAMETER OwnerAlias | ||
The alias of the owner. | ||
.PARAMETER OS | ||
.PARAMETER ProductLanguage | ||
One or more languages. | ||
.PARAMETER Notes | ||
Any notes to record with the backup. | ||
.PARAMETER FileCollection | ||
One or more collections to archive. | ||
.PARAMETER ProductName | ||
The name of the product. This will default to the repository name. | ||
.PARAMETER RepoUrl | ||
The URL to the repository. This will default to the repository containing this script. | ||
.PARAMETER BackupType | ||
The kind of backup to be performed. | ||
.PARAMETER ServerPath | ||
The UNC path to the server to be backed up (if applicable). | ||
.PARAMETER SourceCodeArchivalUri | ||
The URI to POST the source code archival request to. | ||
This value will typically come automatically by a variable group associated with your pipeline. | ||
You can also look it up at https://dpsrequestforms.azurewebsites.net/#/help -> SCA Request Help -> SCA API Help -> Description | ||
#> | ||
[CmdletBinding(SupportsShouldProcess = $true, PositionalBinding = $false)] | ||
param ( | ||
[Parameter()] | ||
[string]$Requester, | ||
[Parameter(Mandatory = $true)] | ||
[string]$ManagerAlias, | ||
[Parameter(Mandatory = $true)] | ||
[string]$TeamAlias, | ||
[Parameter(Mandatory = $true)] | ||
[string]$BusinessGroupName, | ||
[Parameter()] | ||
[string]$ProductionType = 'Visual Studio', | ||
[Parameter()] | ||
[string]$ReleaseType = 'RTW', | ||
[Parameter()] | ||
[DateTime]$ReleaseDate = [DateTime]::Today, | ||
[Parameter()] | ||
[string]$OwnerAlias, | ||
[Parameter()] | ||
[ValidateSet('64-Bit Win', '32-Bit Win', 'Linux', 'Mac', '64-Bit ARM', '32-Bit ARM')] | ||
[string[]]$OS = @('64-Bit Win'), | ||
[Parameter(Mandatory = $true)] | ||
[ValidateSet('English', 'Chinese Simplified', 'Chinese Traditional', 'Czech', 'French', 'German', 'Italian', 'Japanese', 'Korean', 'Polish', 'Portuguese', 'Russian', 'Spanish', 'Turkish')] | ||
[string[]]$ProductLanguage, | ||
[Parameter()] | ||
[string]$Notes = '', | ||
[Parameter()] | ||
[ValidateSet('Binaries', 'Localization', 'Source Code')] | ||
[string[]]$FileCollection = @('Source Code'), | ||
[Parameter()] | ||
[string]$ProductName, | ||
[Parameter()] | ||
[Uri]$RepoUrl, | ||
[Parameter()] | ||
[ValidateSet('Server Path', 'Code Repo(Git URL/AzureDevOps)', 'Git', 'Azure Storage Account')] | ||
[string]$BackupType = 'Code Repo(Git URL/AzureDevOps)', | ||
[Parameter()] | ||
[string]$ServerPath = '', | ||
[Parameter()] | ||
[Uri]$SourceCodeArchivalUri = $env:SOURCECODEARCHIVALURI | ||
) | ||
|
||
function Invoke-Git() { | ||
# Make sure we invoke git from within the repo. | ||
Push-Location $PSScriptRoot | ||
try { | ||
return (git $args) | ||
} | ||
finally { | ||
Pop-Location | ||
} | ||
} | ||
|
||
if (!$ProductName) { | ||
if ($env:BUILD_REPOSITORY_NAME) { | ||
Write-Verbose 'Using $env:BUILD_REPOSITORY_NAME for ProductName.' # single quotes are intentional so user sees the name of env var. | ||
$ProductName = $env:BUILD_REPOSITORY_NAME | ||
} | ||
else { | ||
$originUrl = [Uri](Invoke-Git remote get-url origin) | ||
if ($originUrl) { | ||
$lastPathSegment = $originUrl.Segments[$originUrl.Segments.Length - 1] | ||
if ($lastPathSegment.EndsWith('.git')) { | ||
$lastPathSegment = $lastPathSegment.Substring(0, $lastPathSegment.Length - '.git'.Length) | ||
} | ||
Write-Verbose 'Using origin remote URL to derive ProductName.' | ||
$ProductName = $lastPathSegment | ||
} | ||
} | ||
|
||
if (!$ProductName) { | ||
Write-Error "Unable to determine default value for -ProductName." | ||
} | ||
} | ||
|
||
if (!$OwnerAlias) { | ||
if ($env:BUILD_REQUESTEDFOREMAIL) { | ||
Write-Verbose 'Using $env:BUILD_REQUESTEDFOREMAIL and slicing to just the alias for OwnerAlias.' | ||
$OwnerAlias = ($env:BUILD_REQUESTEDFOREMAIL -split '@')[0] | ||
} | ||
else { | ||
Write-Verbose 'Using $env:USERNAME for OwnerAlias.' | ||
$OwnerAlias = $env:USERNAME | ||
} | ||
if (!$OwnerAlias) { | ||
Write-Error "Unable to determine default value for -OwnerAlias." | ||
} | ||
} | ||
|
||
if (!$Requester) { | ||
if ($env:BUILD_REQUESTEDFOREMAIL) { | ||
Write-Verbose 'Using $env:BUILD_REQUESTEDFOREMAIL and slicing to just the alias for Requester.' | ||
$Requester = ($env:BUILD_REQUESTEDFOREMAIL -split '@')[0] | ||
} | ||
else { | ||
Write-Verbose 'Using $env:USERNAME for Requester.' | ||
$Requester = $env:USERNAME | ||
} | ||
if (!$Requester) { | ||
Write-Error "Unable to determine default value for -Requester." | ||
} | ||
} | ||
|
||
if (!$RepoUrl) { | ||
$RepoUrl = $env:BUILD_REPOSITORY_URI | ||
if (!$RepoUrl) { | ||
$originUrl = [Uri](Invoke-Git remote get-url origin) | ||
if ($originUrl) { | ||
Write-Verbose 'Using git origin remote url for GitURL.' | ||
$RepoUrl = $originUrl | ||
} | ||
|
||
if (!$RepoUrl) { | ||
Write-Error "Unable to determine default value for -RepoUrl." | ||
} | ||
} | ||
} | ||
|
||
Push-Location $PSScriptRoot | ||
$versionsObj = & (& "$PSScriptRoot/Get-nbgv.ps1") get-version -f json | ConvertFrom-Json | ||
Pop-Location | ||
|
||
$ReleaseDateString = $ReleaseDate.ToShortDateString() | ||
$Version = $versionsObj.Version | ||
|
||
$BackupSize = Get-ChildItem $PSScriptRoot\..\.git -Recurse -File | Measure-Object -Property Length -Sum | ||
$DataSizeMB = [int]($BackupSize.Sum / 1mb) | ||
$FileCount = $BackupSize.Count | ||
|
||
$Request = @{ | ||
"Requester" = $Requester | ||
"Manager" = $ManagerAlias | ||
"TeamAlias" = $TeamAlias | ||
"AdditionalContacts" = $AdditionalContacts | ||
"BusinessGroupName" = $BusinessGroupName | ||
"ProductName" = $ProductName | ||
"Version" = $Version | ||
"ProductionType" = $ProductionType | ||
"ReleaseType" = $ReleaseType | ||
"ReleaseDateString" = $ReleaseDateString | ||
"OS" = [string]::Join(',', $OS) | ||
"ProductLanguage" = [string]::Join(',', $ProductLanguage) | ||
"FileCollection" = [string]::Join(',', $FileCollection) | ||
"OwnerAlias" = $OwnerAlias | ||
"Notes" = $Notes.Trim() | ||
"CustomerProvidedDataSizeMB" = $DataSizeMB | ||
"CustomerProvidedFileCount" = $FileCount | ||
"BackupType" = $BackupType | ||
"ServerPath" = $ServerPath | ||
"AzureStorageAccount" = $AzureStorageAccount | ||
"AzureStorageContainer" = $AzureStorageContainer | ||
"GitURL" = $RepoUrl | ||
} | ||
|
||
$RequestJson = ConvertTo-Json $Request | ||
Write-Host "SCA request:`n$RequestJson" | ||
|
||
if ($PSCmdlet.ShouldProcess('source archival request', 'post')) { | ||
if (!$SourceCodeArchivalUri) { | ||
Write-Error "Unable to post request without -SourceCodeArchivalUri parameter." | ||
exit 1 | ||
} | ||
|
||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 | ||
|
||
$Response = Invoke-WebRequest -Uri $SourceCodeArchivalUri -Method POST -Body $RequestJson -ContentType "application/json" -UseBasicParsing -SkipHttpErrorCheck | ||
Write-Host "Status Code : " -NoNewline | ||
$responseContent = ConvertFrom-Json ($Response.Content) | ||
if ($Response.StatusCode -eq 200) { | ||
Write-Host $Response.StatusCode -ForegroundColor Green | ||
Write-Host "Ticket ID : " -NoNewline | ||
Write-Host $responseContent | ||
} | ||
else { | ||
$responseContent = ConvertFrom-Json $Response.Content | ||
Write-Host $Response.StatusCode -ForegroundColor Red | ||
Write-Host "Message : $($responseContent.message)" | ||
} | ||
} elseif ($SourceCodeArchivalUri) { | ||
Write-Host "Would have posted to $SourceCodeArchivalUri" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<# | ||
.SYNOPSIS | ||
Look up the pull request URL of the insertion PR. | ||
#> | ||
$stagingFolder = $env:BUILD_STAGINGDIRECTORY | ||
if (!$stagingFolder) { | ||
$stagingFolder = $env:SYSTEM_DEFAULTWORKINGDIRECTORY | ||
if (!$stagingFolder) { | ||
Write-Error "This script must be run in an Azure Pipeline." | ||
exit 1 | ||
} | ||
} | ||
$markdownFolder = Join-Path $stagingFolder (Join-Path 'MicroBuild' 'Output') | ||
$markdownFile = Join-Path $markdownFolder 'PullRequestUrl.md' | ||
if (!(Test-Path $markdownFile)) { | ||
Write-Error "This script should be run after the MicroBuildInsertVsPayload task." | ||
exit 2 | ||
} | ||
|
||
$insertionPRUrl = Get-Content $markdownFile | ||
if (!($insertionPRUrl -match 'https:.+?/pullrequest/(\d+)')) { | ||
Write-Error "Failed to parse pull request URL: $insertionPRUrl" | ||
exit 3 | ||
} | ||
|
||
$Matches[1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.