Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 25, 2025

The Submit-AzureSdkForNetPr.ps1 script was performing a full clone of azure-sdk-for-net (several GB), causing the pipeline to run out of disk space and timeout.

Changes

  • Replace full git clone with sparse checkout using cone mode
  • Fetch only the eng/ directory (contains Packages.Data.props and packages/http-client-csharp/)
  • Use shallow fetch (--depth 1) to minimize history
# Before: Full clone (~several GB)
git clone "https://github.com/$RepoOwner/$RepoName.git" $tempDir

# After: Sparse checkout (~185MB)
git init $tempDir
git remote add origin "https://github.com/$RepoOwner/$RepoName.git"
git sparse-checkout init --cone
git sparse-checkout set eng/packages/http-client-csharp eng
git fetch --depth 1 origin $BaseBranch
git checkout $BaseBranch
Original prompt

This section details on the original issue you should resolve

<issue_title>Update .NET PR failing</issue_title>
<issue_description>For the last several runs, the update .NET PR script has timed out:
##[error]System.IO.IOException: No space left on device : '/usr/local/vss-agent/4.264.2/_diag/Worker_20251123-215819-utc.log'
at System.IO.RandomAccess.WriteAtOffset(SafeFileHandle handle, ReadOnlySpan`1 buffer, Int64 fileOffset)
at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
at System.Diagnostics.TextWriterTraceListener.Flush()
at Microsoft.VisualStudio.Services.Agent.HostTraceListener.WriteHeader(String source, TraceEventType eventType, Int32 id) in /mnt/vss/_work/1/s/src/Microsoft.VisualStudio.Services.Agent/HostTraceListener.cs:line 131
at System.Diagnostics.TraceSource.TraceEvent(TraceEventType eventType, Int32 id, String message)
at Microsoft.VisualStudio.Services.Agent.Worker.Worker.RunAsync(String pipeIn, String pipeOut) in /mnt/vss/_work/1/s/src/Agent.Worker/Worker.cs:line 102
at Microsoft.VisualStudio.Services.Agent.Worker.Program.MainAsync(IHostContext context, String[] args) in /mnt/vss/_work/1/s/src/Agent.Worker/Program.cs:line 54
System.IO.IOException: No
,##[error]The job running on agent azsdk-pool 1 ran longer than the maximum time of 60 minutes. For more information, see https://go.microsoft.com/fwlink/?linkid=2077134
,##[warning]Agent azsdk-pool 1 did not respond to a cancelation request with 00:05:00.
Pool: azsdk-pool
Agent: azsdk-pool 1
Started: Yesterday at 1:58 PM
Duration: 1h 4m 59s

Job preparation parameters
Parent pipeline used these runtime parameters

https://github.com/microsoft/typespec/blob/main/packages/http-client-csharp/eng/pipeline/publish.yml#L126

When seeing the initial run it said the device was low on disk space. We may need to do a sparse checkout instead.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Fix .NET PR script timeout issue due to low disk space Fix disk space issue in .NET PR creation by implementing sparse checkout Nov 25, 2025
Copilot AI requested a review from JoshLove-msft November 25, 2025 03:26
Copilot finished work on behalf of JoshLove-msft November 25, 2025 03:26
@JoshLove-msft JoshLove-msft marked this pull request as ready for review November 25, 2025 03:26
@JoshLove-msft JoshLove-msft added this pull request to the merge queue Nov 25, 2025
Merged via the queue into main with commit 89884a7 Nov 25, 2025
22 checks passed
@JoshLove-msft JoshLove-msft deleted the copilot/fix-dotnet-pr-timeout branch November 25, 2025 16:38
@microsoft-github-policy-service microsoft-github-policy-service bot added the emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp label Nov 25, 2025
github-merge-queue bot pushed a commit that referenced this pull request Nov 25, 2025
PR #9082 switched to sparse checkout but omitted
`sdk/core/Azure.Core/src/Shared`, causing build failures when Azure test
projects reference shared source files like `TrimmingAttribute.cs`,
`RawRequestUriBuilder.cs`, etc.

### Changes
- Added `sdk/core/Azure.Core/src/Shared` to sparse checkout pattern in
`Submit-AzureSdkForNetPr.ps1`

```powershell
git sparse-checkout set eng/packages/http-client-csharp eng sdk/core/Azure.Core/src/Shared
```

<!-- START COPILOT CODING AGENT SUFFIX -->



<details>

<summary>Original prompt</summary>

> 
> ----
> 
> *This section details on the original issue you should resolve*
> 
> <issue_title>Build is now failing in the Update PR</issue_title>
> <issue_description>#9082
updated to use sparse checkout but we are missing the Azure.Core shared
source files:
> 
> CSC : error CS2001: Source file
'/tmp/azure-sdk-for-net-20251125-171710/eng//../sdk/core/Azure.Core/src/Shared/TrimmingAttribute.cs'
could not be found.
[/tmp/azure-sdk-for-net-20251125-171710/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/example/basic/src/_Specs_.Azure.Example.Basic.csproj::TargetFramework=net8.0]
> CSC : error CS2001: Source file
'/tmp/azure-sdk-for-net-20251125-171710/eng//../sdk/core/Azure.Core/src/Shared/RawRequestUriBuilder.cs'
could not be found.
[/tmp/azure-sdk-for-net-20251125-171710/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/api-version/header/src/_Specs_.Azure.ClientGenerator.Core.ApiVersion.Header.csproj::TargetFramework=net8.0]
> CSC : error CS2001: Source file
'/tmp/azure-sdk-for-net-20251125-171710/eng//../sdk/core/Azure.Core/src/Shared/TypeFormatters.cs'
could not be found.
[/tmp/azure-sdk-for-net-20251125-171710/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/api-version/header/src/_Specs_.Azure.ClientGenerator.Core.ApiVersion.Header.csproj::TargetFramework=net8.0]
> CSC : error CS2001: Source file
'/tmp/azure-sdk-for-net-20251125-171710/eng//../sdk/core/Azure.Core/src/Shared/RequestHeaderExtensions.cs'
could not be found.
[/tmp/azure-sdk-for-net-20251125-171710/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/api-version/header/src/_Specs_.Azure.ClientGenerator.Core.ApiVersion.Header.csproj::TargetFramework=net8.0]
> CSC : error CS2001: Source file
'/tmp/azure-sdk-for-net-20251125-171710/eng//../sdk/core/Azure.Core/src/Shared/AppContextSwitchHelper.cs'
could not be found.
[/tmp/azure-sdk-for-net-20251125-171710/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/api-version/header/src/_Specs_.Azure.ClientGenerator.Core.ApiVersion.Header.csproj::TargetFramework=net8.0]
> CSC : error CS2001: Source file
'/tmp/azure-sdk-for-net-20251125-171710/eng//../sdk/core/Azure.Core/src/Shared/ClientDiagnostics.cs'
could not be found.
[/tmp/azure-sdk-for-net-20251125-171710/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/api-version/header/src/_Specs_.Azure.ClientGenerator.Core.ApiVersion.Header.csproj::TargetFramework=net8.0]
> CSC : error CS2001: Source file
'/tmp/azure-sdk-for-net-20251125-171710/eng//../sdk/core/Azure.Core/src/Shared/DiagnosticScopeFactory.cs'
could not be found.
[/tmp/azure-sdk-for-net-20251125-171710/eng/packages/http-client-csharp/generator/TestProjects/Spector/http/azure/client-generator-core/api-version/header/src/_Specs_.Azure.ClientGenerator.Core.ApiVersion.Header.csproj::TargetFramework=net8.0]
> CSC : error CS2001: Source file
'/tmp/azure-sdk-for-net-20251125-171710/eng//../sdk/core/Azure.Core/src/Shared/DiagnosticScope.cs'
could not be found. [/tmp/azure-</issue_description>
> 
> ## Comments on the Issue (you are @copilot in this section)
> 
> <comments>
> </comments>
> 


</details>

- Fixes #9091

<!-- START COPILOT CODING AGENT TIPS -->
---

✨ Let Copilot coding agent [set things up for
you](https://github.com/microsoft/typespec/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: JoshLove-msft <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update .NET PR failing

4 participants