Commit 89884a7
Fix disk space issue in .NET PR creation by implementing sparse checkout (#9082)
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
```powershell
# 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
```
<!-- START COPILOT CODING AGENT SUFFIX -->
<details>
<summary>Original prompt</summary>
>
> ----
>
> *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](https://dev.azure.com/azure-sdk/590cfd2a-581c-4dcb-a12e-6568ce786175/_settings/agentqueues?poolId=&queueId=532)
> 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)
>
> <comments>
> </comments>
>
</details>
- Fixes #9081
<!-- 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]>1 parent 96d38f6 commit 89884a7
File tree
1 file changed
+39
-5
lines changed- packages/http-client-csharp/eng/scripts
1 file changed
+39
-5
lines changedLines changed: 39 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
74 | | - | |
75 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
76 | 79 | | |
77 | | - | |
| 80 | + | |
78 | 81 | | |
79 | | - | |
| 82 | + | |
80 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
81 | 115 | | |
82 | 116 | | |
83 | 117 | | |
| |||
0 commit comments