-
Notifications
You must be signed in to change notification settings - Fork 235
Prompt files for labels and codeowners tools #11802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1ce9de8
prompt files for labels and codeowners
34be759
Update eng/common/instructions/azsdk-tools/typespec-to-sdk.instructio…
shirelmr 2ee02e4
Update eng/common/instructions/azsdk-tools/typespec-to-sdk.instructio…
shirelmr 1802ca7
changed NotAServiceLabel line
shirelmr d3624fa
changed guidance to the documentation
7c7cf8f
specified which PRs to display
michiisai 25e2e5c
Update eng/common/instructions/azsdk-tools/validate-service-label.ins…
michiisai e2c02f7
Update eng/common/instructions/azsdk-tools/validate-codeowners.instru…
michiisai bccb6ac
Update eng/common/instructions/azsdk-tools/validate-service-label.ins…
shirelmr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
eng/common/instructions/azsdk-tools/validate-codeowners.instructions.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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) |
32 changes: 32 additions & 0 deletions
32
eng/common/instructions/azsdk-tools/validate-service-label.instruction.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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. | ||
shirelmr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ## 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) | ||
shirelmr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - **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. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.