Skip to content

Commit

Permalink
Renamed batch pipeline and added internal project constrain (#33022)
Browse files Browse the repository at this point in the history
* Renamed batch pipeline and added internal project constrain

* Moved all needed steps inside of interal project condition
  • Loading branch information
raych1 authored Mar 6, 2025
1 parent 6103692 commit 28b8d4d
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 62 deletions.
File renamed without changes.
125 changes: 63 additions & 62 deletions eng/pipelines/templates/stages/archetype-spec-gen-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,69 +209,70 @@ extends:
parameters:
ArtifactName: $(PipelineArtifactsName)
ArtifactPath: $(GeneratedSDK.StagedArtifactsFolder)

- task: PowerShell@2
displayName: Add label to the spec PR
condition: and(eq(variables['Build.Reason'], 'PullRequest'), ne(variables['BreakingChangeLabel'], ''), eq(variables['BreakingChangeLabelAction'], 'add'))
inputs:
pwsh: true
workingDirectory: $(SdkRepoDirectory)
filePath: $(SdkRepoDirectory)/eng/common/scripts/Add-IssueLabels.ps1
arguments: >
-RepoOwner $(SpecRepoOwner)
-RepoName $(SpecRepoName)
-IssueNumber "$(System.PullRequest.PullRequestNumber)"
-Labels $(BreakingChangeLabel)
-AuthToken "$(azuresdk-github-pat)"

- task: PowerShell@2
displayName: Remove label from the spec PR
condition: and(eq(variables['Build.Reason'], 'PullRequest'), ne(variables['BreakingChangeLabel'], ''), eq(variables['BreakingChangeLabelAction'], 'remove'))
inputs:
pwsh: true
workingDirectory: $(SdkRepoDirectory)
filePath: $(SdkRepoDirectory)/eng/common/scripts/Remove-IssueLabel.ps1
arguments: >
-RepoOwner $(SpecRepoOwner)
-RepoName $(SpecRepoName)
-IssueNumber "$(System.PullRequest.PullRequestNumber)"
-LabelName $(BreakingChangeLabel)
-AuthToken "$(azuresdk-github-pat)"
- ${{ if eq(variables['System.TeamProject'], 'internal') }}:
- task: PowerShell@2
displayName: Add label to the spec PR
condition: and(eq(variables['Build.Reason'], 'PullRequest'), ne(variables['BreakingChangeLabel'], ''), eq(variables['BreakingChangeLabelAction'], 'add'))
inputs:
pwsh: true
workingDirectory: $(SdkRepoDirectory)
filePath: $(SdkRepoDirectory)/eng/common/scripts/Add-IssueLabels.ps1
arguments: >
-RepoOwner $(SpecRepoOwner)
-RepoName $(SpecRepoName)
-IssueNumber "$(System.PullRequest.PullRequestNumber)"
-Labels $(BreakingChangeLabel)
-AuthToken "$(azuresdk-github-pat)"
- ${{ if eq(parameters.SkipPullRequestCreation, false) }}:
- template: /eng/common/pipelines/templates/steps/git-push-changes.yml
parameters:
BaseRepoBranch: $(PrBranch)-$(Build.BuildId)
BaseRepoOwner: azure-sdk
CommitMsg: $(GeneratedSDKInformation)
TargetRepoOwner: $(SdkRepoOwner)
TargetRepoName: $(SdkRepoName)
PushArgs: "--force"
WorkingDirectory: $(SdkRepoDirectory)
ScriptDirectory: $(SdkRepoDirectory)/eng/common/scripts
- task: PowerShell@2
displayName: Remove label from the spec PR
condition: and(eq(variables['Build.Reason'], 'PullRequest'), ne(variables['BreakingChangeLabel'], ''), eq(variables['BreakingChangeLabelAction'], 'remove'))
inputs:
pwsh: true
workingDirectory: $(SdkRepoDirectory)
filePath: $(SdkRepoDirectory)/eng/common/scripts/Remove-IssueLabel.ps1
arguments: >
-RepoOwner $(SpecRepoOwner)
-RepoName $(SpecRepoName)
-IssueNumber "$(System.PullRequest.PullRequestNumber)"
-LabelName $(BreakingChangeLabel)
-AuthToken "$(azuresdk-github-pat)"
- ${{ if eq(parameters.SkipPullRequestCreation, false) }}:
- template: /eng/common/pipelines/templates/steps/git-push-changes.yml
parameters:
BaseRepoBranch: $(PrBranch)-$(Build.BuildId)
BaseRepoOwner: azure-sdk
CommitMsg: $(GeneratedSDKInformation)
TargetRepoOwner: $(SdkRepoOwner)
TargetRepoName: $(SdkRepoName)
PushArgs: "--force"
WorkingDirectory: $(SdkRepoDirectory)
ScriptDirectory: $(SdkRepoDirectory)/eng/common/scripts

- ${{ if not(endsWith(variables['SdkRepoName'], '-pr')) }}:
- task: PowerShell@2
displayName: Create pull request
condition: and(succeeded(), eq(variables['HasChanges'], 'true'), ne(variables['Build.Reason'], 'PullRequest'))
inputs:
pwsh: true
workingDirectory: $(SdkRepoDirectory)
filePath: $(SdkRepoDirectory)/eng/common/scripts/Submit-PullRequest.ps1
arguments: >
-RepoOwner "$(SdkRepoOwner)"
-RepoName "$(SdkRepoName)"
-BaseBranch "main"
-PROwner "azure-sdk"
-PRBranch "$(PrBranch)-$(Build.BuildId)"
-AuthToken "$(azuresdk-github-pat)"
-PRTitle "$(PrTitle)-generated-from-$(Build.DefinitionName)-$(Build.BuildId)"
-PRBody "$(GeneratedSDKInformation)"
-OpenAsDraft $true
- ${{ if not(endsWith(variables['SdkRepoName'], '-pr')) }}:
- task: PowerShell@2
displayName: Create pull request
condition: and(succeeded(), eq(variables['HasChanges'], 'true'), ne(variables['Build.Reason'], 'PullRequest'))
inputs:
pwsh: true
workingDirectory: $(SdkRepoDirectory)
filePath: $(SdkRepoDirectory)/eng/common/scripts/Submit-PullRequest.ps1
arguments: >
-RepoOwner "$(SdkRepoOwner)"
-RepoName "$(SdkRepoName)"
-BaseBranch "main"
-PROwner "azure-sdk"
-PRBranch "$(PrBranch)-$(Build.BuildId)"
-AuthToken "$(azuresdk-github-pat)"
-PRTitle "$(PrTitle)-generated-from-$(Build.DefinitionName)-$(Build.BuildId)"
-PRBody "$(GeneratedSDKInformation)"
-OpenAsDraft $true
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
- template: /eng/common/pipelines/templates/steps/detect-api-changes.yml
parameters:
ArtifactPath: $(GeneratedSDK.StagedArtifactsFolder)
ArtifactName: $(PipelineArtifactsName)
RepoRoot: $(SdkRepoDirectory)
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
- template: /eng/common/pipelines/templates/steps/detect-api-changes.yml
parameters:
ArtifactPath: $(GeneratedSDK.StagedArtifactsFolder)
ArtifactName: $(PipelineArtifactsName)
RepoRoot: $(SdkRepoDirectory)

0 comments on commit 28b8d4d

Please sign in to comment.