|
| 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) |
0 commit comments