Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions eng/pipelines/spec-gen-sdk.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
parameters:
- name: SdkRepoBranch
type: string
Expand Down Expand Up @@ -37,6 +37,10 @@
type: number
default: 0
displayName: 'Release plan work item id'
- name: TriggerSource
type: string
default: 'unspecified'
displayName: 'Trigger source'

trigger: none

Expand All @@ -53,3 +57,4 @@
CreatePullRequest: ${{ parameters.CreatePullRequest }}
ForceCreateEvenWithFailures: ${{ parameters.ForceCreateEvenWithFailures }}
ReleasePlanWorkItemId: ${{ parameters.ReleasePlanWorkItemId }}
TriggerSource: ${{ parameters.TriggerSource }}
7 changes: 5 additions & 2 deletions eng/pipelines/templates/stages/archetype-spec-gen-sdk.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
parameters:
- name: SpecRepoUrl
type: string
Expand Down Expand Up @@ -34,6 +34,9 @@
- name: ReleasePlanWorkItemId
type: number
default: 0
- name: TriggerSource
type: string
default: 'unspecified'

stages:
- stage: ${{ iif(eq(parameters.SpecBatchTypes, ''), 'Build', format('Build_{0}', replace(parameters.SpecBatchTypes, '-', '_'))) }}
Expand Down Expand Up @@ -339,15 +342,15 @@
-AuthToken "$(azuresdk-github-pat)"
-PRTitle "$(PrTitle)-generated-from-$(Build.DefinitionName)-$(Build.BuildId)"
-PRBody "$(GeneratedSDKInformation) $(ReleasePlanInfo)"
-OpenAsDraft $true
-OpenAsDraft $${{ ne(parameters.TriggerSource, 'release-plan-app') }}
Copy link
Copy Markdown
Member

@praveenkuttappan praveenkuttappan Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be a separate param? Trigger source could be agent, or it could be GitHub copilot. We shouldn't use release plan app value for comparison. A user might directly use MCP tool to run SDK generation too.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer combining them into one input param if possible to simplify the pipeline. The name check could be changed to like containing -release.

Whatever entries calling the generation pipeline, no matter MCP tool or release plan app, should set the 'TriggerSource' with the name ending with -release.



- ${{ if ne(parameters.ReleasePlanWorkItemId, 0) }}:
- pwsh: |
$prUrl = "https://github.com/Azure/$(SdkRepoName)/pull/$(Submitted.PullRequest.Number)"
Write-Host "Pull request created: $prUrl"
Write-Host "##vso[task.setvariable variable=PullRequestUrl]$prUrl"
$prStatus = "draft"
$prStatus = "${{ iif(eq(parameters.TriggerSource, 'release-plan-app'), 'ready for review', 'draft') }}"
Write-Host "##vso[task.setvariable variable=SdkPrStatus]$prStatus"
condition: and(succeeded(), eq(variables['HasChanges'], 'true'), ne(variables['Build.Reason'], 'PullRequest'), not(endsWith(variables['SdkRepoName'], '-pr')))
displayName: "Set pull request URL variable"
Expand Down
Loading