Skip to content

Commit 80c29fe

Browse files
authored
Merge branch 'Azure:main' into main
2 parents 8f9ea9d + a2c2951 commit 80c29fe

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

+6130
-2709
lines changed

.devcontainer/devcontainer.json

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,32 @@
11
{
2-
"name": "API Ops",
3-
"image": "mcr.microsoft.com/devcontainers/dotnet:0-7.0",
2+
"name": "C# (.NET)",
3+
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
44
"features": {
5-
"ghcr.io/devcontainers/features/azure-cli:1": {}
5+
"ghcr.io/devcontainers/features/dotnet:2": {
6+
"version": "8.0",
7+
"additionalVersions": "9.0",
8+
"workloads": "aspire"
9+
},
10+
"ghcr.io/devcontainers/features/azure-cli:1": {
11+
"version": "latest",
12+
"installBicep": true
13+
},
14+
"ghcr.io/devcontainers/features/powershell:1": {
15+
"version": "latest"
16+
},
17+
"ghcr.io/devcontainers/features/git:1": {}
618
},
7-
8-
// Use 'forwardPorts' to make a list of ports inside the container available locally.
9-
// "forwardPorts": [5000, 5001],
10-
// "portsAttributes": {
11-
// "5001": {
12-
// "protocol": "https"
13-
// }
14-
// }
15-
16-
"postCreateCommand": "dotnet restore /workspaces/apiops/tools/code/code.sln",
17-
19+
"postCreateCommand": "./.devcontainer/postCreateCommand.sh",
1820
"customizations": {
1921
"vscode": {
2022
"extensions": [
21-
"ms-dotnettools.csharp"
23+
"ms-azuretools.vscode-bicep",
24+
"ms-azure-devops.azure-pipelines",
25+
"ms-dotnettools.csdevkit",
26+
"github.copilot",
27+
"github.copilot-chat",
28+
"timonwong.shellcheck"
2229
]
2330
}
2431
}
25-
}
32+
}

.devcontainer/postCreateCommand.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
# Install Aspire
4+
sudo /usr/share/dotnet/dotnet workload update --from-rollback-file "./.devcontainer/rollback.txt"
5+
sudo /usr/share/dotnet/dotnet workload install aspire --from-rollback-file "./.devcontainer/rollback.txt"
6+
7+
# Install PowerShell modules
8+
pwsh -Command "Install-Module -Name Az -Force
9+
Install-Module -Name Microsoft.Graph -Force"

.github/workflows/create_github_release.yaml

Lines changed: 49 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -32,28 +32,29 @@ jobs:
3232
$VerbosePreference = "Continue"
3333
$InformationPreference = "Continue"
3434
35-
Write-Information "Generating extractor..."
36-
$sourcePath = Join-Path "${{ github.workspace }}" "tools" "code" "extractor" "extractor.csproj"
37-
$outputFolderPath = "${{ runner.temp }}"
35+
Write-Information "Creating output directory..."
36+
$outputFolderPath = Join-Path "${{ runner.temp }}" "extractor-output"
37+
New-Item -Path "$outputFolderPath" -ItemType "Directory"
3838
39+
Write-Information "Publishing application..."
40+
$sourcePath = Join-Path "${{ github.workspace }}" "tools" "code" "extractor" "extractor.csproj"
3941
& dotnet publish "$sourcePath" --self-contained --runtime "${{ matrix.dotnet-runtime }}" -p:PublishSingleFile=true --output "$outputFolderPath"
4042
if ($LASTEXITCODE -ne 0) { throw "Generating extractor failed."}
4143
42-
$exeFileExt = "${{ matrix.dotnet-runtime }}".Contains("win") ? ".exe" : ""
43-
$exeFolderPath = Join-Path "$outputFolderPath" "extractor$exeFileExt"
44-
$exeFileNameFinal = "${{ format('extractor.{0}', matrix.dotnet-runtime) }}$exeFileExt"
45-
Rename-Item -Path "$exeFolderPath" -NewName $exeFileNameFinal
46-
echo "EXTRACTOR_FILENAME=$exeFileNameFinal" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
44+
Write-Information "Zipping application..."
45+
$sourceFolderPath = Join-Path "$outputFolderPath" "*"
46+
$destinationFilePath = Join-Path "$outputFolderPath" "extractor-${{ matrix.dotnet-runtime }}.zip"
47+
Compress-Archive -Path $sourceFolderPath -DestinationPath $destinationFilePath -CompressionLevel Optimal
48+
"ZIP_FILE_PATH=$destinationFilePath" | Out-File -FilePath $env:GITHUB_ENV -Append
4749
4850
Write-Information "Execution complete."
4951
shell: pwsh
50-
env:
51-
EXTRACTOR_FILENAME:
5252

5353
- name: Upload artifact
54-
uses: actions/upload-artifact@v3
54+
uses: actions/upload-artifact@v4
5555
with:
56-
path: ${{ format('{0}/{1}', runner.temp, env.EXTRACTOR_FILENAME) }}
56+
name: extractor-${{ matrix.dotnet-runtime }}
57+
path: ${{ env.ZIP_FILE_PATH }}
5758

5859
generate_publisher_artifacts:
5960
name: Generate publisher artifacts
@@ -78,28 +79,29 @@ jobs:
7879
$VerbosePreference = "Continue"
7980
$InformationPreference = "Continue"
8081
81-
Write-Information "Generating publisher..."
82-
$sourcePath = Join-Path "${{ github.workspace }}" "tools" "code" "publisher" "publisher.csproj"
83-
$outputFolderPath = "${{ runner.temp }}"
82+
Write-Information "Creating output directory..."
83+
$outputFolderPath = Join-Path "${{ runner.temp }}" "publisher-output"
84+
New-Item -Path "$outputFolderPath" -ItemType "Directory"
8485
86+
Write-Information "Publishing application..."
87+
$sourcePath = Join-Path "${{ github.workspace }}" "tools" "code" "publisher" "publisher.csproj"
8588
& dotnet publish "$sourcePath" --self-contained --runtime "${{ matrix.dotnet-runtime }}" -p:PublishSingleFile=true --output "$outputFolderPath"
8689
if ($LASTEXITCODE -ne 0) { throw "Generating publisher failed."}
8790
88-
$exeFileExt = "${{ matrix.dotnet-runtime }}".Contains("win") ? ".exe" : ""
89-
$exeFolderPath = Join-Path "$outputFolderPath" "publisher$exeFileExt"
90-
$exeFileNameFinal = "${{ format('publisher.{0}', matrix.dotnet-runtime) }}$exeFileExt"
91-
Rename-Item -Path "$exeFolderPath" -NewName $exeFileNameFinal
92-
echo "PUBLISHER_FILENAME=$exeFileNameFinal" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
91+
Write-Information "Zipping application..."
92+
$sourceFolderPath = Join-Path "$outputFolderPath" "*"
93+
$destinationFilePath = Join-Path "$outputFolderPath" "publisher-${{ matrix.dotnet-runtime }}.zip"
94+
Compress-Archive -Path $sourceFolderPath -DestinationPath $destinationFilePath -CompressionLevel Optimal
95+
"ZIP_FILE_PATH=$destinationFilePath" | Out-File -FilePath $env:GITHUB_ENV -Append
9396
9497
Write-Information "Execution complete."
9598
shell: pwsh
96-
env:
97-
PUBLISHER_FILENAME:
9899

99100
- name: Upload artifact
100-
uses: actions/upload-artifact@v3
101+
uses: actions/upload-artifact@v4
101102
with:
102-
path: ${{ format('{0}/{1}', runner.temp, env.PUBLISHER_FILENAME) }}
103+
name: publisher-${{ matrix.dotnet-runtime }}
104+
path: ${{ env.ZIP_FILE_PATH }}
103105

104106
generate_github_pipeline_artifacts:
105107
name: Generate GitHub artifacts
@@ -153,8 +155,9 @@ jobs:
153155
shell: pwsh
154156

155157
- name: Upload artifact
156-
uses: actions/upload-artifact@v3
158+
uses: actions/upload-artifact@v4
157159
with:
160+
name: github
158161
path: ${{ runner.temp }}/Github.zip
159162

160163
generate_ado_pipeline_artifacts:
@@ -209,8 +212,9 @@ jobs:
209212
shell: pwsh
210213

211214
- name: Upload artifact
212-
uses: actions/upload-artifact@v3
215+
uses: actions/upload-artifact@v4
213216
with:
217+
name: ado
214218
path: ${{ runner.temp }}/Azure_DevOps.zip
215219

216220
generate_release:
@@ -227,27 +231,29 @@ jobs:
227231
contents: write
228232
steps:
229233
- name: Download artifacts
230-
uses: actions/download-artifact@v3
234+
uses: actions/download-artifact@v4
231235
- name: Create release
232236
uses: softprops/action-gh-release@v1
233237
with:
234238
files: |
235-
${{github.workspace}}/artifact/extractor.win-x64.exe
236-
${{github.workspace}}/artifact/extractor.linux-x64
237-
${{github.workspace}}/artifact/extractor.linux-arm64
238-
${{github.workspace}}/artifact/extractor.linux-musl-x64
239-
${{github.workspace}}/artifact/extractor.linux-musl-arm64
240-
${{github.workspace}}/artifact/extractor.osx-arm64
241-
${{github.workspace}}/artifact/extractor.osx-x64
242-
${{github.workspace}}/artifact/publisher.win-x64.exe
243-
${{github.workspace}}/artifact/publisher.linux-x64
244-
${{github.workspace}}/artifact/publisher.linux-arm64
245-
${{github.workspace}}/artifact/publisher.linux-musl-x64
246-
${{github.workspace}}/artifact/publisher.linux-musl-arm64
247-
${{github.workspace}}/artifact/publisher.osx-arm64
248-
${{github.workspace}}/artifact/publisher.osx-x64
249-
${{github.workspace}}/artifact/Github.zip
250-
${{github.workspace}}/artifact/Azure_DevOps.zip
239+
${{github.workspace}}/extractor-linux-arm64/extractor-linux-arm64.zip
240+
${{github.workspace}}/extractor-linux-musl-arm64/extractor-linux-musl-arm64.zip
241+
${{github.workspace}}/extractor-linux-musl-x64/extractor-linux-musl-x64.zip
242+
${{github.workspace}}/extractor-linux-x64/extractor-linux-x64.zip
243+
${{github.workspace}}/extractor-osx-arm64/extractor-osx-arm64.zip
244+
${{github.workspace}}/extractor-osx-x64/extractor-osx-x64.zip
245+
${{github.workspace}}/extractor.osx-x64/extractor.osx-x64.zip
246+
${{github.workspace}}/extractor-win-x64/extractor-win-x64.zip
247+
${{github.workspace}}/publisher-linux-arm64/publisher-linux-arm64.zip
248+
${{github.workspace}}/publisher-linux-musl-arm64/publisher-linux-musl-arm64.zip
249+
${{github.workspace}}/publisher-linux-musl-x64/publisher-linux-musl-x64.zip
250+
${{github.workspace}}/publisher-linux-x64/publisher-linux-x64.zip
251+
${{github.workspace}}/publisher-osx-arm64/publisher-osx-arm64.zip
252+
${{github.workspace}}/publisher-osx-x64/publisher-osx-x64.zip
253+
${{github.workspace}}/publisher.osx-x64/publisher.osx-x64.zip
254+
${{github.workspace}}/publisher-win-x64/publisher-win-x64.zip
255+
${{github.workspace}}/github/Github.zip
256+
${{github.workspace}}/ado/Azure_DevOps.zip
251257
name: APIOps Toolkit for Azure APIM ${{ github.event.inputs.Release_Version }}
252258
tag_name: ${{ github.event.inputs.Release_Version }}
253259
generate_release_notes: true

docs/Gemfile.lock

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,17 +223,17 @@ GEM
223223
rb-fsevent (~> 0.10, >= 0.10.3)
224224
rb-inotify (~> 0.9, >= 0.9.10)
225225
mercenary (0.3.6)
226-
mini_portile2 (2.8.5)
226+
mini_portile2 (2.8.6)
227227
minima (2.5.1)
228228
jekyll (>= 3.5, < 5.0)
229229
jekyll-feed (~> 0.9)
230230
jekyll-seo-tag (~> 2.1)
231231
minitest (5.17.0)
232232
multipart-post (2.1.1)
233-
nokogiri (1.16.2)
233+
nokogiri (1.16.5)
234234
mini_portile2 (~> 2.8.2)
235235
racc (~> 1.4)
236-
nokogiri (1.16.2-x86_64-linux)
236+
nokogiri (1.16.5-x86_64-linux)
237237
racc (~> 1.4)
238238
octokit (4.21.0)
239239
faraday (>= 0.9)
@@ -246,7 +246,8 @@ GEM
246246
rb-fsevent (0.11.0)
247247
rb-inotify (0.10.1)
248248
ffi (~> 1.0)
249-
rexml (3.2.5)
249+
rexml (3.2.8)
250+
strscan (>= 3.0.9)
250251
rouge (3.26.0)
251252
ruby-enum (0.9.0)
252253
i18n
@@ -263,6 +264,7 @@ GEM
263264
faraday (> 0.8, < 2.0)
264265
simpleidn (0.2.1)
265266
unf (~> 0.1.4)
267+
strscan (3.1.0)
266268
terminal-table (1.8.0)
267269
unicode-display_width (~> 1.1, >= 1.1.1)
268270
thread_safe (0.3.6)

tools/azdo_pipelines/run-extractor.yaml

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -91,33 +91,39 @@ stages:
9191
$VerbosePreference = "Continue"
9292
$InformationPreference = "Continue"
9393
94-
Write-Information "Downloading extractor..."
95-
$extractorFileName = "extractor.linux-x64"
96-
$extractorFinalFileName = "extractor"
97-
94+
Write-Information "Setting name variables..."
95+
$releaseFileName = "extractor-linux-x64.zip"
96+
$executableFileName = "extractor"
97+
9898
if ("$(Agent.OS)" -like "*win*") {
99-
$extractorFileName = "extractor.win-x64.exe"
100-
$extractorFinalFileName = "extractor.exe"
99+
$releaseFileName = "extractor-win-x64.zip"
100+
$executableFileName = "extractor.exe"
101101
}
102102
elseif ("$(Agent.OS)" -like "*mac*" -and "$(Agent.OSArchitecture)" -like "*arm*") {
103-
$extractorFileName = "extractor.osx-arm64"
103+
$releaseFileName = "extractor-osx-arm64.zip"
104104
}
105105
elseif ("$(Agent.OS)" -like "*mac*" -and "$(Agent.OSArchitecture)" -like "*x86_64*") {
106-
$extractorFileName = "extractor.osx-x64"
106+
$releaseFileName = "extractor-osx-x64.zip"
107107
}
108-
109-
$uri = "https://github.com/Azure/apiops/releases/download/$(apiops_release_version)/$extractorFileName"
110-
$destinationFilePath = Join-Path "$(Agent.TempDirectory)" $extractorFinalFileName
111-
Invoke-WebRequest -Uri "$uri" -OutFile "$destinationFilePath"
112108
109+
Write-Information "Downloading release..."
110+
$uri = "https://github.com/Azure/apiops/releases/download/$(apiops_release_version)/$releaseFileName"
111+
$downloadFilePath = Join-Path "$(Agent.TempDirectory)" $releaseFileName
112+
Invoke-WebRequest -Uri "$uri" -OutFile "$downloadFilePath"
113+
114+
Write-Information "Extracting release..."
115+
$executableFolderPath = Join-Path "$(Agent.TempDirectory)" "extractor"
116+
Expand-Archive -Path "$downloadFilePath" -DestinationPath "$executableFolderPath"
117+
$executableFilePath = Join-Path "$executableFolderPath" $executableFileName
118+
119+
Write-Information "Setting file permissions..."
113120
if ("$(Agent.OS)" -like "*linux*")
114121
{
115-
Write-Information "Setting file permissions..."
116-
& chmod +x "$destinationFilePath"
122+
& chmod +x "$executableFilePath"
117123
if ($LASTEXITCODE -ne 0) { throw "Setting file permissions failed."}
118124
}
119125
120-
Write-Host "##vso[task.setvariable variable=EXTRACTOR_FILE_PATH]$destinationFilePath"
126+
Write-Host "##vso[task.setvariable variable=EXTRACTOR_FILE_PATH]$executableFilePath"
121127
Write-Information "Execution complete."
122128
failOnStderr: true
123129
pwsh: true

tools/azdo_pipelines/run-publisher-with-env.yaml

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -87,32 +87,39 @@ steps:
8787
$VerbosePreference = "Continue"
8888
$InformationPreference = "Continue"
8989
90-
Write-Information "Downloading publisher..."
91-
$publisherFileName = "publisher.linux-x64"
92-
$publisherFinalFileName = "publisher"
90+
Write-Information "Setting name variables..."
91+
$releaseFileName = "publisher-linux-x64.zip"
92+
$executableFileName = "publisher"
93+
9394
if ("$(Agent.OS)" -like "*win*") {
94-
$publisherFileName = "publisher.win-x64.exe"
95-
$publisherFinalFileName = "publisher.exe"
95+
$releaseFileName = "publisher-win-x64.zip"
96+
$executableFileName = "publisher.exe"
9697
}
9798
elseif ("$(Agent.OS)" -like "*mac*" -and "$(Agent.OSArchitecture)" -like "*arm*") {
98-
$publisherFileName = "publisher.osx-arm64"
99+
$releaseFileName = "publisher-osx-arm64.zip"
99100
}
100101
elseif ("$(Agent.OS)" -like "*mac*" -and "$(Agent.OSArchitecture)" -like "*x86_64*") {
101-
$publisherFileName = "publisher.osx-x64"
102+
$releaseFileName = "publisher-osx-x64.zip"
102103
}
103-
104-
$uri = "https://github.com/Azure/apiops/releases/download/$(apiops_release_version)/$publisherFileName"
105-
$destinationFilePath = Join-Path "$(Agent.TempDirectory)" $publisherFinalFileName
106-
Invoke-WebRequest -Uri "$uri" -OutFile "$destinationFilePath"
107104
105+
Write-Information "Downloading release..."
106+
$uri = "https://github.com/Azure/apiops/releases/download/$(apiops_release_version)/$releaseFileName"
107+
$downloadFilePath = Join-Path "$(Agent.TempDirectory)" $releaseFileName
108+
Invoke-WebRequest -Uri "$uri" -OutFile "$downloadFilePath"
109+
110+
Write-Information "Extracting release..."
111+
$executableFolderPath = Join-Path "$(Agent.TempDirectory)" "publisher"
112+
Expand-Archive -Path "$downloadFilePath" -DestinationPath "$executableFolderPath"
113+
$executableFilePath = Join-Path "$executableFolderPath" $executableFileName
114+
115+
Write-Information "Setting file permissions..."
108116
if ("$(Agent.OS)" -like "*linux*")
109117
{
110-
Write-Information "Setting file permissions..."
111-
& chmod +x "$destinationFilePath"
118+
& chmod +x "$executableFilePath"
112119
if ($LASTEXITCODE -ne 0) { throw "Setting file permissions failed."}
113120
}
114121
115-
Write-Host "##vso[task.setvariable variable=PUBLISHER_FILE_PATH]$destinationFilePath"
122+
Write-Host "##vso[task.setvariable variable=PUBLISHER_FILE_PATH]$executableFilePath"
116123
Write-Information "Execution complete."
117124
failOnStderr: true
118125
pwsh: true

tools/code/aspire/Program.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using Aspire.Hosting;
2+
using Projects;
3+
4+
internal static class Program
5+
{
6+
private static void Main(string[] args)
7+
{
8+
var builder = DistributedApplication.CreateBuilder(args);
9+
10+
builder.AddProject<integration_tests>("integration-tests");
11+
//.WithEnvironment("CSCHECK_SEED", "0000KOIPe036");
12+
13+
builder.Build().Run();
14+
}
15+
}

0 commit comments

Comments
 (0)