Skip to content

Commit ae68dbb

Browse files
author
Tracy Boehrer
committed
Merge branch 'main' into releases/4.22
2 parents d46f6f3 + 07ed900 commit ae68dbb

File tree

136 files changed

+2127
-1033
lines changed

Some content is hidden

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

136 files changed

+2127
-1033
lines changed

.github/workflows/create-botbuilder-parity-issues.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ jobs:
4545
runs-on: ubuntu-latest
4646
if: github.event.pull_request.merged == true
4747
needs: encode
48+
permissions:
49+
issues: write
4850

4951
strategy:
5052
matrix:
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
steps:
2+
- task: DownloadPipelineArtifact@2
3+
displayName: 'Download BotBuilderDLLs from Artifacts'
4+
inputs:
5+
artifactName: 'BotBuilderDLLs-Debug-Windows-netcoreapp31'
6+
targetPath: '$(System.ArtifactsDirectory)/OutputDlls'
7+
8+
- task: DownloadPipelineArtifact@2
9+
displayName: 'Download ContractDlls from Artifacts'
10+
inputs:
11+
artifactName: 'ContractDlls'
12+
targetPath: '$(System.ArtifactsDirectory)/ContractDlls'
13+
14+
- powershell: |
15+
Write-Host "The following API compatibility issues are suppressed:";
16+
Get-Content "ApiCompatBaseline.txt";
17+
displayName: 'Show API compat issue suppressions in ApiCompatBaseline.txt'
18+
continueOnError: true
19+
20+
- task: SOUTHWORKS.binaries-comparer.custom-build-release-task.binaries-comparer@0
21+
displayName: 'Compare Binaries'
22+
inputs:
23+
contractsRootFolder: '$(System.ArtifactsDirectory)/ContractDlls'
24+
contractsFileName: '$(PackageName).dll'
25+
implFolder: '$(System.ArtifactsDirectory)/OutputDlls'
26+
failOnIssue: false
27+
resolveFx: false
28+
generateLog: true
29+
outputFilename: '$(PackageName).$(ApiContractVersion).CompatResults.txt'
30+
outputFolder: '$(Build.ArtifactStagingDirectory)'
31+
useBaseline: true
32+
baselineFile: ApiCompatBaseline.txt
33+
continueOnError: false
34+
35+
- powershell: |
36+
$filePath = "$(Build.ArtifactStagingDirectory)\$(PackageName).$(ApiContractVersion).CompatResults.txt"
37+
$nugetLink = "compared against [version $(ApiContractVersion)](https://www.nuget.org/packages/$(PackageName)/$(ApiContractVersion)).";
38+
Write-Host "Compatibility Check:";
39+
40+
if (-not (Test-Path $filePath)) {
41+
$content = "The binary compatibility report for library '$(PackageName)' wasn't generated. This may have happened because the NuGet library '$(PackageName)' for version '$(ApiContractVersion)' was unavailable or a connectivity issue."
42+
New-Item -Path '$(Build.ArtifactStagingDirectory)' -Name '$(PackageName).$(ApiContractVersion).CompatResults.txt' -ItemType "file" -Value $content
43+
$content;
44+
Write-Host "##vso[task.complete result=Failed;]";
45+
return;
46+
}
47+
48+
$baseline = Get-Content $filePath -Raw;
49+
Write-Host "`n[Compare binaries task]";
50+
Write-Host "`nOriginal result:";
51+
$baseline;
52+
53+
# When the Api Compat task has Binary compatibility issues, this process will filter out the Classes
54+
# and then validates if still exists remaining issues.
55+
if ($baseline.ToString().Trim().StartsWith(':x:')) {
56+
Write-Host "`n[Class exclusion]";
57+
$excludeClasses = "$($env:ApiCompatExcludeClasses)".Trim().Split(',') | Where-Object { ($_.Trim().Length -gt 0) } | ForEach-Object { $_.Trim() };
58+
59+
if ($excludeClasses) {
60+
Write-Host "`nList of classes to exclude:";
61+
$excludeClasses | ForEach-Object { " - " + $_ }
62+
}
63+
else {
64+
Write-Host "`nThere are no classes to exclude.";
65+
}
66+
67+
$content = ($baseline -split '<details\>|<\/details\>');
68+
$header = $content[0].SubString($content[0].IndexOf('Binary') - 1).Trim();
69+
$issues = $content[1].Trim();
70+
$issues = ($issues -replace '```', '').Split([Environment]::NewLine);
71+
72+
# Filter out issues based on Class name.
73+
$issues = @(
74+
$issues | Where-Object {
75+
$line = $_;
76+
if (-not $line.Trim()) {
77+
return $false;
78+
}
79+
if ($excludeClasses) {
80+
foreach ($class in $excludeClasses) {
81+
$pattern = "'$class";
82+
if ($line -match $pattern) {
83+
return $false;
84+
}
85+
}
86+
}
87+
return $true;
88+
} | ForEach-Object { $_.Trim() }
89+
)
90+
91+
# Creates new file content.
92+
if ($issues) {
93+
$newFile = @();
94+
$newfile += ":x: $($issues.Length) $header $nugetLink";
95+
$newFile += '<details>';
96+
$newFile += "";
97+
$newFile += '```';
98+
$newfile += $issues;
99+
$newFile += '```';
100+
$newFile += "";
101+
$newFile += '</details>';
102+
103+
$newFile = $newFile -join [Environment]::NewLine;
104+
Write-Host "##vso[task.complete result=Failed;]";
105+
}
106+
else {
107+
$newFile = ":heavy_check_mark: No Binary Compatibility issues for **$(PackageName)** $nugetLink";
108+
}
109+
110+
$baseline = $newFile;
111+
[system.io.file]::WriteAllText($filePath, $baseline);
112+
Write-Host "`nProcessed result:";
113+
$baseline;
114+
}
115+
displayName: 'Compatibility Check'
116+
continueOnError: false
117+
condition: succeededOrFailed()
118+
119+
- task: PublishBuildArtifacts@1
120+
displayName: 'Publish Compat Results artifact'
121+
inputs:
122+
ArtifactName: '$(PackageName).$(ApiContractVersion).CompatResults'
123+
condition: succeededOrFailed()
124+
125+
- script: |
126+
dir .. /s
127+
displayName: 'Dir workspace'
128+
continueOnError: true
129+
condition: succeededOrFailed()

build/onebranch/ci-build-steps.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
steps:
2+
- powershell: 'gci env:* | sort-object name | Format-Table -AutoSize -Wrap'
3+
displayName: 'Display env vars'
4+
5+
# Variables ReleasePackageVersion and PreviewPackageVersion are consumed by projects in Microsoft.Bot.Builder.sln.
6+
# For the signed build, they should be settable at queue time. To set that up, define the variables in Azure on the Variables tab.
7+
- task: NuGetToolInstaller@1
8+
displayName: 'Use NuGet '
9+
10+
- template: sdk_dotnet_v4_org-feed-setup-steps.yml
11+
12+
- task: NuGetToolInstaller@1
13+
displayName: 'Use NuGet latest'
14+
15+
- task: NuGetCommand@2
16+
inputs:
17+
command: 'restore'
18+
feedsToUse: 'config'
19+
nugetConfigPath: 'nuget.config'
20+
restoreSolution: '$(Parameters.solution)'
21+
displayName: 'NuGet restore'
22+
23+
- task: VSBuild@1
24+
displayName: 'Build solution Microsoft.Bot.Builder.sln'
25+
inputs:
26+
solution: '$(Parameters.solution)'
27+
vsVersion: 17.0
28+
msbuildArgs: '$(MSBuildArguments)'
29+
platform: '$(BuildPlatform)'
30+
configuration: '$(BuildConfiguration)'
31+
maximumCpuCount: true
32+
logProjectEvents: false
33+
34+
#- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
35+
# displayName: 'Component Detection'
36+
# inputs:
37+
# failOnAlert: true
38+
39+
#- script: |
40+
# cd ..
41+
# dir *.* /s
42+
# displayName: 'Dir workspace'
43+
# continueOnError: true
44+
# condition: succeededOrFailed()
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
steps:
2+
- task: ComponentGovernanceComponentDetection@0
3+
displayName: Component Detection
4+
inputs:
5+
scanType: "Register"
6+
verbosity: "Verbose"
7+
alertWarningLevel: "High"
8+
failOnAlert: true
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
steps:
2+
- task: DownloadBuildArtifacts@0
3+
displayName: 'Download compat results artifact'
4+
inputs:
5+
downloadType: specific
6+
itemPattern: '**\*.txt'
7+
downloadPath: '$(System.ArtifactsDirectory)\ApiCompat'
8+
9+
- task: CopyFiles@2
10+
displayName: 'Copy results for publish to Artifacts'
11+
inputs:
12+
SourceFolder: '$(System.ArtifactsDirectory)\ApiCompat'
13+
Contents: '**\*.txt'
14+
TargetFolder: '$(System.ArtifactsDirectory)\ApiCompatibilityResults'
15+
flattenFolders: true
16+
17+
- task: PublishPipelineArtifact@1
18+
inputs:
19+
artifactName: 'ApiCompatibilityResults'
20+
targetPath: '$(System.ArtifactsDirectory)\ApiCompatibilityResults'
21+
displayName: 'Publish compat results to Artifacts'
22+
continueOnError: true
23+
24+
- task: SOUTHWORKS.github-pr-comment.custom-publish-comment-task.github-pr-comment@0
25+
displayName: 'Publish compat results to GitHub'
26+
inputs:
27+
userToken: '$(GitHubCommentApiKey)'
28+
bodyFilePath: '$(System.ArtifactsDirectory)\ApiCompat'
29+
getSubFolders: true
30+
keepCommentHistory: false
31+
# Skip for forks, as secret tokens are not available to them.
32+
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'), ne(variables['System.PullRequest.IsFork'], 'True'))
33+
34+
- script: |
35+
dir .. /s
36+
displayName: 'Dir workspace'
37+
continueOnError: true
38+
condition: succeededOrFailed()

build/onebranch/ci-test-steps.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
#variables:
2+
# DotNetCoverallsToken: define this in Azure
3+
# PublishCoverage: (optional) set to true in the calling template.
4+
steps:
5+
- powershell: |
6+
Remove-Item CodeCoverage -Force -Recurse -ErrorAction Ignore
7+
New-Item CodeCoverage -ItemType Directory -Force
8+
displayName: 'Create Code Coverage directory'
9+
10+
- task: NodeTool@0
11+
displayName: 'install Node.js v14.x'
12+
inputs:
13+
versionSpec: '14.x'
14+
15+
- task: Npm@1
16+
displayName: 'install botframework-cli to set up for Schema merge tests'
17+
inputs:
18+
command: custom
19+
verbose: false
20+
customCommand: 'install -g @microsoft/botframework-cli@next'
21+
22+
- task: UseDotNet@2
23+
displayName: "Install .NET Core 3.1.415"
24+
continueOnError: true
25+
inputs:
26+
packageType: "sdk"
27+
version: 3.1.415
28+
condition: and(succeeded(), eq(variables['BuildConfiguration'],'Release-Windows'), eq(variables['BuildTarget'],'netcoreapp31'))
29+
30+
- task: DotNetCoreCLI@2
31+
displayName: 'dotnet test (release) 3.1'
32+
inputs:
33+
command: test
34+
projects: |
35+
Tests/**/*Tests.csproj
36+
37+
arguments: '-v n -f netcoreapp3.1 --configuration release --no-build --no-restore --filter "TestCategory!=IgnoreInAutomatedBuild&TestCategory!=FunctionalTests" --collect:"Code Coverage" --settings $(Build.SourcesDirectory)\CodeCoverage.runsettings'
38+
condition: and(succeeded(), eq(variables['BuildConfiguration'],'Release-Windows'), eq(variables['BuildTarget'],'netcoreapp31'))
39+
40+
- task: DotNetCoreCLI@2
41+
displayName: 'dotnet test (release) 6.0'
42+
inputs:
43+
command: test
44+
projects: |
45+
Tests/**/*Tests.csproj
46+
47+
arguments: '-v n -f net6.0 --configuration release --no-build --no-restore --filter "TestCategory!=IgnoreInAutomatedBuild&TestCategory!=FunctionalTests" --collect:"Code Coverage" --settings $(Build.SourcesDirectory)\CodeCoverage.runsettings'
48+
condition: and(succeeded(), eq(variables['BuildConfiguration'],'Release-Windows'), eq(variables['BuildTarget'],'net6'))
49+
50+
- powershell: |
51+
# This task copies the code coverage file created by dotnet test into a well known location. In all
52+
# checks I've done, dotnet test ALWAYS outputs the coverage file to the temp directory.
53+
# My attempts to override this and have it go directly to the CodeCoverage directory have
54+
# all failed, so I'm just doing the copy here. (cmullins)
55+
56+
Get-ChildItem -Path "D:\a\_temp" -Include "*.coverage" -Recurse | Copy-Item -Destination CodeCoverage
57+
displayName: 'Copy .coverage Files to CodeCoverage folder'
58+
condition: and(succeeded(), eq(variables['PublishCoverage'], 'true'))
59+
60+
- powershell: 'echo ''##vso[task.setvariable variable=CoverallsToken]$(DotNetCoverallsToken)'''
61+
displayName: 'Set CoverallsToken for PublishToCoveralls.ps1 if token exists'
62+
continueOnError: true
63+
condition: and(succeeded(), eq(variables['PublishCoverage'], 'true'))
64+
65+
- powershell: |
66+
dotnet nuget remove source SDK_Dotnet_V4_org
67+
displayName: Remove SDK_Dotnet_V4_org feed source reference from nuget.config
68+
continueOnError: true
69+
condition: and(succeeded(), eq(variables['PublishCoverage'], 'true'), ne(variables['System.PullRequest.IsFork'], 'True'))
70+
71+
- task: PowerShell@2
72+
displayName: 'Upload Coverage Files to Coveralls.io https://coveralls.io/github/microsoft/botbuilder-dotnet'
73+
inputs:
74+
targetType: filePath
75+
filePath: '$(Build.SourcesDirectory)\build\PublishToCoveralls.ps1'
76+
arguments: '-pathToCoverageFiles "$(Build.SourcesDirectory)\CodeCoverage" -serviceName "CI-PR build"'
77+
continueOnError: true
78+
# Skip for forks because it errors: "Couldn't find a repository matching this job."
79+
condition: and(succeeded(), eq(variables['PublishCoverage'], 'true'), ne(variables['System.PullRequest.IsFork'], 'True'))
80+
81+
- powershell: |
82+
New-Item -ItemType directory -Path "outputLibraries\" -Force
83+
84+
$buildTarget = $env:BuildConfiguration.Split("-")[0];
85+
86+
$env:PackagesToValidate.Split(",") | ForEach {
87+
$library = $_.Trim()
88+
Write-Host $library
89+
90+
Get-ChildItem -Path "*/$library/bin/$buildTarget/netstandard2.0/$library.dll" -Recurse | Copy-Item -Destination 'outputLibraries\' -Force
91+
Get-ChildItem -Path "*/*/$library/bin/$buildTarget/netstandard2.0/$library.dll" -Recurse | Copy-Item -Destination 'outputLibraries\' -Force
92+
}
93+
displayName: 'Copy DLLs to outputLibraries folder'
94+
95+
- task: PublishPipelineArtifact@0
96+
displayName: 'Publish Microsoft.Bot.Builder DLLs artifact'
97+
inputs:
98+
artifactName: 'BotBuilderDLLs-$(BuildConfiguration)-$(BuildTarget)'
99+
targetPath: outputLibraries
100+
continueOnError: true
101+
102+
- script: |
103+
dir .. /s
104+
displayName: 'Dir workspace'
105+
continueOnError: true
106+
condition: succeededOrFailed()

build/onebranch/ci.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#variables:
2+
# BuildConfiguration: Release-Windows
3+
# TestConfiguration: Release
4+
# BuildPlatform: any cpu
5+
# MSBuildArguments: -p:PublishRepositoryUrl=true -p:GeneratePackages=true -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
6+
# Packaging.EnableSBOMSigning: true
7+
# Parameters.solution: Microsoft.Bot.Builder.sln
8+
## PreviewPackageVersion: 4.8.0-preview-$(Build.BuildNumber) # Consumed by projects in Microsoft.Bot.Builder.sln. Define this in Azure to be settable at queue time.
9+
## ReleasePackageVersion: 4.8.0-preview-$(Build.BuildNumber) # Consumed by projects in Microsoft.Bot.Builder.sln. Define this in Azure to be settable at queue time.
10+
## SDK_Dotnet_V4_org_Url: define this in Azure
11+
12+
steps:
13+
- powershell: |
14+
# Replace {DateStamp} and {CommitHash} tokens with the actual values in vars ReleasePackageVersion and PreviewPackageVersion
15+
$dateStamp = (Get-Date -format "yyyyMMdd");
16+
$commitHash = "$(Build.SourceVersion)".SubString(0,7);
17+
18+
"Raw ReleasePackageVersion = $(ReleasePackageVersion)";
19+
$v = "$(ReleasePackageVersion)".Replace("{DateStamp}",$dateStamp).Replace("{CommitHash}",$commitHash);
20+
Write-Host "##vso[task.setvariable variable=ReleasePackageVersion;]$v";
21+
"Resolved ReleasePackageVersion = $v";
22+
23+
"Raw PreviewPackageVersion = $(PreviewPackageVersion)";
24+
$ppv = "$(PreviewPackageVersion)".Replace("{DateStamp}",$dateStamp).Replace("{CommitHash}",$commitHash);
25+
Write-Host "##vso[task.setvariable variable=PreviewPackageVersion;]$ppv";
26+
"Resolved PreviewPackageVersion = $ppv";
27+
displayName: 'Resolve package version variables'
28+
29+
- task: colinsalmcorner.colinsalmcorner-buildtasks.tag-build-task.tagBuildOrRelease@0
30+
displayName: 'Tag build with release and preview versions'
31+
inputs:
32+
tags: |
33+
Release: $(ReleasePackageVersion)
34+
Preview: $(PreviewPackageVersion)
35+
continueOnError: true
36+
37+
- template: ci-build-steps.yml
38+
- template: sign-steps.yml
39+
40+
# - task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
41+
# displayName: 'Component Detection'
42+
# inputs:
43+
# failOnAlert: false

0 commit comments

Comments
 (0)