Skip to content

Commit fd3430c

Browse files
docs: update contributing with validating downstream gen.
1 parent 97ba887 commit fd3430c

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

packages/http-client-csharp/CONTRIBUTING.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Welcome! This guide will help you set up your development environment and contri
99
- [Development Workflow](#development-workflow)
1010
- [Testing](#testing)
1111
- [Code Generation](#code-generation)
12+
- [Validating Changes Against the Azure Generator](#validating-changes-against-the-azure-generator)
1213
- [Creating Pull Requests](#creating-pull-requests)
1314
- [Getting Help](#getting-help)
1415
- [Code of Conduct](#code-of-conduct)
@@ -182,6 +183,66 @@ To regenerate test projects after making changes:
182183
./eng/scripts/Generate.ps1
183184
```
184185

186+
## Validating Changes Against the Azure Generator
187+
188+
When making changes to the TypeSpec HTTP Client C# package, it's important to validate that your changes work correctly with the Azure generator that depends on this package. Follow these steps to test your changes:
189+
190+
### 1. Create a Fork of azure-sdk-for-net
191+
192+
Create a fork of the [azure-sdk-for-net repository](https://github.com/Azure/azure-sdk-for-net):
193+
194+
1. Navigate to https://github.com/Azure/azure-sdk-for-net
195+
2. Click the "Fork" button to create your own fork
196+
3. Clone your fork locally:
197+
198+
```bash
199+
git clone https://github.com/YOUR_USERNAME/azure-sdk-for-net.git
200+
cd azure-sdk-for-net
201+
```
202+
203+
### 2. Publish Generator Dev Artifacts
204+
205+
Run the generator publish pipeline to create dev artifacts from your changes:
206+
207+
1. Navigate to the [Generator Publish Pipeline](https://dev.azure.com/azure-sdk/internal/_build?definitionId=6871)
208+
2. Click "Run pipeline"
209+
3. In the source branch field, provide your PR reference in the format `refs/pull/123/merge` (replace `123` with your actual PR number)
210+
4. Run the pipeline - this will publish the generator dev artifacts to the dotnet dev nuget feed
211+
212+
### 3. Update Package Versions in Azure Generator
213+
214+
In your azure-sdk-for-net fork, update the generator package versions to use your dev artifacts:
215+
216+
1. Navigate to the azure generator directory in your fork
217+
2. Run the BumpMTG script with your PR ID:
218+
219+
```powershell
220+
.\eng\scripts\BumpMTG.ps1 -PrId 123
221+
```
222+
223+
Replace `123` with the PR ID you used in step 2.
224+
225+
This script will update the NuGet package versions of the generator to point to your dev artifacts.
226+
227+
### 4. Build the Azure Generator
228+
229+
Build the azure generator with your updated dependencies:
230+
231+
```bash
232+
npm ci && npm run clean && npm run build
233+
```
234+
235+
### 5. Validate Your Changes
236+
237+
Now you can validate your changes by:
238+
239+
- **Running tests**: Execute the test suite to ensure no regressions
240+
- **Regenerating test libraries**: Use the generator to regenerate existing test libraries and verify the output
241+
- **Testing new features**: If you added new functionality, test it with relevant TypeSpec definitions
242+
- **Checking integration**: Ensure the integration between your changes and the Azure generator works as expected
243+
244+
This validation process helps ensure that your changes to the TypeSpec HTTP Client C# package are compatible with the downstream Azure generator. If breaking changes are expected, you can prepare the required changes to the Azure Generator ahead of time to reduce the time it will take to fix and upgrade the Azure Generator once your changes merge and are consumed by the Azure Generator.
245+
185246
## Creating Pull Requests
186247

187248
### 1. Prepare Your PR

0 commit comments

Comments
 (0)