Skip to content

Commit db51e09

Browse files
authored
Sync eng/common directory with azure-sdk-tools for PR 12501 (Azure#3199)
Sync eng/common directory with azure-sdk-tools for PR
1 parent ed800e4 commit db51e09

File tree

5 files changed

+51
-151
lines changed

5 files changed

+51
-151
lines changed

eng/common/instructions/azsdk-tools/check-api-readiness.instructions.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

eng/common/instructions/azsdk-tools/create-spec-pullrequest.instructions.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

eng/common/instructions/azsdk-tools/run-sdk-gen-pipeline.instructions.md

Lines changed: 0 additions & 43 deletions
This file was deleted.

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

Lines changed: 51 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -5,112 +5,69 @@ Your goal is to guide the user through the process of generating SDKs from TypeS
55

66
> "Would you like to begin the SDK generation process now? (yes/no)"
77
8-
Wait for the user to respond with a confirmation before proceeding to Step 1. Use the provided tools to perform actions and gather information as needed.
8+
Wait for the user to respond with a confirmation before proceeding. Use the provided tools to perform actions and gather information as needed.
99

10-
## Step 1: Identify TypeSpec Project
11-
**Goal**: Locate the TypeSpec project root path
12-
**Actions**:
13-
1. Check if `tspconfig.yaml` or `main.tsp` files are open in editor
14-
2. If found, use the parent directory as project root
15-
3. If not found, prompt user: "Please provide the path to your TypeSpec project root directory"
16-
4. Validate the provided path contains required TypeSpec files
17-
**Success Criteria**: Valid TypeSpec project path identified
18-
19-
## Step 2: Validate TypeSpec Specification
20-
**Goal**: Ensure TypeSpec specification compiles without errors
21-
**Actions**:
22-
1. Refer to #file:validate-typespec.instructions.md
23-
2. If validation succeeds, proceed to Step 3
24-
3. If validation fails:
25-
- Display all compilation errors to user
26-
- Prompt: "Please fix the TypeSpec compilation errors before proceeding"
27-
- Wait for user to fix errors and re-run validation
28-
**Success Criteria**: TypeSpec compilation passes without errors
10+
SDK languages to be generated:
11+
- Management Plane: .NET, Go, Java, JavaScript, Python
12+
- Data Plane: .NET, Java, JavaScript, Python
2913

30-
## Step 3: Verify Authentication and Repository Status
31-
**Goal**: Ensure user is authenticated and working in correct repository
32-
**Actions**:
33-
1. Run `azsdk_get_github_user_details` to verify login status
34-
2. If not logged in, prompt: "Please login to GitHub using `gh auth login`"
35-
3. Once logged in, display user details to confirm identity
36-
4. Run `azsdk_typespec_check_project_in_public_repo` to verify repository
37-
5. If not in public repo, inform: "Please make spec changes in Azure/azure-rest-api-specs public repo to generate SDKs"
38-
**Success Criteria**: User authenticated and working in public Azure repo
14+
Pre-requisites:
15+
- TypeSpec project path is available in the current context or provided by user. If not available, prompt user to provide the TypeSpec project root path (local path or GitHub URL).
3916

40-
## Step 4: Review and Commit Changes
41-
**Goal**: Stage and commit TypeSpec modifications
42-
**Actions**:
43-
1. Run `azsdk_get_modified_typespec_projects` to identify changes
44-
2. If no changes found, inform: "No TypeSpec projects were modified in current branch"
45-
3. Display all modified files (excluding `.github` and `.vscode` folders)
46-
4. Prompt user: "Please review the modified files. Do you want to commit these changes? (yes/no)"
47-
5. If yes:
48-
- If on main branch, prompt user: "You are currently on the main branch. Please create a new branch using `git checkout -b <branch-name>` before proceeding."
49-
- Wait for user confirmation before continuing
50-
- Run `git add <modified-files>`
51-
- Prompt for commit message
52-
- Run `git commit -m "<user-provided-message>"`
53-
- Run `git push -u origin <current-branch-name>`
54-
**Success Criteria**: Changes committed and pushed to remote branch
55-
56-
## Step 5: Choose SDK Generation Method
57-
**Goal**: Determine how to generate SDKs
58-
**Actions**:
59-
1. Present options: "How would you like to generate SDKs?"
60-
- Option A: "Generate SDK locally".
61-
- Option B: "Use SDK generation pipeline"
62-
2. Based on selection:
63-
- If Option A:
64-
- Follow #file:./local-sdk-workflow.instructions.md to generate and compile the SDK.
65-
- After SDK has been generated, to continue the SDK release, users can create the SDK pull request manually then proceed to Step 9.
66-
- If Option B: Continue to Step 6
67-
**Success Criteria**: SDK generation method selected
17+
# SDK generation steps
6818

69-
## Step 6: Create Specification Pull Request
70-
**Goal**: Create PR for TypeSpec changes if not already created
19+
## Step: Generate SDKs
20+
**Goal**: Generate SDKs
21+
**Message to user**: "SDK generation will take approximately 15-20 minutes. Currently, SDKs are generated using the Azure DevOps pipeline. SDK generation is supported only from a merged API spec or from an API spec pull request in the https://github.com/Azure/azure-rest-api-specs repository."
7122
**Actions**:
72-
1. Check if spec PR already exists using `azsdk_get_pull_request_link_for_current_branch`
73-
2. If PR exists, display PR details and proceed to Step 7
74-
3. If no PR exists:
75-
- Refer to #file:create-spec-pullrequest.instructions.md
76-
- Wait for PR creation confirmation
77-
- Display created PR details
78-
**Success Criteria**: Specification pull request exists
79-
80-
## Step 7: Generate SDKs via Pipeline
81-
**Goal**: Create release plan and generate SDKs
82-
**Actions**:
83-
1. Refer to #file:create-release-plan.instructions.md
84-
2. If SDK PRs exist, link them to the release plan
85-
3. Refer to #file:sdk-details-in-release-plan.instructions.md to add languages and package names to the release plan
86-
4. If TypeSpec project is for management plane, refer to #file:verify-namespace-approval.instructions.md to check package namespace approval.
87-
5. Refer to #file:run-sdk-gen-pipeline.instructions.md with the spec PR
88-
6. Monitor pipeline status and provide updates
89-
7. Display generated SDK PR links when available
23+
1. Identify whether TypeSpec is for Management Plane or Data Plane based on project structure and files. tspconfig.yaml file contains `resource-manager` for management plane and `data-plane` for data plane as resource provider.
24+
- Execute the SDK generation pipeline with the following required parameters for all languages:
25+
- TypeSpec project root path
26+
- API spec pull request number (if the API spec is not merged to the main branch, otherwise use 0)
27+
- API version
28+
- SDK release type (`beta` for preview API versions, `stable` otherwise)
29+
- Language options:
30+
For management plane: `Python`, `.NET`, `JavaScript`, `Java`, `Go`
31+
For data plane: `Python`, `.NET`, `JavaScript`, `Java`
32+
- Each SDK generation tool call should show a label to indicate the language being generated.
33+
2. Monitor pipeline status after 15 minutes and provide updates. If pipeline is in progress, inform user that it may take additional time and check the status later.
34+
3. Display generated SDK PR links when available. If pipeline fails, inform user with error details and suggest to check pipeline logs for more information.
35+
4. If SDK pull request is available for all languages, ask user to review generated SDK pull request and mark them as ready for review when they are ready to get them reviewed and merged.
36+
5. If SDK pull request was created for test purposes, inform user to close the test SDK pull request.
9037
**Success Criteria**: SDK generation pipeline initiated and SDKs generated
9138

92-
## Step 8: Show Generated SDK PRs
93-
**Goal**: Display all created SDK pull requests
94-
**Actions**:
95-
1. Run `azsdk_get_sdk_pull_request_link` to fetch generated SDK PR info.
96-
97-
## Step 9: Create release plan
39+
## Step: SDK release plan
9840
**Goal**: Create a release plan for the generated SDKs
41+
**Condition**: Only if SDK PRs are created
42+
**Message to user**: "Creating a release plan is essential to manage the release of the generated SDKs. Each release plan must include SDKs for all required languages based on the TypeSpec project type (Management Plane or Data Plane) or request exclusion approval for any excluded language. SDK pull request needs to get approval and merged to main branch before releasing the SDK package."
9943
**Actions**:
100-
1. Refer to #file:create-release-plan.instructions.md to create a release plan using the spec pull request.
101-
2. If the release plan already exists, display the existing plan details.
102-
103-
## Step 10: Mark Spec PR as Ready for Review
104-
**Goal**: Update spec PR to ready for review status
105-
**Actions**:
106-
1. Prompt user to change spec PR to ready for review: "Please change the spec pull request to ready for review status"
107-
2. Get approval and merge the spec PR
44+
1. Prompt the user to check if they generated the SDK just to test or do they intend to release it: "Do you want to create a release plan for the generated SDKs to publish them? (yes/no)"
45+
- If no, inform user: "You can create a release plan later when ready to release the SDK" and end the workflow.
46+
2. Ask user if they have already created a release plan for the generated SDKs: "Have you already created a release plan for the generated SDKs? (yes/no)"
47+
- If no, proceed to create a new release plan
48+
- If yes, get release plan details and show them to user
49+
3. Prompt the user to provide the API spec pull request link if not already available in the current context.
50+
4. If unsure, check if a release plan already exists for API spec pull request.
51+
5. Prompt user to find the service id and product id in service tree `aka.ms/st` and provide them. Stress the importance of correct service id and product id for proper release plan creation.
52+
6. If a new release plan is needed, refer to #file:create-release-plan.instructions.md to create a release plan using the spec pull request. API spec pull request is required to create a release plan.
53+
7. Prompt user to change spec PR to ready for review: "Please change the spec pull request to ready for review status"
54+
8. Suggest users to follow the instructions on spec PR to get approval from API reviewers and merge the spec PR.
55+
9. Link SDK pull requests to the release plan.
56+
10. Each release plan must release SDK for all languages based on the TypeSpec project type (Management Plane or Data Plane). If any language is missing, inform user: "The release plan must include SDKs for all required languages: Python, .NET, JavaScript, Java, Go (for Management Plane) or Python, .NET, JavaScript, Java (for Data Plane)". If it is intentional to exclude a language then user must provide a justification for it.
57+
**Success Criteria**: Release plan created and linked to SDK PRs
10858

109-
## Step 11: Release SDK Package
59+
## Step: Release SDK Package
11060
**Goal**: Release the SDK package using the release plan
11161
**Actions**:
112-
1. Run `ReleaseSdkPackage` to release the SDK package.
113-
2. Inform user to approve the package release using release pipeline.
62+
1. Prompt the user to confirm if they want to release the SDK package now: "Do you want to release the SDK package now? (yes/no)"
63+
- If no, inform user: "You can release the SDK package later using the prompt `release <package name> for <language>`" and end the workflow.
64+
2. Get SDK pull request status for all languages.
65+
3. Inform user that it needs to check SDK PR status. If any SDK pull request is not merged, inform user: "Please merge all SDK pull requests before releasing the package.". Show a summary of SDK PR status for all languages.
66+
4. If an SDK pull request is merged then run release readiness of the package for that language.
67+
5. Inform user if a language is ready for release and prompt user for a confirmation to proceed with the release.
68+
6. If user confirms, run the tool to release the SDK package.
69+
7. Inform user to approve the package release using release pipeline. Warn user that package will be published to public registries once approved.
70+
8. Identify remaining languages to be released and inform user to release SDK for all languages to complete the release plan. Release plan completion is required for KPI attestation in service tree.
11471

11572
## Process Complete
11673
Display summary of all created PRs and next steps for user.

eng/common/instructions/azsdk-tools/validate-typespec.instructions.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)