From 6faee6f493d18f10bbd34e8d301f499d74584bc9 Mon Sep 17 00:00:00 2001 From: shirelmr Date: Fri, 22 Aug 2025 10:35:13 -0700 Subject: [PATCH 1/9] prompt files for labels and codeowners --- .../typespec-to-sdk.instructions.md | 16 +++- .../validate-codeowners.instructions.md | 74 +++++++++++++++++++ .../validate-service-label.instruction.md | 32 ++++++++ 3 files changed, 119 insertions(+), 3 deletions(-) create mode 100644 eng/common/instructions/azsdk-tools/validate-codeowners.instructions.md create mode 100644 eng/common/instructions/azsdk-tools/validate-service-label.instruction.md diff --git a/eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md b/eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md index 5487c87fb..162763b1f 100644 --- a/eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md +++ b/eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md @@ -88,19 +88,29 @@ Your goal is to guide user through the process of generating SDKs from TypeSpec **Actions**: 1. Run `GetSDKPullRequestDetails` to fetch generated SDK PR info. -## Step 9: Create release plan +## Step 9: Validate Label and Codeowners +**Goal**: Validate the label and all codeowners for a service. Create new label and codeowner entry if none exist. +**Actions**: +1. To validate a service label refer to #file:./validate-service-label.prompt.md +2. After service label is validated or created refer to #file:./validate-codeowners.prompt.md +3. Handle post-validation actions based on results: + - **If both label and codeowners were already valid**: Prompt user "Your service label and codeowners are already properly configured. Would you like to modify the existing codeowners entry for your service?" + - **If new label or codeowner entries were created**: Display details of all created PRs, then prompt user "The following PRs have been created for your service configuration: [list PRs]. Would you like to make any additional modifications to these entries?" +**Success Criteria**: Service label exists and codeowners are properly configured with at least 2 valid owners. For created entries, showcase all PR's. + +## Step 10: Create release plan **Goal**: Create a release plan for the generated SDKs **Actions**: 1. Refer to #file:create-release-plan.instructions.md to create a release plan using the spec pull request. 2. If the release plan already exists, display the existing plan details. -## Step 10: Mark Spec PR as Ready for Review +## Step 11: Mark Spec PR as Ready for Review **Goal**: Update spec PR to ready for review status **Actions**: 1. Prompt user to change spec PR to ready for review: "Please change the spec pull request to ready for review status" 2. Get approval and merge the spec PR -## Step 11: Release SDK Package +## Step 12: Release SDK Package **Goal**: Release the SDK package using the release plan **Actions**: 1. Run `ReleaseSdkPackage` to release the SDK package. diff --git a/eng/common/instructions/azsdk-tools/validate-codeowners.instructions.md b/eng/common/instructions/azsdk-tools/validate-codeowners.instructions.md new file mode 100644 index 000000000..dcf98e638 --- /dev/null +++ b/eng/common/instructions/azsdk-tools/validate-codeowners.instructions.md @@ -0,0 +1,74 @@ +--- +mode: 'agent' +tools: ['azsdk_check_service_label', 'azsdk_engsys_validate_codeowners_entry_for_service', 'azsdk_engsys_codeowner_update'] +--- + +## Goal: +Validate service label and ensure at least 2 valid code owners exist for SDK repositories. + +## Step 1: Validate Service Label +Use `azsdk_check_service_label` to verify the service label exists: +- **DoesNotExist/NotAServiceLabel**: Direct user to create valid service label first. Stop validation process until service label is created. +- **Exists/InReview**: Proceed to Step 2 + +## Step 2: Validate Code Owners +Ask user to specify SDK repository they want to validate codeowners for or detect from context. + +Repository name mapping: +- .NET/dotnet: use "azure-sdk-for-net" +- Python: use "azure-sdk-for-python" +- Java: use "azure-sdk-for-java" +- JavaScript: use "azure-sdk-for-js" +- Go: use "azure-sdk-for-go" + +Use `azsdk_engsys_validate_codeowners_entry_for_service` with either `serviceLabel` OR `repoPath` or both, but at least one must be used. If one isn't provided, leave the parameter field empty. + +**If entry exists**: Go to Step 3 +**If no entry exists**: Go to Step 4 + +## Step 3: Check Existing Code Owners +Valid code owners must be: +- PUBLIC members of Microsoft and Azure GitHub organizations +- Have write access to the SDK repository + +**If at least 2 valid owners**: Success - optionally add or delete additional owners +**If less than 2 valid owners**: CRITICAL - must fix before proceeding: + +After any changes, re-validate with `azsdk_engsys_validate_codeowners_entry_for_service`. + +## Step 4: Create New Code Owner Entry +When no CODEOWNERS entry exists yet: +1. Ensure that you have information about + - repo - **Required** - Repository name mapping: + - .NET/dotnet: use "azure-sdk-for-net" + - Python: use "azure-sdk-for-python" + - Java: use "azure-sdk-for-java" + - JavaScript: use "azure-sdk-for-js" + - Go: use "azure-sdk-for-go" + - typeSpecProjectRoot - **Optional** This should be acquired only if the information is present in the previous chat history, if not, ignore and input `""`. + - path - **Optional** only if there is a service label and we're not making a new entry - This should be acquired when creating a new code owner entry, if no information is present ask the user. Typically looks like `/sdk/projectpath` + - serviceLabel - **Optional** only if there is a path and we're not making a new entry - This should be acquired from the previous step of Check or Create Service Label. + - serviceOwners - **Optional** if no ServiceLabel is present. Can be either owners to add or delete, depending on isAdding. + - sourceOwners - **Optional** if no path or PRLabel are present. Can be either owners to add or delete, depending on isAdding. + - isAdding - **Required** Should be true if adding owners to an existing entry, false if deleting owners from an existing entry. Should also be false when adding a brand new entry. +1. Provide information to the user about what codeowners is for: + - [Learn about CODEOWNERS](https://eng.ms/docs/products/azure-developer-experience/develop/supporting-sdk-customers/overview) + - Service owners is for getting mentioned on issues. + - Source owners is for getting mentioned in PRs. +2. Collect service owners and source owners (GitHub usernames) +3. Use `azsdk_engsys_codeowner_update` with required parameters +4. Must have at least 2 valid owners from the start + +### Fix Options: +1. **Fix invalid owners** - If there are invalid owners after modifing the CODEOWNERS file ALWAYS provide guidance: + - Microsoft org: [Join here](https://repos.opensource.microsoft.com/orgs/Microsoft), set public visibility at [Microsoft Org Visibility](https://github.com/orgs/Microsoft/people?query={github_username}) + - Azure org: [Join here](https://repos.opensource.microsoft.com/orgs/Azure), set public visibility at [Azure Org Visibility](https://github.com/orgs/Azure/people?query={github_username}) + - Write access: [Request here](https://coreidentity.microsoft.com/manage/Entitlement/entitlement/azuresdkpart-heqj) + - Documentation about codeowners: [Read here](https://eng.ms/docs/products/azure-developer-experience/develop/supporting-sdk-customers/codeowners) +2. **Add new owners** using `azsdk_engsys_codeowner_update` with `isAdding: true` +3. **Remove invalid + add valid** owners using `azsdk_engsys_codeowner_update` + +## Requirements +- **MINIMUM**: At least 2 valid code owners at all times +- **NO EXCEPTIONS**: Cannot proceed with insufficient owners +- **RESPONSE HANDLING**: If any exception occurs during validation or creation, ALWAYS provide documentation link [Codeowners documentation](https://eng.ms/docs/products/azure-developer-experience/develop/supporting-sdk-customers/codeowners) \ No newline at end of file diff --git a/eng/common/instructions/azsdk-tools/validate-service-label.instruction.md b/eng/common/instructions/azsdk-tools/validate-service-label.instruction.md new file mode 100644 index 000000000..dace8c008 --- /dev/null +++ b/eng/common/instructions/azsdk-tools/validate-service-label.instruction.md @@ -0,0 +1,32 @@ +--- +mode: 'agent' +tools: ['azsdk_check_service_label', 'azsdk_create_service_label'] +--- + +## Goal +Validate service label exists or create new one for SDK release process. + +## Step 1: Get Service Label +Ask user for their service label. If none provided, explain that a valid service label is required for SDK release. + +## Step 2: Validate Label +Use `azsdk_check_service_label` to check status: + +- **Exists**: Success - user can proceed with next steps in SDK release process +- **InReview**: Label pending approval - user can proceed (will be available once merged) +- **DoesNotExist**: Go to Step 3 to create new label +- **NotAServiceLabel**: Label exists but wrong type - go to Step 3 for new service label + +## Step 3: Create New Service Label +When no valid service label exists, guide the user through creating a new one. + +1. **Check existing labels**: Search for related service labels, offer alternatives +2. **Generate recommendation**: Suggest label name following guidelines: + - No "Microsoft/Azure" in name + - Title Case (except short prepositions) + - Avoid Service Groups: Use "Communication Rooms" instead of "Communication - Rooms" + - Single label per service +3. **Get confirmation**: User confirms or modifies suggested name +4. **Create label**: Use `azsdk_create_service_label` with confirmed name and documentation link given by user + +Display pull request results and inform user they can proceed. \ No newline at end of file From e19148d3c03cd12c10c4aeed3056bd4dc4c74849 Mon Sep 17 00:00:00 2001 From: Shirel Marino <80732950+shirelmr@users.noreply.github.com> Date: Fri, 22 Aug 2025 16:08:12 -0700 Subject: [PATCH 2/9] Update eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md Co-authored-by: Mariana Rios Flores --- .../instructions/azsdk-tools/typespec-to-sdk.instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md b/eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md index 162763b1f..8f0c804fe 100644 --- a/eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md +++ b/eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md @@ -92,7 +92,7 @@ Your goal is to guide user through the process of generating SDKs from TypeSpec **Goal**: Validate the label and all codeowners for a service. Create new label and codeowner entry if none exist. **Actions**: 1. To validate a service label refer to #file:./validate-service-label.prompt.md -2. After service label is validated or created refer to #file:./validate-codeowners.prompt.md +2. After service label is validated or created refer to #file:./validate-codeowners.instructions.md 3. Handle post-validation actions based on results: - **If both label and codeowners were already valid**: Prompt user "Your service label and codeowners are already properly configured. Would you like to modify the existing codeowners entry for your service?" - **If new label or codeowner entries were created**: Display details of all created PRs, then prompt user "The following PRs have been created for your service configuration: [list PRs]. Would you like to make any additional modifications to these entries?" From 0aff0bbb07c81139b8e13c2c8fbba4cf02ae951c Mon Sep 17 00:00:00 2001 From: Shirel Marino <80732950+shirelmr@users.noreply.github.com> Date: Fri, 22 Aug 2025 16:08:19 -0700 Subject: [PATCH 3/9] Update eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md Co-authored-by: Mariana Rios Flores --- .../instructions/azsdk-tools/typespec-to-sdk.instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md b/eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md index 8f0c804fe..22133c180 100644 --- a/eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md +++ b/eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md @@ -91,7 +91,7 @@ Your goal is to guide user through the process of generating SDKs from TypeSpec ## Step 9: Validate Label and Codeowners **Goal**: Validate the label and all codeowners for a service. Create new label and codeowner entry if none exist. **Actions**: -1. To validate a service label refer to #file:./validate-service-label.prompt.md +1. To validate a service label refer to #file:./validate-service-label.instructions.md 2. After service label is validated or created refer to #file:./validate-codeowners.instructions.md 3. Handle post-validation actions based on results: - **If both label and codeowners were already valid**: Prompt user "Your service label and codeowners are already properly configured. Would you like to modify the existing codeowners entry for your service?" From d58db43c56c269b077d25e8c4334a18ede86dbc0 Mon Sep 17 00:00:00 2001 From: Shirel Marino <80732950+shirelmr@users.noreply.github.com> Date: Fri, 22 Aug 2025 16:40:27 -0700 Subject: [PATCH 4/9] changed NotAServiceLabel line --- .../azsdk-tools/validate-service-label.instruction.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/common/instructions/azsdk-tools/validate-service-label.instruction.md b/eng/common/instructions/azsdk-tools/validate-service-label.instruction.md index dace8c008..a6e6e4f11 100644 --- a/eng/common/instructions/azsdk-tools/validate-service-label.instruction.md +++ b/eng/common/instructions/azsdk-tools/validate-service-label.instruction.md @@ -15,7 +15,7 @@ Use `azsdk_check_service_label` to check status: - **Exists**: Success - user can proceed with next steps in SDK release process - **InReview**: Label pending approval - user can proceed (will be available once merged) - **DoesNotExist**: Go to Step 3 to create new label -- **NotAServiceLabel**: Label exists but wrong type - go to Step 3 for new service label +- **NotAServiceLabel**: Label exists but it is not a service label - go to Step 3 for new service label ## Step 3: Create New Service Label When no valid service label exists, guide the user through creating a new one. @@ -29,4 +29,4 @@ When no valid service label exists, guide the user through creating a new one. 3. **Get confirmation**: User confirms or modifies suggested name 4. **Create label**: Use `azsdk_create_service_label` with confirmed name and documentation link given by user -Display pull request results and inform user they can proceed. \ No newline at end of file +Display pull request results and inform user they can proceed. From 8dc011764e5b466e1137c3143f12c5499c913f69 Mon Sep 17 00:00:00 2001 From: shirelmr Date: Fri, 22 Aug 2025 17:33:33 -0700 Subject: [PATCH 5/9] changed guidance to the documentation --- .../azsdk-tools/validate-codeowners.instructions.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/common/instructions/azsdk-tools/validate-codeowners.instructions.md b/eng/common/instructions/azsdk-tools/validate-codeowners.instructions.md index dcf98e638..8cb4c2876 100644 --- a/eng/common/instructions/azsdk-tools/validate-codeowners.instructions.md +++ b/eng/common/instructions/azsdk-tools/validate-codeowners.instructions.md @@ -60,11 +60,11 @@ When no CODEOWNERS entry exists yet: 4. Must have at least 2 valid owners from the start ### Fix Options: -1. **Fix invalid owners** - If there are invalid owners after modifing the CODEOWNERS file ALWAYS provide guidance: - - Microsoft org: [Join here](https://repos.opensource.microsoft.com/orgs/Microsoft), set public visibility at [Microsoft Org Visibility](https://github.com/orgs/Microsoft/people?query={github_username}) - - Azure org: [Join here](https://repos.opensource.microsoft.com/orgs/Azure), set public visibility at [Azure Org Visibility](https://github.com/orgs/Azure/people?query={github_username}) - - Write access: [Request here](https://coreidentity.microsoft.com/manage/Entitlement/entitlement/azuresdkpart-heqj) - - Documentation about codeowners: [Read here](https://eng.ms/docs/products/azure-developer-experience/develop/supporting-sdk-customers/codeowners) +1. **Fix invalid owners** - If there are invalid owners after modifing the CODEOWNERS file ALWAYS provide guidance. + Follow instructions [here](https://aka.ms/azsdk/access) for: + - Joining Microsoft and Azure GitHub orgs + - Setting public visibility + - Requesting write access 2. **Add new owners** using `azsdk_engsys_codeowner_update` with `isAdding: true` 3. **Remove invalid + add valid** owners using `azsdk_engsys_codeowner_update` From bb9e9781271cb004be42af14dcc24b079571efef Mon Sep 17 00:00:00 2001 From: Michelle Date: Mon, 25 Aug 2025 10:18:06 -0700 Subject: [PATCH 6/9] specified which PRs to display --- .../instructions/azsdk-tools/typespec-to-sdk.instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md b/eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md index 22133c180..773b4ac4f 100644 --- a/eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md +++ b/eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md @@ -95,7 +95,7 @@ Your goal is to guide user through the process of generating SDKs from TypeSpec 2. After service label is validated or created refer to #file:./validate-codeowners.instructions.md 3. Handle post-validation actions based on results: - **If both label and codeowners were already valid**: Prompt user "Your service label and codeowners are already properly configured. Would you like to modify the existing codeowners entry for your service?" - - **If new label or codeowner entries were created**: Display details of all created PRs, then prompt user "The following PRs have been created for your service configuration: [list PRs]. Would you like to make any additional modifications to these entries?" + - **If new label or codeowner entries were created**: Display details of the label and codeowners PR if they were created, then prompt user "The following PRs have been created for your service configuration: [list PRs]. Would you like to make any additional modifications to these entries?" **Success Criteria**: Service label exists and codeowners are properly configured with at least 2 valid owners. For created entries, showcase all PR's. ## Step 10: Create release plan From 7ce14a2d7854f0812cbda0f4fc9fe3ca384ed2d0 Mon Sep 17 00:00:00 2001 From: Michelle Ma <145605943+michiisai@users.noreply.github.com> Date: Mon, 25 Aug 2025 10:22:12 -0700 Subject: [PATCH 7/9] Update eng/common/instructions/azsdk-tools/validate-service-label.instruction.md Co-authored-by: Juan Ospina <70209456+jeo02@users.noreply.github.com> --- .../azsdk-tools/validate-service-label.instruction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/instructions/azsdk-tools/validate-service-label.instruction.md b/eng/common/instructions/azsdk-tools/validate-service-label.instruction.md index a6e6e4f11..b8557dd0a 100644 --- a/eng/common/instructions/azsdk-tools/validate-service-label.instruction.md +++ b/eng/common/instructions/azsdk-tools/validate-service-label.instruction.md @@ -18,7 +18,7 @@ Use `azsdk_check_service_label` to check status: - **NotAServiceLabel**: Label exists but it is not a service label - go to Step 3 for new service label ## Step 3: Create New Service Label -When no valid service label exists, guide the user through creating a new one. +If no valid service label exists, guide the user through creating a new one. 1. **Check existing labels**: Search for related service labels, offer alternatives 2. **Generate recommendation**: Suggest label name following guidelines: From e33873a3ae8419d32a267b1e904256f3068769b0 Mon Sep 17 00:00:00 2001 From: Michelle Ma <145605943+michiisai@users.noreply.github.com> Date: Mon, 25 Aug 2025 10:22:54 -0700 Subject: [PATCH 8/9] Update eng/common/instructions/azsdk-tools/validate-codeowners.instructions.md Co-authored-by: Juan Ospina <70209456+jeo02@users.noreply.github.com> --- .../azsdk-tools/validate-codeowners.instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/instructions/azsdk-tools/validate-codeowners.instructions.md b/eng/common/instructions/azsdk-tools/validate-codeowners.instructions.md index 8cb4c2876..553118dcf 100644 --- a/eng/common/instructions/azsdk-tools/validate-codeowners.instructions.md +++ b/eng/common/instructions/azsdk-tools/validate-codeowners.instructions.md @@ -38,7 +38,7 @@ After any changes, re-validate with `azsdk_engsys_validate_codeowners_entry_for_ ## Step 4: Create New Code Owner Entry When no CODEOWNERS entry exists yet: -1. Ensure that you have information about +1. Ensure you have the following information - repo - **Required** - Repository name mapping: - .NET/dotnet: use "azure-sdk-for-net" - Python: use "azure-sdk-for-python" From 1388d1490eef8707b59d177ca0fcb820f19f030d Mon Sep 17 00:00:00 2001 From: Shirel Marino <80732950+shirelmr@users.noreply.github.com> Date: Mon, 25 Aug 2025 10:40:49 -0700 Subject: [PATCH 9/9] Update eng/common/instructions/azsdk-tools/validate-service-label.instruction.md Co-authored-by: Juan Ospina <70209456+jeo02@users.noreply.github.com> --- .../azsdk-tools/validate-service-label.instruction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/instructions/azsdk-tools/validate-service-label.instruction.md b/eng/common/instructions/azsdk-tools/validate-service-label.instruction.md index b8557dd0a..25a15838e 100644 --- a/eng/common/instructions/azsdk-tools/validate-service-label.instruction.md +++ b/eng/common/instructions/azsdk-tools/validate-service-label.instruction.md @@ -29,4 +29,4 @@ If no valid service label exists, guide the user through creating a new one. 3. **Get confirmation**: User confirms or modifies suggested name 4. **Create label**: Use `azsdk_create_service_label` with confirmed name and documentation link given by user -Display pull request results and inform user they can proceed. +Inform user they can proceed.