Skip to content

Commit ad6d561

Browse files
authored
[v3.x] Add 1ES CI pipelines (#10247)
* Onboard v3.x to 1ES templates * update nuget feeds * Revert nuget.config feeds. Remove unused tools * Fix buildNumber * Use .net 8 SDK, fix version propagation * Fix update build number * Install additional .NET SDKs * Fix/suppress cred scan hits in test files * Remove performance app from legacy ci * update 1es tests * Test release * Fix non-e2e env * Fix webhost bin config path * fix TestHelpers * Fix missing variable * Set AzureWebJobsEventHubPath in test env * Fix .net 3.1 missing for tests * Remove test change * Fix .net 3.1 missing for tests
1 parent c7a9928 commit ad6d561

File tree

78 files changed

+668
-3307
lines changed

Some content is hidden

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

78 files changed

+668
-3307
lines changed

.nuget/NuGet.Config

Lines changed: 0 additions & 9 deletions
This file was deleted.

.nuget/packages.config

Lines changed: 0 additions & 4 deletions
This file was deleted.

NuGet.config

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<packageSources>
4-
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
4+
<clear />
5+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
56
<add key="AzureFunctionsTempStaging" value="https://azfunc.pkgs.visualstudio.com/e6a70c92-4128-439f-8012-382fe78d6396/_packaging/AzureFunctionsTempStaging/nuget/v3/index.json" />
67
<add key="azure-appservice-test" value="https://azfunc.pkgs.visualstudio.com/e6a70c92-4128-439f-8012-382fe78d6396/_packaging/azure-appservice-test%40Local/nuget/v3/index.json" />
78
<add key="Microsoft.Azure.Functions.PowerShellWorker" value="https://azfunc.pkgs.visualstudio.com/e6a70c92-4128-439f-8012-382fe78d6396/_packaging/Microsoft.Azure.Functions.PowerShellWorker/nuget/v3/index.json" />
@@ -10,4 +11,4 @@
1011
<!-- dotnet-tools is required for Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.XUnit -->
1112
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json"/>
1213
</packageSources>
13-
</configuration>
14+
</configuration>

azure-pipelines.yml

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ jobs:
4949
buildNumberSuffix: $[variables.buildNumberSuffixTemp]
5050
packSuffixSwitch: $[variables.packSuffixSwitchTemp]
5151
emgSuffixSwitch: $[variables.emgSuffixSwitchTemp]
52-
majorVersion: $[dependencies.InitializePipeline.outputs['Initialize.MajorVersion']]
53-
minorVersion: $[dependencies.InitializePipeline.outputs['Initialize.MinorVersion']]
54-
patchVersion: $[dependencies.InitializePipeline.outputs['Initialize.PatchVersion']]
5552
pool:
5653
name: '1ES-Hosted-AzFunc'
5754
demands:
@@ -68,7 +65,7 @@ jobs:
6865
displayName: "Build artifacts"
6966
inputs:
7067
filePath: '$(Build.Repository.LocalPath)\build\build-extensions.ps1'
71-
arguments: '-buildNumber "$(buildNumberSuffix)" -majorMinorVersion "$(majorVersion).$(minorVersion)" -patchVersion "$(patchVersion)" -suffix "$(suffix)" -commitHash "$(Build.SourceVersion)"'
68+
arguments: '-buildNumber "$(buildNumberSuffix)" -suffix "$(suffix)" -commitHash "$(Build.SourceVersion)"'
7269
- task: PowerShell@2
7370
condition: eq(variables['RUNBUILDFORINTEGRATIONTESTS'], 'True')
7471
displayName: "Update host references"
@@ -112,14 +109,6 @@ jobs:
112109
publishVstsFeed: 'e6a70c92-4128-439f-8012-382fe78d6396/f37f760c-aebd-443e-9714-ce725cd427df'
113110
allowPackageConflicts: true
114111

115-
- task: DotNetCoreCLI@2
116-
displayName: 'Build performance package'
117-
inputs:
118-
command: 'custom'
119-
custom: 'pack'
120-
arguments: '-o WebJobs.Script.Performance.App'
121-
projects: |
122-
**\WebJobs.Script.Performance.App.csproj
123112
- task: DotNetCoreCLI@2
124113
displayName: 'Build Abstractions and ExtensionsMetadataGenerator'
125114
inputs:
@@ -325,13 +314,6 @@ jobs:
325314
Verbosity: 'Information'
326315
- publish: $(Build.Repository.LocalPath)\packages
327316
artifact: NugetPackages
328-
- task: ManifestGeneratorTask@0
329-
displayName: 'SBOM Generation Task - Performance'
330-
inputs:
331-
BuildDropPath: '$(Build.Repository.LocalPath)\WebJobs.Script.Performance.App'
332-
Verbosity: 'Information'
333-
- publish: $(Build.Repository.LocalPath)\WebJobs.Script.Performance.App
334-
artifact: Performance
335317

336318
- job: RunUnitTests
337319
pool:
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Get major, minor and patchVersions
2+
$version = @{}
3+
[xml]$XMLContents = [xml](Get-Content -Path "$PSScriptRoot\common.props")
4+
$XMLContents.GetElementsByTagName("MajorVersion") | ForEach-Object {
5+
$version.Major = $_.InnerText
6+
}
7+
8+
$XMLContents.GetElementsByTagName("MinorVersion") | ForEach-Object {
9+
$version.Minor = $_.InnerText
10+
}
11+
12+
$XMLContents.GetElementsByTagName("PatchVersion") | ForEach-Object {
13+
$version.Patch = $_.InnerText
14+
}
15+
16+
return $version

build/build-extensions.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
param (
22
[string]$buildNumber,
3-
[string]$majorMinorVersion,
4-
[string]$patchVersion,
53
[string]$suffix = "",
64
[string]$commitHash = "N/A",
75
[string]$hashesForHardlinksFile = "hashesForHardlinks.txt"
86
)
97

8+
$version = & $PSScriptRoot\Get-AzureFunctionsVersion.ps1
9+
$majorMinorVersion = "$($version.Major).$($version.Minor)"
10+
$patchVersion = $version.Patch
11+
1012
$extensionVersion = "$majorMinorVersion.$patchVersion"
1113
Write-Host "ExtensionVersion is $extensionVersion"
1214
Write-Host "BuildNumber is $buildNumber"

build/common.props

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,22 @@
1616
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)..\src.ruleset</CodeAnalysisRuleSet>
1717
<NoWarn>$(NoWarn);NU1701</NoWarn>
1818
<DebugType>embedded</DebugType>
19-
<UseSourceLink Condition="$(UseSourceLink) == '' And $(CI) != ''">true</UseSourceLink>
20-
<Deterministic>True</Deterministic>
19+
<Deterministic>True</Deterministic>
20+
<NugetAudit>false</NugetAudit>
2121
</PropertyGroup>
2222

2323
<PropertyGroup Condition="'$(UseSourceLink)' == 'true'">
2424
<SourceLink>$(BaseIntermediateOutputPath)source_link.json</SourceLink>
2525
</PropertyGroup>
26-
26+
27+
<PropertyGroup>
28+
<!--
29+
NOTE: source link does not actually work for v3.x in 1ES as the git remote url is Azure DevOps, not GitHub.
30+
However, we do not release public nuget packages from this branch anymore so it is not even used.
31+
-->
32+
<UseSourceLink Condition="$(UseSourceLink) == '' And $(CI) != ''">true</UseSourceLink>
33+
</PropertyGroup>
34+
2735
<Target Name="GenerateSourceLink" BeforeTargets="CoreCompile" Condition="'$(UseSourceLink)' == 'true'">
2836
<PropertyGroup>
2937
<SrcRootDirectory>$([System.IO.Directory]::GetParent($(MSBuildThisFileDirectory.TrimEnd("\"))))</SrcRootDirectory>

build/initialize-pipeline.ps1

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,21 @@ if ($buildReason -eq "PullRequest") {
1717
}
1818

1919
# Get major, minor and patchVersions
20-
[xml]$XMLContents = [xml](Get-Content -Path ".\build\common.props")
21-
$XMLContents.GetElementsByTagName("MajorVersion") | ForEach-Object {
22-
$majorVersion = $_.InnerText
23-
Write-Host "##vso[task.setvariable variable=MajorVersion;isOutput=true]$majorVersion"
24-
Write-Host "Setting 'MajorVersion' to $majorVersion"
25-
}
20+
$version = & $PSScriptRoot\Get-AzureFunctionsVersion.ps1
21+
Write-Host "##vso[task.setvariable variable=MajorVersion;isOutput=true]$($version.Major)"
22+
Write-Host "Setting 'MajorVersion' to $($version.Major)"
2623

27-
$XMLContents.GetElementsByTagName("MinorVersion") | ForEach-Object {
28-
$minorVersion = $_.InnerText
29-
Write-Host "##vso[task.setvariable variable=MinorVersion;isOutput=true]$minorVersion"
30-
Write-Host "Setting 'MinorVersion' to $minorVersion"
31-
}
24+
Write-Host "##vso[task.setvariable variable=MinorVersion;isOutput=true]$($version.Minor)"
25+
Write-Host "Setting 'MinorVersion' to $($version.Minor)"
3226

33-
$XMLContents.GetElementsByTagName("PatchVersion") | ForEach-Object {
34-
$patchVersion = $_.InnerText
35-
Write-Host "##vso[task.setvariable variable=PatchVersion;isOutput=true]$patchVersion"
36-
Write-Host "Setting 'PatchVersion' to $patchVersion"
37-
}
27+
Write-Host "##vso[task.setvariable variable=PatchVersion;isOutput=true]$($version.Patch)"
28+
Write-Host "Setting 'PatchVersion' to $($version.Patch)"
3829

3930
#Update buildnumber with the same (Will be used by release pipelines)
40-
$customBuildNumber = "$majorVersion.$minorVersion.$patchVersion"
31+
$customBuildNumber = "$($version.Major).$($version.Minor).$($version.Patch)"
4132
if(($buildReason -eq "PullRequest") -or !($sourceBranch.ToLower().Contains("release")))
4233
{
4334
$customBuildNumber = "$customBuildNumber-$buildNumber"
4435
}
45-
Write-Host "##vso[build.updatebuildnumber]$customBuildNumber"
36+
37+
Write-Host "##vso[build.updatebuildnumber]$customBuildNumber"

eng/ci/code-mirror.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
trigger:
2+
branches:
3+
include:
4+
- v3.x
5+
- release/3.*
6+
7+
resources:
8+
repositories:
9+
- repository: eng
10+
type: git
11+
name: engineering
12+
ref: refs/tags/release
13+
14+
variables:
15+
- template: ci/variables/cfs.yml@eng
16+
17+
extends:
18+
template: ci/code-mirror.yml@eng

eng/ci/integration-tests.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
trigger: none # ensure this is not ran as a CI build
2+
3+
pr:
4+
branches:
5+
include:
6+
- v3.x
7+
- release/3.*
8+
9+
resources:
10+
repositories:
11+
- repository: 1es
12+
type: git
13+
name: 1ESPipelineTemplates/1ESPipelineTemplates
14+
ref: refs/tags/release
15+
- repository: eng
16+
type: git
17+
name: engineering
18+
ref: refs/tags/release
19+
20+
variables:
21+
- template: /eng/ci/templates/variables/build.yml@self
22+
- template: /ci/variables/cfs.yml@eng
23+
24+
extends:
25+
template: v1/1ES.Unofficial.PipelineTemplate.yml@1es
26+
parameters:
27+
pool:
28+
name: 1es-pool-azfunc
29+
image: 1es-windows-2022
30+
os: windows
31+
32+
stages:
33+
- stage: Test
34+
jobs:
35+
- template: /eng/ci/templates/jobs/initialize-pipeline.yml@self
36+
- template: /eng/ci/templates/official/jobs/run-non-e2e-tests.yml@self
37+
- template: /eng/ci/templates/official/jobs/run-integration-tests.yml@self

0 commit comments

Comments
 (0)