Skip to content

Commit

Permalink
[Rollout] Production rollout 2024-10-23 (#4083)
Browse files Browse the repository at this point in the history
  • Loading branch information
premun authored Oct 22, 2024
2 parents c76d938 + 7f425d9 commit 4bb6117
Show file tree
Hide file tree
Showing 71 changed files with 1,306 additions and 607 deletions.
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<PackageVersion Include="Blazored.SessionStorage" Version="2.4.0" />
<PackageVersion Include="CommandLineParser" Version="2.2.1" />
<PackageVersion Include="CoreHealthMonitor" Version="$(CoreHealthMonitorVersion)" />
<PackageVersion Include="DistributedLock.Redis" Version="1.0.3" />
<PackageVersion Include="EntityFrameworkCore.Triggers" Version="1.1.1" />
<PackageVersion Include="FluentAssertions.Json" Version="5.5.0" />
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
Expand Down
3 changes: 2 additions & 1 deletion NuGet.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
Expand Down Expand Up @@ -27,6 +27,7 @@
<package pattern="CsvHelper" />
<package pattern="DiffEngine" />
<package pattern="DiffPlex" />
<package pattern="DistributedLock.*" />
<package pattern="DotNetAnalyzers.DocumentationAnalyzers" />
<package pattern="DotNetAnalyzers.DocumentationAnalyzers.Unstable" />
<package pattern="dotnet-ef" />
Expand Down
29 changes: 1 addition & 28 deletions arcade-services.sln
Original file line number Diff line number Diff line change
Expand Up @@ -34,32 +34,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
eng\Versions.props = eng\Versions.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Validation", "Validation", "{F92E1B5C-26D4-4244-A4F9-41E22BA8E1CE}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scenarios", "Scenarios", "{939DD755-B5FC-46EF-AE8B-5073DA6D4490}"
ProjectSection(SolutionItems) = preProject
src\Maestro\tests\Scenarios\all.ps1 = src\Maestro\tests\Scenarios\all.ps1
src\Maestro\tests\Scenarios\arcade-update.ps1 = src\Maestro\tests\Scenarios\arcade-update.ps1
src\Maestro\tests\Scenarios\azdoflow-batched.ps1 = src\Maestro\tests\Scenarios\azdoflow-batched.ps1
src\Maestro\tests\Scenarios\azdoflow-feedflow.ps1 = src\Maestro\tests\Scenarios\azdoflow-feedflow.ps1
src\Maestro\tests\Scenarios\azdoflow-nonbatched-all-checks-successful.ps1 = src\Maestro\tests\Scenarios\azdoflow-nonbatched-all-checks-successful.ps1
src\Maestro\tests\Scenarios\azdoflow-nonbatched.ps1 = src\Maestro\tests\Scenarios\azdoflow-nonbatched.ps1
src\Maestro\tests\Scenarios\builds.ps1 = src\Maestro\tests\Scenarios\builds.ps1
src\Maestro\tests\Scenarios\channels.ps1 = src\Maestro\tests\Scenarios\channels.ps1
src\Maestro\tests\Scenarios\clone.ps1 = src\Maestro\tests\Scenarios\clone.ps1
src\Maestro\tests\Scenarios\common.ps1 = src\Maestro\tests\Scenarios\common.ps1
src\Maestro\tests\Scenarios\default-channels.ps1 = src\Maestro\tests\Scenarios\default-channels.ps1
src\Maestro\tests\Scenarios\dependencies.ps1 = src\Maestro\tests\Scenarios\dependencies.ps1
src\Maestro\tests\Scenarios\githubflow-batched.ps1 = src\Maestro\tests\Scenarios\githubflow-batched.ps1
src\Maestro\tests\Scenarios\githubflow-nonbatched-all-checks-successful.ps1 = src\Maestro\tests\Scenarios\githubflow-nonbatched-all-checks-successful.ps1
src\Maestro\tests\Scenarios\githubflow-nonbatched-with-coherency.ps1 = src\Maestro\tests\Scenarios\githubflow-nonbatched-with-coherency.ps1
src\Maestro\tests\Scenarios\githubflow-nonbatched.ps1 = src\Maestro\tests\Scenarios\githubflow-nonbatched.ps1
src\Maestro\tests\Scenarios\githubflow-release-pipeline-nonbatched.ps1 = src\Maestro\tests\Scenarios\githubflow-release-pipeline-nonbatched.ps1
src\Maestro\tests\Scenarios\README.md = src\Maestro\tests\Scenarios\README.md
src\Maestro\tests\Scenarios\repo-policies.ps1 = src\Maestro\tests\Scenarios\repo-policies.ps1
src\Maestro\tests\Scenarios\subscriptions.ps1 = src\Maestro\tests\Scenarios\subscriptions.ps1
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DependencyUpdateErrorProcessor", "src\Maestro\DependencyUpdateErrorProcessor\DependencyUpdateErrorProcessor.csproj", "{7D7E290E-7A94-4F7B-AA05-27156C4A3CAC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FeedCleanerService", "src\Maestro\FeedCleanerService\FeedCleanerService.csproj", "{C7E8C999-F8AE-427D-B748-6BCF7202B476}"
Expand Down Expand Up @@ -144,7 +118,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProductConstructionService.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProductConstructionService.ScenarioTests", "test\ProductConstructionService.ScenarioTests\ProductConstructionService.ScenarioTests.csproj", "{12D91D30-EC50-4D2B-8D67-0C19FCD2303F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProductConstructionService.Deployment", "src\ProductConstructionService\ProductConstructionService.Deployment\ProductConstructionService.Deployment.csproj", "{A4125B78-593D-4659-AA28-0E176D4644E5}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProductConstructionService.Cli", "src\ProductConstructionService\ProductConstructionService.Cli\ProductConstructionService.Cli.csproj", "{A4125B78-593D-4659-AA28-0E176D4644E5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProductConstructionService.BarViz", "src\ProductConstructionService\ProductConstructionService.BarViz\ProductConstructionService.BarViz.csproj", "{B993607A-BD63-47A8-AF5D-7B49ACF0AF21}"
EndProject
Expand Down Expand Up @@ -749,7 +723,6 @@ Global
{EDF632B3-48E2-43FD-B014-79CDED8F4240} = {AE791E26-78E1-4936-BCF4-1BF5152CBBD6}
{37D70EEA-9621-44EB-921A-5D303917F851} = {AE791E26-78E1-4936-BCF4-1BF5152CBBD6}
{93F066A5-A2D8-4926-A255-81077AEE5972} = {AE791E26-78E1-4936-BCF4-1BF5152CBBD6}
{939DD755-B5FC-46EF-AE8B-5073DA6D4490} = {F92E1B5C-26D4-4244-A4F9-41E22BA8E1CE}
{7D7E290E-7A94-4F7B-AA05-27156C4A3CAC} = {AE791E26-78E1-4936-BCF4-1BF5152CBBD6}
{C7E8C999-F8AE-427D-B748-6BCF7202B476} = {AE791E26-78E1-4936-BCF4-1BF5152CBBD6}
{AD4D66B9-6CAB-4729-A5D1-57A859E06801} = {AE791E26-78E1-4936-BCF4-1BF5152CBBD6}
Expand Down
215 changes: 105 additions & 110 deletions azure-pipelines-product-construction-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ variables:
value: .NETCore
- name: _SignType
value: test
- ${{ if ne(variables['Build.SourceBranch'], 'refs/heads/production') }}:
- ${{ if not(or(startsWith(variables['Build.SourceBranch'], 'refs/heads/production'), startsWith(variables['Build.SourceBranch'], 'refs/heads/production-'), eq(variables['Build.SourceBranch'], 'refs/heads/production'))) }}:
- name: subscriptionId
value: e6b5f9f5-0ca4-4351-879b-014d78400ec2
- name: containerappName
Expand Down Expand Up @@ -126,17 +126,17 @@ stages:
-restore
-build
-configuration $(BuildConfig)
-projects .\src\ProductConstructionService\ProductConstructionService.Deployment\ProductConstructionService.Deployment.csproj
displayName: Build ProductConsturctionService.Deployment
-projects .\src\ProductConstructionService\ProductConstructionService.Cli\ProductConstructionService.Cli.csproj
displayName: Build ProductConstructionService.Cli
- publish: $(Build.SourcesDirectory)\artifacts\bin\ProductConstructionService.ScenarioTests\$(BuildConfig)\net8.0\publish
artifact: ProductConstructionService.ScenarioTests

- publish: $(Build.SourcesDirectory)\artifacts\packages\$(BuildConfig)\NonShipping
artifact: PackageArtifacts

- publish: $(Build.SourcesDirectory)\artifacts\bin\ProductConstructionService.Deployment\$(BuildConfig)\net8.0
artifact: ProductConstructionService.Deployment
- publish: $(Build.SourcesDirectory)\artifacts\bin\ProductConstructionService.Cli\$(BuildConfig)\net8.0
artifact: ProductConstructionService.Cli


- job: BuildAndPublishDocker
Expand All @@ -154,122 +154,117 @@ stages:
dockerImageName: $(dockerRegistryUrl)/$(containerName)

- ${{ if notin(variables['Build.Reason'], 'PullRequest') }}:
- ${{ if ne(variables['Build.SourceBranch'], 'refs/heads/production') }}:
- stage: DeployPCS
dependsOn:
- Build
displayName: Deploy Product Construction Service

jobs:
- job: Deploy
displayName: Deploy container app
pool:
name: NetCore1ESPool-Internal
demands: ImageOverride -equals 1es-windows-2019
variables:
newDockerImageTag: $[stageDependencies.Build.BuildAndPublishDocker.outputs['DockerTag.newDockerImageTag']]
- stage: DeployPCS
dependsOn:
- Build
displayName: Deploy Product Construction Service

jobs:
- job: Deploy
displayName: Deploy container app
pool:
name: NetCore1ESPool-Internal
demands: ImageOverride -equals 1es-windows-2019
variables:
newDockerImageTag: $[stageDependencies.Build.BuildAndPublishDocker.outputs['DockerTag.newDockerImageTag']]

steps:
- powershell: |
Write-Host $(containerjobNames)
$az = Get-Command az.cmd
"##vso[task.setvariable variable=azCliPath]$($az.Source)"
steps:
- powershell: |
Write-Host $(containerjobNames)
$az = Get-Command az.cmd
"##vso[task.setvariable variable=azCliPath]$($az.Source)"
- powershell: Write-Host $(azCliPath)
- powershell: Write-Host $(azCliPath)

- task: AzureCLI@2
inputs:
azureSubscription: $(serviceConnectionName)
scriptType: pscore
scriptLocation: inlineScript
inlineScript: |
New-Item -ItemType Directory -Path $(diffFolder)
$before = az containerapp show --name $(containerappName) -g $(resourceGroupName) --output json
Set-Content -Path $(diffFolder)/before.json -Value $before
displayName: Snapshot configuration (before)
- task: AzureCLI@2
inputs:
azureSubscription: $(serviceConnectionName)
scriptType: pscore
scriptLocation: inlineScript
inlineScript: |
New-Item -ItemType Directory -Path $(diffFolder)
$before = az containerapp show --name $(containerappName) -g $(resourceGroupName) --output json
Set-Content -Path $(diffFolder)/before.json -Value $before
displayName: Snapshot configuration (before)

- download: current
displayName: Download ProductConstructionService.Deployment
artifact: ProductConstructionService.Deployment
- download: current
displayName: Download ProductConstructionService.Cli
artifact: ProductConstructionService.Cli

- task: NuGetToolInstaller@1
displayName: Use NuGet
inputs:
versionSpec: 5.3.x
- task: NuGetToolInstaller@1
displayName: Use NuGet
inputs:
versionSpec: 5.3.x

- powershell: |
. .\eng\common\tools.ps1
InitializeDotNetCli -install:$true
.\.dotnet\dotnet workload install aspire
displayName: Install .NET and Aspire Workload
- powershell: |
. .\eng\common\tools.ps1
InitializeDotNetCli -install:$true
.\.dotnet\dotnet workload install aspire
displayName: Install .NET and Aspire Workload
- powershell: .\eng\common\build.ps1 -restore
displayName: Install .NET
# We'll need to give this service connection permission to get an auth token for PCS
- task: AzureCLI@2
inputs:
azureSubscription: $(serviceConnectionName)
scriptType: pscore
scriptLocation: inlineScript
inlineScript: >
$(Pipeline.Workspace)/ProductConstructionService.Cli/ProductConstructionService.Cli.exe
deploy
--subscriptionId $(subscriptionId)
--resourceGroupName $(resourceGroupName)
--containerRegistryName $(containerRegistryName)
--containerAppName $(containerappName)
--workspaceName $(containerappWorkspaceName)
--containerJobNames $(containerjobNames)
--newImageTag $(newDockerImageTag)
--imageName $(containerName)
--azCliPath "$(azCliPath)"
--redisConnectionString $(redisConnectionString)
displayName: Deploy container app

# We'll need to give this service connection permission to get an auth token for PCS
- task: AzureCLI@2
inputs:
azureSubscription: $(serviceConnectionName)
scriptType: pscore
scriptLocation: inlineScript
inlineScript: |
$(Pipeline.Workspace)/ProductConstructionService.Deployment/ProductConstructionService.Deployment.exe `
--subscriptionId $(subscriptionId) `
--resourceGroupName $(resourceGroupName) `
--containerRegistryName $(containerRegistryName) `
--containerAppName $(containerappName) `
--workspaceName $(containerappWorkspaceName) `
--containerJobNames $(containerjobNames) `
--newImageTag $(newDockerImageTag) `
--imageName $(containerName) `
--azCliPath "$(azCliPath)" `
--isCi true `
--entraAppId $(MaestroAppId) `
--redisConnectionString $(redisConnectionString)
displayName: Deploy container app
- task: AzureCLI@2
inputs:
azureSubscription: $(serviceConnectionName)
scriptType: pscore
scriptLocation: inlineScript
inlineScript: |
$after = az containerapp show --name $(containerappName) -g $(resourceGroupName) --output json
Set-Content -Path $(diffFolder)/after.json -Value $after
displayName: Snapshot configuration (after)

- task: AzureCLI@2
inputs:
azureSubscription: $(serviceConnectionName)
scriptType: pscore
scriptLocation: inlineScript
inlineScript: |
$after = az containerapp show --name $(containerappName) -g $(resourceGroupName) --output json
Set-Content -Path $(diffFolder)/after.json -Value $after
displayName: Snapshot configuration (after)
# git diff will set the exit code to 1, since the files are different, we have to manually set it back to 0
- powershell: |
$diff = git diff before.json after.json
$LASTEXITCODE = 0
Set-Content -Path diff -Value $diff
displayName: Diff configuration snapshots
workingDirectory: $(diffFolder)
# git diff will set the exit code to 1, since the files are different, we have to manually set it back to 0
- powershell: |
$diff = git diff before.json after.json
$LASTEXITCODE = 0
Set-Content -Path diff -Value $diff
displayName: Diff configuration snapshots
workingDirectory: $(diffFolder)
- publish: $(diffFolder)
displayName: Upload snapshot diff
artifact: DeploymentDiff

- publish: $(diffFolder)
displayName: Upload snapshot diff
artifact: DeploymentDiff
- stage: TestPCS
displayName: Run E2E Product Construction Service Tests
dependsOn:
- DeployPCS

- stage: TestPCS
displayName: Run E2E Product Construction Service Tests
dependsOn:
- DeployPCS

jobs:
- template: /eng/templates/jobs/e2e-pcs-tests.yml
parameters:
name: scenarioTests_GitHub
displayName: GitHub tests
testFilter: 'TestCategory=GitHub'
jobs:
- template: /eng/templates/jobs/e2e-pcs-tests.yml
parameters:
name: scenarioTests_GitHub
displayName: GitHub tests
testFilter: 'TestCategory=GitHub'

- template: /eng/templates/jobs/e2e-pcs-tests.yml
parameters:
name: scenarioTests_AzDO
displayName: AzDO tests
testFilter: 'TestCategory=AzDO'
- template: /eng/templates/jobs/e2e-pcs-tests.yml
parameters:
name: scenarioTests_AzDO
displayName: AzDO tests
testFilter: 'TestCategory=AzDO'

- template: /eng/templates/jobs/e2e-pcs-tests.yml
parameters:
name: scenarioTests_Other
displayName: Other tests
testFilter: 'TestCategory!=GitHub&TestCategory!=AzDO'
- template: /eng/templates/jobs/e2e-pcs-tests.yml
parameters:
name: scenarioTests_Other
displayName: Other tests
testFilter: 'TestCategory!=GitHub&TestCategory!=AzDO'
24 changes: 12 additions & 12 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,29 +91,29 @@
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="8.0.0-beta.24508.1">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="8.0.0-beta.24516.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>e5b13e054339e41d422212a0ecaf24fec20cb5a1</Sha>
<Sha>f7fb1fec01b91be69e4dcc5290a0bff3f28e214f</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.SignTool" Version="8.0.0-beta.24508.1">
<Dependency Name="Microsoft.DotNet.SignTool" Version="8.0.0-beta.24516.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>e5b13e054339e41d422212a0ecaf24fec20cb5a1</Sha>
<Sha>f7fb1fec01b91be69e4dcc5290a0bff3f28e214f</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="8.0.0-beta.24508.1">
<Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="8.0.0-beta.24516.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>e5b13e054339e41d422212a0ecaf24fec20cb5a1</Sha>
<Sha>f7fb1fec01b91be69e4dcc5290a0bff3f28e214f</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.SwaggerGenerator.MSBuild" Version="8.0.0-beta.24508.1">
<Dependency Name="Microsoft.DotNet.SwaggerGenerator.MSBuild" Version="8.0.0-beta.24516.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>e5b13e054339e41d422212a0ecaf24fec20cb5a1</Sha>
<Sha>f7fb1fec01b91be69e4dcc5290a0bff3f28e214f</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Git.IssueManager" Version="8.0.0-beta.24508.1">
<Dependency Name="Microsoft.DotNet.Git.IssueManager" Version="8.0.0-beta.24516.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>e5b13e054339e41d422212a0ecaf24fec20cb5a1</Sha>
<Sha>f7fb1fec01b91be69e4dcc5290a0bff3f28e214f</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.VersionTools" Version="8.0.0-beta.24508.1">
<Dependency Name="Microsoft.DotNet.VersionTools" Version="8.0.0-beta.24516.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>e5b13e054339e41d422212a0ecaf24fec20cb5a1</Sha>
<Sha>f7fb1fec01b91be69e4dcc5290a0bff3f28e214f</Sha>
</Dependency>
<Dependency Name="Microsoft.DncEng.SecretManager" Version="1.1.0-beta.24474.1">
<Uri>https://github.com/dotnet/dnceng</Uri>
Expand Down
Loading

0 comments on commit 4bb6117

Please sign in to comment.