Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jun 10, 2025

This PR updates custom conditions in Azure Pipeline YAML files to properly respect canceled pipeline status and removes obsolete CADL pipeline files that were superseded by TypeSpec equivalents.

Problem

When Azure Pipeline conditions don't explicitly include success/failure state functions, they default to always() behavior, which means steps continue to run even when a pipeline is canceled. This is problematic because:

  • Canceled pipelines should stop executing remaining steps
  • Resources are wasted on unnecessary execution
  • It can interfere with cleanup and cancellation workflows

Additionally, the repository contained obsolete CADL pipeline files that were no longer needed since CADL was renamed to TypeSpec.

Solution

Pipeline Condition Updates

Updated custom conditions in 3 YAML files within eng/pipelines and eng/common/pipelines directories:

apiview-review-gen-typespec.yml - 2 conditions updated:

# BEFORE
condition: eq(variables['Reviews'], '')

# AFTER  
condition: and(succeeded(), eq(variables['Reviews'], ''))

detect-api-changes.yml - 1 condition updated:

# BEFORE
condition: and(${{ parameters.Condition}}, eq(variables['ApiChangeDetectRequestUrl'], ''))

# AFTER
condition: and(succeeded(), ${{ parameters.Condition}}, eq(variables['ApiChangeDetectRequestUrl'], ''))

perf.yml - 1 condition updated:

# BEFORE
condition: ${{ parameters.Profile }}

# AFTER
condition: and(succeeded(), ${{ parameters.Profile }})

File Cleanup

Removed obsolete CADL pipeline files:

  • eng/pipelines/apiview-review-gen-cadl.yml
  • eng/scripts/Create-Apiview-Token-Cadl.ps1

These files were duplicates of the TypeSpec equivalents and are no longer needed since CADL was renamed to TypeSpec.

Testing

  • All modified YAML files validated for syntax correctness
  • Changes preserve existing logic while adding required success checks
  • Template files with Condition parameters already had proper defaults (succeeded())

Impact

These changes ensure that when pipelines are canceled, steps with custom conditions will properly respect the canceled state and not continue executing unnecessarily. The removal of obsolete CADL files reduces maintenance overhead and eliminates duplicate functionality.

Fixes #10836.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Update custom azure pipeline yaml conditions to respect canceled status Update custom Azure pipeline YAML conditions to respect canceled status Jun 10, 2025
Copilot AI requested a review from benbp June 10, 2025 23:16
Copilot finished work on behalf of benbp June 10, 2025 23:17
@benbp benbp marked this pull request as ready for review June 11, 2025 00:35
Copilot AI review requested due to automatic review settings June 11, 2025 00:35
@benbp benbp requested a review from a team as a code owner June 11, 2025 00:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR ensures that custom conditions in Azure Pipeline YAML files properly respect a canceled pipeline state by incorporating succeeded() checks into the conditions.

  • Updated conditions in apiview-review-gen-typespec.yml and apiview-review-gen-cadl.yml to include succeeded() with existing checks.
  • Updated conditions in detect-api-changes.yml and perf.yml to prepend succeeded() to the conditional expressions.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
eng/pipelines/apiview-review-gen-typespec.yml Added succeeded() to conditions for Reviews and APIViewURL.
eng/pipelines/apiview-review-gen-cadl.yml Added succeeded() to conditions for Reviews and APIViewURL.
eng/common/pipelines/templates/steps/detect-api-changes.yml Prepended succeeded() to the condition to enforce cancellation checks.
eng/common/pipelines/templates/jobs/perf.yml Prepended succeeded() to the condition for Profile parameter.

Copy link
Member

@benbp benbp left a comment

Choose a reason for hiding this comment

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

LGTM. I checked all other spots and it pretty much got it right and excluded the ones that don't fit.

@benbp benbp added the Central-EngSys This issue is owned by the Engineering System team. label Jun 12, 2025
@benbp benbp moved this from 🤔 Triage to 🔬 Dev in PR in Azure SDK EngSys ❄️🎄🎁🎅✨ Jun 12, 2025
Copilot AI changed the title Update custom Azure pipeline YAML conditions to respect canceled status Update custom Azure pipeline YAML conditions to respect canceled status and remove obsolete CADL files Aug 4, 2025
Copilot AI requested a review from praveenkuttappan August 4, 2025 21:12
@benbp benbp force-pushed the copilot/fix-10836-2 branch from d853401 to 1deea74 Compare August 4, 2025 21:28
@benbp
Copy link
Member

benbp commented Aug 4, 2025

/azp run azure-sdk-tools - sync - eng-common

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@azure-sdk
Copy link
Collaborator

The following pipelines have been queued for testing:
java - template
java - template - tests
js - template
net - template
net - template - tests
python - template
python - template - tests
You can sign off on the approval gate to test the release stage of each pipeline.
See eng/common workflow

@benbp
Copy link
Member

benbp commented Aug 4, 2025

/azp run azure-sdk-tools - sync - eng-common

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@azure-sdk
Copy link
Collaborator

The following pipelines have been queued for testing:
java - template
java - template - tests
js - template
net - template
net - template - tests
python - template
python - template - tests
You can sign off on the approval gate to test the release stage of each pipeline.
See eng/common workflow

@kurtzeborn kurtzeborn assigned benbp and unassigned benbp, Copilot and danieljurek Sep 9, 2025
@benbp benbp force-pushed the copilot/fix-10836-2 branch from 1deea74 to f0635a2 Compare September 30, 2025 21:48
@benbp
Copy link
Member

benbp commented Sep 30, 2025

/azp run azure-sdk-tools - sync - eng-common

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@azure-sdk
Copy link
Collaborator

The following pipelines have been queued for testing:
java - template
java - template - tests
js - template
net - template
net - template - tests
python - template
python - template - tests
You can sign off on the approval gate to test the release stage of each pipeline.
See eng/common workflow

azure-sdk added a commit to Azure/azure-sdk-for-js that referenced this pull request Oct 2, 2025
azure-sdk added a commit to Azure/azure-sdk-for-rust that referenced this pull request Oct 2, 2025
@benbp benbp merged commit 8207bf2 into main Oct 2, 2025
11 checks passed
@benbp benbp deleted the copilot/fix-10836-2 branch October 2, 2025 21:04
@kurtzeborn kurtzeborn moved this from 🔬 Dev in PR to 🎊 Closed in Azure SDK EngSys ❄️🎄🎁🎅✨ Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Central-EngSys This issue is owned by the Engineering System team.

Projects

Development

Successfully merging this pull request may close these issues.

Update custom azure pipeline yaml conditions to respect canceled status

5 participants