fix: remove previewBranch parameter and align deploy stage condition#2526
fix: remove previewBranch parameter and align deploy stage condition#2526jingjingjia-ms wants to merge 4 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Removes the GitHub release deployment job from the CI build pipeline so that GitHub deployments are handled by the release process instead.
Changes:
- Deleted the
deploy_githubdeployment job from thedeploystage in the Azure Pipelines CI definition. - Left the Maven deployment (
deploy_maven) as the remaining deployment job in thedeploystage.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - stage: deploy | ||
| condition: and(or(contains(variables['build.sourceBranch'], 'refs/tags/v'), eq(variables['build.sourceBranch'], '${{ parameters.previewBranch }}')), succeeded()) | ||
| dependsOn: build | ||
| jobs: | ||
| - deployment: deploy_github | ||
| condition: and(contains(variables['build.sourceBranch'], 'refs/tags/v'), succeeded()) | ||
| pool: | ||
| name: Azure-Pipelines-1ESPT-ExDShared | ||
| os: linux | ||
| image: ubuntu-latest | ||
| templateContext: | ||
| type: releaseJob | ||
| isProduction: true | ||
| inputs: | ||
| - input: pipelineArtifact | ||
| artifactName: jars | ||
| targetPath: "$(Pipeline.Workspace)" | ||
| environment: kiota-github-releases | ||
| strategy: | ||
| runOnce: | ||
| deploy: | ||
| steps: | ||
| - pwsh: | | ||
| $zips = Get-ChildItem -Path "$(Pipeline.Workspace)" -Filter "*.jar" | ||
| $zip = $zips | Select-Object -First 1 | ||
| $zipName = $zip.Name | ||
| if ($zipName -match "\d+.\d+.\d+") | ||
| { | ||
| $version = $matches[0] | ||
| echo "Current version is $version" | ||
| echo "##vso[task.setvariable variable=artifactVersion;]$version" | ||
| } | ||
| else | ||
| { | ||
| Write-Error "No valid version found in jar file name." | ||
| exit 1 | ||
| } | ||
|
|
||
| - task: GitHubRelease@1 | ||
| inputs: | ||
| gitHubConnection: "microsoftkiota" | ||
| tagSource: userSpecifiedTag | ||
| tag: "v$(artifactVersion)" | ||
| title: "v$(artifactVersion)" | ||
| assets: | | ||
| $(Pipeline.Workspace)/**/*.jar | ||
| $(Pipeline.Workspace)/**/*.jar.md5 | ||
| $(Pipeline.Workspace)/**/*.jar.sha1 | ||
| $(Pipeline.Workspace)/**/*.jar.sha256 | ||
| $(Pipeline.Workspace)/**/*.jar.sha512 | ||
| $(Pipeline.Workspace)/**/*.jar.asc | ||
| $(Pipeline.Workspace)/**/*.jar.asc.md5 | ||
| $(Pipeline.Workspace)/**/*.jar.asc.sha1 | ||
| $(Pipeline.Workspace)/**/*.jar.asc.sha256 | ||
| $(Pipeline.Workspace)/**/*.jar.asc.sha512 | ||
| $(Pipeline.Workspace)/**/*.pom | ||
| $(Pipeline.Workspace)/**/*.pom.md5 | ||
| $(Pipeline.Workspace)/**/*.pom.sha1 | ||
| $(Pipeline.Workspace)/**/*.pom.sha256 | ||
| $(Pipeline.Workspace)/**/*.pom.sha512 | ||
| $(Pipeline.Workspace)/**/*.pom.asc | ||
| $(Pipeline.Workspace)/**/*.pom.asc.md5 | ||
| $(Pipeline.Workspace)/**/*.pom.asc.sha1 | ||
| $(Pipeline.Workspace)/**/*.pom.asc.sha256 | ||
| $(Pipeline.Workspace)/**/*.pom.asc.sha512 | ||
| $(Pipeline.Workspace)/**/*.module | ||
| $(Pipeline.Workspace)/**/*.module.md5 | ||
| $(Pipeline.Workspace)/**/*.module.sha1 | ||
| $(Pipeline.Workspace)/**/*.module.sha256 | ||
| $(Pipeline.Workspace)/**/*.module.sha512 | ||
| $(Pipeline.Workspace)/**/*.module.asc | ||
| $(Pipeline.Workspace)/**/*.module.asc.md5 | ||
| $(Pipeline.Workspace)/**/*.module.asc.sha1 | ||
| $(Pipeline.Workspace)/**/*.module.asc.sha256 | ||
| $(Pipeline.Workspace)/**/*.module.asc.sha512 | ||
|
|
||
| addChangeLog: false | ||
| action: edit | ||
|
|
||
| - deployment: deploy_maven | ||
| # snapshots are not supported by ESRP release for now, but they are planning to add support. When it happens, simply remove the condition | ||
| condition: and(contains(variables['build.sourceBranch'], 'refs/tags/v'), succeeded()) |
There was a problem hiding this comment.
The deploy stage still has a condition that allows it to run on previewBranch, but after removing deploy_github the only remaining job (deploy_maven) runs only for tags (refs/tags/v). This makes the deploy stage execute and then immediately skip all jobs on previewBranch, which is confusing and leaves previewBranch seemingly unnecessary. Consider updating the stage condition to match the remaining job(s), and if previewBranch is no longer needed, remove the parameter as well.
There was a problem hiding this comment.
Done in commit 8c970c6. Removed the previewBranch parameter and updated the deploy stage condition to and(contains(variables['build.sourceBranch'], 'refs/tags/v'), succeeded()), which now matches the deploy_maven job's condition exactly.
… deploy_maven job Agent-Logs-Url: https://github.com/microsoftgraph/msgraph-sdk-java/sessions/b7a800ea-5b58-481a-89e5-fa85ce699226 Co-authored-by: ramsessanchez <63934382+ramsessanchez@users.noreply.github.com>
The deploy stage condition referenced a
previewBranchparameter that became unnecessary after removingdeploy_github. This caused the deploy stage to execute onpreviewBranchpushes while immediately skipping all jobs — confusing and misleading.Changes
previewBranchparameter — no longer referenced anywhere in the pipelinedeploy_mavenjob's condition exactly: