Skip to content

Commit 85ee6d2

Browse files
authored
Merge branch 'main' into issue-7571-file-access-read-lines
2 parents 448a921 + baf0ea5 commit 85ee6d2

359 files changed

Lines changed: 27533 additions & 9657 deletions

File tree

Some content is hidden

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

‎.github/CODEOWNERS‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,20 @@
5050

5151
# Python packages
5252
/python/packages/a2a/ @chetantoshniwal @giles17 @eavanvalkenburg @moonbox3
53-
/python/packages/ag-ui/ @chetantoshniwal @moonbox3 @giles17
53+
/python/packages/ag-ui/ @chetantoshniwal @eavanvalkenburg @moonbox3 @giles17
5454
/python/packages/anthropic/ @chetantoshniwal @eavanvalkenburg @giles17 @moonbox3
5555
/python/packages/azure-ai-search/ @chetantoshniwal @eavanvalkenburg @giles17
5656
/python/packages/azure-contentunderstanding/ @chetantoshniwal @giles17 @eavanvalkenburg
5757
/python/packages/azure-cosmos/ @chetantoshniwal @eavanvalkenburg @giles17 @moonbox3
5858
/python/packages/azure-cosmos-memory/ @chetantoshniwal @eavanvalkenburg @giles17 @moonbox3
5959
/python/packages/bedrock/ @chetantoshniwal @eavanvalkenburg @giles17 @moonbox3
60-
/python/packages/chatkit/ @chetantoshniwal @moonbox3 @giles17
60+
/python/packages/chatkit/ @chetantoshniwal @eavanvalkenburg @moonbox3 @giles17
6161
/python/packages/claude/ @chetantoshniwal @eavanvalkenburg @giles17 @moonbox3
6262
/python/packages/copilotstudio/ @chetantoshniwal @eavanvalkenburg @giles17 @moonbox3
6363
/python/packages/core/ @chetantoshniwal @eavanvalkenburg @moonbox3 @TaoChenOSU @giles17
64-
/python/packages/core/agent_framework/_workflows/ @chetantoshniwal @moonbox3 @TaoChenOSU
64+
/python/packages/core/agent_framework/_workflows/ @chetantoshniwal @eavanvalkenburg @moonbox3 @TaoChenOSU
6565
/python/packages/core/agent_framework/_harness/ @chetantoshniwal @westey-m @eavanvalkenburg @moonbox3
66-
/python/packages/declarative/ @chetantoshniwal @moonbox3 @peibekwe
66+
/python/packages/declarative/ @chetantoshniwal @eavanvalkenburg @moonbox3 @peibekwe
6767
/python/packages/devui/ @chetantoshniwal @eavanvalkenburg @moonbox3
6868
/python/packages/foundry/ @chetantoshniwal @eavanvalkenburg @TaoChenOSU @moonbox3 @giles17
6969
/python/packages/foundry_hosting/ @chetantoshniwal @TaoChenOSU @eavanvalkenburg @moonbox3
@@ -82,7 +82,7 @@
8282
/python/packages/monty/ @chetantoshniwal @eavanvalkenburg @giles17 @moonbox3
8383
/python/packages/ollama/ @chetantoshniwal @eavanvalkenburg @giles17 @moonbox3
8484
/python/packages/openai/ @chetantoshniwal @eavanvalkenburg @moonbox3 @TaoChenOSU @giles17
85-
/python/packages/orchestrations/ @chetantoshniwal @moonbox3 @TaoChenOSU
85+
/python/packages/orchestrations/ @chetantoshniwal @eavanvalkenburg @moonbox3 @TaoChenOSU
8686
/python/packages/purview/ @chetantoshniwal @eavanvalkenburg @giles17 @moonbox3
8787
/python/packages/redis/ @chetantoshniwal @eavanvalkenburg @giles17 @moonbox3
8888
/python/packages/tools/ @chetantoshniwal @eavanvalkenburg @giles17 @moonbox3

‎.github/dependabot.yml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ updates:
2323
labels:
2424
- ".NET"
2525
- "dependencies"
26+
cooldown:
27+
default-days: 7
2628

2729
# Maintain dependencies for python.
2830
# TODO: Remove these Python Dependabot entries after we have confidence in the
@@ -35,6 +37,9 @@ updates:
3537
labels:
3638
- "python"
3739
- "dependencies"
40+
cooldown:
41+
default-days: 7
42+
3843
- package-ecosystem: "uv"
3944
directory: "python/"
4045
schedule:
@@ -43,6 +48,8 @@ updates:
4348
labels:
4449
- "python"
4550
- "dependencies"
51+
cooldown:
52+
default-days: 7
4653

4754
# Maintain dependencies for github-actions
4855
- package-ecosystem: "github-actions"

‎.github/workflows/dotnet-build-and-test.yml‎

Lines changed: 152 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ concurrency:
2626

2727
permissions:
2828
contents: read
29-
id-token: "write"
3029

3130
jobs:
3231
paths-filter:
@@ -175,6 +174,9 @@ jobs:
175174
dotnet-test:
176175
needs: paths-filter
177176
if: needs.paths-filter.outputs.dotnetChanges == 'true'
177+
permissions:
178+
contents: read
179+
id-token: "write"
178180
strategy:
179181
fail-fast: false
180182
matrix:
@@ -204,10 +206,127 @@ jobs:
204206
if: ${{ runner.os == 'Windows' && (needs.paths-filter.outputs.cosmosDbChanges == 'true' || (github.event_name != 'pull_request' && matrix.integration-tests)) }}
205207
shell: pwsh
206208
run: |
207-
Write-Host "Launching Azure Cosmos DB Emulator"
209+
$ErrorActionPreference = "Stop"
210+
$emulatorPath = "$env:ProgramFiles\Azure Cosmos DB Emulator\Microsoft.Azure.Cosmos.Emulator.exe"
211+
$emulatorKey = "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw=="
212+
$maxRetries = 3
213+
$timeout = 600 # 10 minutes instead of default 4 minutes
214+
$retryCount = 0
215+
$started = $false
216+
217+
Write-Host "======================================" -ForegroundColor Cyan
218+
Write-Host "Starting Azure Cosmos DB Emulator" -ForegroundColor Cyan
219+
Write-Host "Timeout: $timeout seconds, Max retries: $maxRetries" -ForegroundColor Cyan
220+
Write-Host "======================================" -ForegroundColor Cyan
221+
208222
Import-Module "$env:ProgramFiles\Azure Cosmos DB Emulator\PSModules\Microsoft.Azure.CosmosDB.Emulator"
209-
Start-CosmosDbEmulator -NoUI -Key "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw=="
210-
echo "COSMOSDB_EMULATOR_AVAILABLE=true" >> $env:GITHUB_ENV
223+
224+
while (-not $started -and $retryCount -lt $maxRetries) {
225+
$retryCount++
226+
227+
if ($retryCount -gt 1) {
228+
Write-Host "`n--- Retry attempt $retryCount of $maxRetries ---" -ForegroundColor Yellow
229+
230+
# Stop and cleanup before retry
231+
Write-Host "Stopping existing emulator instances..." -ForegroundColor Yellow
232+
Stop-CosmosDbEmulator -ErrorAction SilentlyContinue
233+
Start-Sleep -Seconds 5
234+
235+
# Force kill if still running
236+
Get-Process -Name "Microsoft.Azure.Cosmos.Emulator" -ErrorAction SilentlyContinue | Stop-Process -Force
237+
Start-Sleep -Seconds 3
238+
239+
# Cleanup old data
240+
$dataPath = Join-Path $env:LOCALAPPDATA "CosmosDbEmulator"
241+
if (Test-Path $dataPath) {
242+
Write-Host "Cleaning up emulator data..." -ForegroundColor Yellow
243+
Remove-Item -Recurse -Force $dataPath -ErrorAction SilentlyContinue
244+
Start-Sleep -Seconds 2
245+
}
246+
}
247+
248+
try {
249+
Write-Host "`nStarting emulator (attempt $retryCount)..." -ForegroundColor Cyan
250+
Start-CosmosDbEmulator -NoUI -Key $emulatorKey -AllowNetworkAccess -NoFirewall
251+
252+
# Wait for emulator to be ready with extended timeout
253+
$startTime = [DateTimeOffset]::Now
254+
$stopTime = $startTime.AddSeconds($timeout)
255+
$lastStatus = -1
256+
257+
Write-Host "Waiting for emulator to be ready..." -ForegroundColor Yellow
258+
259+
do {
260+
Start-Sleep -Seconds 5
261+
$elapsed = [int](([DateTimeOffset]::Now - $startTime).TotalSeconds)
262+
263+
# Check status
264+
$statusProcess = Start-Process $emulatorPath -ArgumentList "/getstatus" -PassThru -Wait -NoNewWindow -ErrorAction SilentlyContinue
265+
$statusCode = if ($statusProcess) { $statusProcess.ExitCode } else { -1 }
266+
267+
# Log status changes
268+
if ($statusCode -ne $lastStatus) {
269+
$statusMsg = switch ($statusCode) {
270+
1 { "Emulator is starting..." }
271+
2 { "Emulator is running!"; $started = $true }
272+
3 { "Emulator is stopped" }
273+
default { "Unknown status (code: $statusCode)" }
274+
}
275+
Write-Host "[${elapsed}s] $statusMsg" -ForegroundColor $(if ($statusCode -eq 2) { "Green" } else { "Yellow" })
276+
$lastStatus = $statusCode
277+
}
278+
279+
if ($started) { break }
280+
281+
# Check if process crashed
282+
$processRunning = Get-Process -Name "Microsoft.Azure.Cosmos.Emulator" -ErrorAction SilentlyContinue
283+
if (-not $processRunning -and $statusCode -ne 2) {
284+
Write-Warning "Emulator process is not running"
285+
break
286+
}
287+
288+
} while ([DateTimeOffset]::Now -lt $stopTime)
289+
290+
if (-not $started) {
291+
Write-Error "Emulator failed to start within $timeout seconds"
292+
}
293+
}
294+
catch {
295+
Write-Warning "Error on attempt ${retryCount}: $_"
296+
if ($retryCount -ge $maxRetries) { throw }
297+
}
298+
}
299+
300+
if ($started) {
301+
Write-Host "`n======================================" -ForegroundColor Green
302+
Write-Host "Cosmos DB Emulator started successfully!" -ForegroundColor Green
303+
Write-Host "======================================`n" -ForegroundColor Green
304+
305+
# Verify connectivity
306+
try {
307+
$response = Invoke-WebRequest -Uri "https://localhost:8081/" -UseBasicParsing -SkipCertificateCheck -TimeoutSec 10 -ErrorAction Stop
308+
Write-Host "Emulator is responding (Status: $($response.StatusCode))" -ForegroundColor Green
309+
}
310+
catch {
311+
Write-Warning "Emulator may not be fully ready: $_"
312+
}
313+
314+
echo "COSMOSDB_EMULATOR_AVAILABLE=true" >> $env:GITHUB_ENV
315+
}
316+
else {
317+
Write-Host "`n======================================" -ForegroundColor Red
318+
Write-Host "Failed to start emulator after $maxRetries attempts" -ForegroundColor Red
319+
Write-Host "======================================" -ForegroundColor Red
320+
321+
# Show diagnostic info
322+
$logPath = Join-Path $env:LOCALAPPDATA "CosmosDbEmulator\cosmosdb.log"
323+
if (Test-Path $logPath) {
324+
Write-Host "`nLast 30 lines of emulator log:" -ForegroundColor Yellow
325+
Get-Content $logPath -Tail 30
326+
}
327+
328+
throw "Failed to start Cosmos DB Emulator"
329+
}
211330
212331
- name: Start Azurite Blob service
213332
if: ${{ runner.os == 'Linux' && (needs.paths-filter.outputs.azureStorageChanges == 'true' || (github.event_name != 'pull_request' && matrix.integration-tests)) }}
@@ -351,7 +470,7 @@ jobs:
351470
with:
352471
reports: "./TestResults/Coverage/**/*.cobertura.xml"
353472
targetdir: "./TestResults/Reports"
354-
reporttypes: "HtmlInline;JsonSummary"
473+
reporttypes: "HtmlInline;JsonSummary;Cobertura"
355474

356475
- name: Upload coverage report artifact
357476
if: matrix.targetFramework == env.COVERAGE_FRAMEWORK
@@ -373,13 +492,41 @@ jobs:
373492
path: IntegrationTestResults/**/*.junit
374493
if-no-files-found: ignore
375494

495+
dotnet-upload-coverage:
496+
needs: [paths-filter, dotnet-test]
497+
if: needs.paths-filter.outputs.dotnetChanges == 'true' && github.event_name != 'merge_group' && ((github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]') || (github.event_name != 'pull_request' && github.ref_name == github.event.repository.default_branch))
498+
runs-on: ubuntu-latest
499+
permissions:
500+
actions: read
501+
contents: read
502+
code-quality: write
503+
pull-requests: read
504+
steps:
505+
- name: Download coverage report artifact
506+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
507+
with:
508+
name: CoverageReport-ubuntu-latest-${{ env.COVERAGE_FRAMEWORK }}-Release
509+
path: ./TestResults/Reports
510+
- name: Upload coverage report to GitHub
511+
uses: actions/upload-code-coverage@d8e329117199404bba6fc81efe8093dc7c015e34 # v1.4.2
512+
with:
513+
file: ./TestResults/Reports/Cobertura.xml
514+
language: CSharp
515+
label: code-coverage/dotnet
516+
fail-on-error: false
517+
- name: Summarize GitHub coverage report
518+
run: echo ".NET coverage is uploaded to GitHub's integrated coverage report with label \`code-coverage/dotnet\`." >> "$GITHUB_STEP_SUMMARY"
519+
376520
# The Foundry hosted-agent IT is costly (it builds a container, pushes to ACR, and provisions
377521
# live agents on a separate Foundry project). Running it in its own job keeps the overall
378522
# workflow time roughly flat: it executes in parallel to dotnet-build and dotnet-test and is
379523
# gated on paths-filter.outputs.foundryHostingChanges so unrelated edits skip the work.
380524
dotnet-foundry-hosted-it:
381525
needs: paths-filter
382526
if: github.event_name != 'pull_request' && needs.paths-filter.outputs.foundryHostingChanges == 'true'
527+
permissions:
528+
contents: read
529+
id-token: "write"
383530
runs-on: ubuntu-latest
384531
environment: integration
385532
env:
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: Promote Shipped APIs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: false
16+
17+
jobs:
18+
promote-apis:
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
24+
with:
25+
fetch-depth: 0
26+
token: ${{ secrets.GITHUB_TOKEN }}
27+
28+
- name: Configure git
29+
shell: pwsh
30+
run: |
31+
git config user.name "github-actions[bot]"
32+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
33+
34+
- name: Check for existing PR
35+
id: check_pr
36+
shell: pwsh
37+
env:
38+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
run: |
40+
$branch = "${{ github.ref_name }}"
41+
$prBranch = "promote-shipped-apis-$branch"
42+
$prNumber = gh pr list --state open --head $prBranch --base $branch --json number --jq '.[0].number'
43+
44+
if ($prNumber) {
45+
"pr_exists=true" >> $env:GITHUB_OUTPUT
46+
"pr_number=$prNumber" >> $env:GITHUB_OUTPUT
47+
Write-Host "Found existing PR: $prNumber"
48+
} else {
49+
"pr_exists=false" >> $env:GITHUB_OUTPUT
50+
Write-Host "No existing PR found."
51+
}
52+
53+
- name: Checkout existing PR branch
54+
if: steps.check_pr.outputs.pr_exists == 'true'
55+
shell: pwsh
56+
run: |
57+
$branch = "${{ github.ref_name }}"
58+
$prBranch = "promote-shipped-apis-$branch"
59+
60+
git fetch origin $prBranch
61+
git checkout $prBranch
62+
git merge origin/$branch -m "Merge $branch into promote-shipped-apis branch"
63+
64+
- name: Run public API promotion script
65+
shell: pwsh
66+
run: ./dotnet/eng/scripts/promote-shipped-apis.ps1
67+
68+
- name: Check for changes
69+
id: check_changes
70+
shell: pwsh
71+
run: |
72+
$changes = git diff --name-only -- "dotnet/src/**/PublicAPI.*.txt"
73+
if ($changes) {
74+
"has_changes=true" >> $env:GITHUB_OUTPUT
75+
Write-Host "Changed files:"
76+
Write-Host $changes
77+
} else {
78+
"has_changes=false" >> $env:GITHUB_OUTPUT
79+
Write-Host "No public API promotion changes detected."
80+
}
81+
82+
- name: Commit and push changes
83+
if: steps.check_changes.outputs.has_changes == 'true'
84+
shell: pwsh
85+
run: |
86+
$branch = "${{ github.ref_name }}"
87+
$prBranch = "promote-shipped-apis-$branch"
88+
89+
git checkout -B $prBranch
90+
git add dotnet/src/**/PublicAPI.*.txt
91+
git commit -m "chore: promote shipped .NET APIs"
92+
git push --force-with-lease --set-upstream origin $prBranch
93+
94+
- name: Create new PR
95+
if: steps.check_pr.outputs.pr_exists == 'false' && steps.check_changes.outputs.has_changes == 'true'
96+
shell: pwsh
97+
env:
98+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
99+
run: |
100+
$branch = "${{ github.ref_name }}"
101+
$prBranch = "promote-shipped-apis-$branch"
102+
$title = "chore: promote shipped .NET APIs for $branch"
103+
$body = "Automatically promotes entries from PublicAPI.Unshipped.txt to PublicAPI.Shipped.txt for released .NET packages."
104+
105+
gh pr create --title $title --base $branch --head $prBranch --body $body

0 commit comments

Comments
 (0)