Skip to content

Commit 4cb40f6

Browse files
azure-sdkshirelmrshirelmrmaririosmichiisai
authored
Sync eng/common directory with azure-sdk-tools for PR 11802 (#2189)
* prompt files for labels and codeowners * Update eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md Co-authored-by: Mariana Rios Flores <[email protected]> * Update eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md Co-authored-by: Mariana Rios Flores <[email protected]> * changed NotAServiceLabel line * changed guidance to the documentation * specified which PRs to display * Update eng/common/instructions/azsdk-tools/validate-service-label.instruction.md Co-authored-by: Juan Ospina <[email protected]> * Update eng/common/instructions/azsdk-tools/validate-codeowners.instructions.md Co-authored-by: Juan Ospina <[email protected]> * Update eng/common/instructions/azsdk-tools/validate-service-label.instruction.md Co-authored-by: Juan Ospina <[email protected]> --------- Co-authored-by: shirelmr <[email protected]> Co-authored-by: Shirel Marino <[email protected]> Co-authored-by: Mariana Rios Flores <[email protected]> Co-authored-by: Michelle <[email protected]> Co-authored-by: Michelle Ma <[email protected]> Co-authored-by: Juan Ospina <[email protected]>
1 parent 390db85 commit 4cb40f6

File tree

3 files changed

+119
-3
lines changed

3 files changed

+119
-3
lines changed

eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,19 +88,29 @@ Your goal is to guide user through the process of generating SDKs from TypeSpec
8888
**Actions**:
8989
1. Run `GetSDKPullRequestDetails` to fetch generated SDK PR info.
9090

91-
## Step 9: Create release plan
91+
## Step 9: Validate Label and Codeowners
92+
**Goal**: Validate the label and all codeowners for a service. Create new label and codeowner entry if none exist.
93+
**Actions**:
94+
1. To validate a service label refer to #file:./validate-service-label.instructions.md
95+
2. After service label is validated or created refer to #file:./validate-codeowners.instructions.md
96+
3. Handle post-validation actions based on results:
97+
- **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?"
98+
- **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?"
99+
**Success Criteria**: Service label exists and codeowners are properly configured with at least 2 valid owners. For created entries, showcase all PR's.
100+
101+
## Step 10: Create release plan
92102
**Goal**: Create a release plan for the generated SDKs
93103
**Actions**:
94104
1. Refer to #file:create-release-plan.instructions.md to create a release plan using the spec pull request.
95105
2. If the release plan already exists, display the existing plan details.
96106

97-
## Step 10: Mark Spec PR as Ready for Review
107+
## Step 11: Mark Spec PR as Ready for Review
98108
**Goal**: Update spec PR to ready for review status
99109
**Actions**:
100110
1. Prompt user to change spec PR to ready for review: "Please change the spec pull request to ready for review status"
101111
2. Get approval and merge the spec PR
102112

103-
## Step 11: Release SDK Package
113+
## Step 12: Release SDK Package
104114
**Goal**: Release the SDK package using the release plan
105115
**Actions**:
106116
1. Run `ReleaseSdkPackage` to release the SDK package.
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
mode: 'agent'
3+
tools: ['azsdk_check_service_label', 'azsdk_engsys_validate_codeowners_entry_for_service', 'azsdk_engsys_codeowner_update']
4+
---
5+
6+
## Goal:
7+
Validate service label and ensure at least 2 valid code owners exist for SDK repositories.
8+
9+
## Step 1: Validate Service Label
10+
Use `azsdk_check_service_label` to verify the service label exists:
11+
- **DoesNotExist/NotAServiceLabel**: Direct user to create valid service label first. Stop validation process until service label is created.
12+
- **Exists/InReview**: Proceed to Step 2
13+
14+
## Step 2: Validate Code Owners
15+
Ask user to specify SDK repository they want to validate codeowners for or detect from context.
16+
17+
Repository name mapping:
18+
- .NET/dotnet: use "azure-sdk-for-net"
19+
- Python: use "azure-sdk-for-python"
20+
- Java: use "azure-sdk-for-java"
21+
- JavaScript: use "azure-sdk-for-js"
22+
- Go: use "azure-sdk-for-go"
23+
24+
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.
25+
26+
**If entry exists**: Go to Step 3
27+
**If no entry exists**: Go to Step 4
28+
29+
## Step 3: Check Existing Code Owners
30+
Valid code owners must be:
31+
- PUBLIC members of Microsoft and Azure GitHub organizations
32+
- Have write access to the SDK repository
33+
34+
**If at least 2 valid owners**: Success - optionally add or delete additional owners
35+
**If less than 2 valid owners**: CRITICAL - must fix before proceeding:
36+
37+
After any changes, re-validate with `azsdk_engsys_validate_codeowners_entry_for_service`.
38+
39+
## Step 4: Create New Code Owner Entry
40+
When no CODEOWNERS entry exists yet:
41+
1. Ensure you have the following information
42+
- repo - **Required** - Repository name mapping:
43+
- .NET/dotnet: use "azure-sdk-for-net"
44+
- Python: use "azure-sdk-for-python"
45+
- Java: use "azure-sdk-for-java"
46+
- JavaScript: use "azure-sdk-for-js"
47+
- Go: use "azure-sdk-for-go"
48+
- typeSpecProjectRoot - **Optional** This should be acquired only if the information is present in the previous chat history, if not, ignore and input `""`.
49+
- 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`
50+
- 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.
51+
- serviceOwners - **Optional** if no ServiceLabel is present. Can be either owners to add or delete, depending on isAdding.
52+
- sourceOwners - **Optional** if no path or PRLabel are present. Can be either owners to add or delete, depending on isAdding.
53+
- 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.
54+
1. Provide information to the user about what codeowners is for:
55+
- [Learn about CODEOWNERS](https://eng.ms/docs/products/azure-developer-experience/develop/supporting-sdk-customers/overview)
56+
- Service owners is for getting mentioned on issues.
57+
- Source owners is for getting mentioned in PRs.
58+
2. Collect service owners and source owners (GitHub usernames)
59+
3. Use `azsdk_engsys_codeowner_update` with required parameters
60+
4. Must have at least 2 valid owners from the start
61+
62+
### Fix Options:
63+
1. **Fix invalid owners** - If there are invalid owners after modifing the CODEOWNERS file ALWAYS provide guidance.
64+
Follow instructions [here](https://aka.ms/azsdk/access) for:
65+
- Joining Microsoft and Azure GitHub orgs
66+
- Setting public visibility
67+
- Requesting write access
68+
2. **Add new owners** using `azsdk_engsys_codeowner_update` with `isAdding: true`
69+
3. **Remove invalid + add valid** owners using `azsdk_engsys_codeowner_update`
70+
71+
## Requirements
72+
- **MINIMUM**: At least 2 valid code owners at all times
73+
- **NO EXCEPTIONS**: Cannot proceed with insufficient owners
74+
- **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)
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
mode: 'agent'
3+
tools: ['azsdk_check_service_label', 'azsdk_create_service_label']
4+
---
5+
6+
## Goal
7+
Validate service label exists or create new one for SDK release process.
8+
9+
## Step 1: Get Service Label
10+
Ask user for their service label. If none provided, explain that a valid service label is required for SDK release.
11+
12+
## Step 2: Validate Label
13+
Use `azsdk_check_service_label` to check status:
14+
15+
- **Exists**: Success - user can proceed with next steps in SDK release process
16+
- **InReview**: Label pending approval - user can proceed (will be available once merged)
17+
- **DoesNotExist**: Go to Step 3 to create new label
18+
- **NotAServiceLabel**: Label exists but it is not a service label - go to Step 3 for new service label
19+
20+
## Step 3: Create New Service Label
21+
If no valid service label exists, guide the user through creating a new one.
22+
23+
1. **Check existing labels**: Search for related service labels, offer alternatives
24+
2. **Generate recommendation**: Suggest label name following guidelines:
25+
- No "Microsoft/Azure" in name
26+
- Title Case (except short prepositions)
27+
- Avoid Service Groups: Use "Communication Rooms" instead of "Communication - Rooms"
28+
- Single label per service
29+
3. **Get confirmation**: User confirms or modifies suggested name
30+
4. **Create label**: Use `azsdk_create_service_label` with confirmed name and documentation link given by user
31+
32+
Inform user they can proceed.

0 commit comments

Comments
 (0)