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 5487c87fbc97..773b4ac4ff70 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.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?" + - **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 **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 000000000000..553118dcf9f0 --- /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 you have the following information + - 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. + 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` + +## 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 000000000000..25a15838e55c --- /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 it is not a service label - go to Step 3 for new service label + +## Step 3: Create New Service Label +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: + - 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 + +Inform user they can proceed.