Skip to content

Conversation

@jestradaMS
Copy link
Contributor

@jestradaMS jestradaMS commented Jan 6, 2026

Description

This pull request improves the reliability and clarity of the PR environment cleanup process in the Azure DevOps pipelines. The changes enhance error handling and reporting in the resource group cleanup script, and ensure that key environment variables are computed and passed consistently using information from the triggering pipeline run.

Key improvements include:

Enhanced error handling and reporting in cleanup script:

  • Added tracking for successful, skipped, and failed resource group deletions in the cleanup script, with a summary output at the end and proper error signaling if any deletions fail. This makes it easier to identify issues during cleanup and ensures the process continues even if some deletions fail.

Consistent variable computation and propagation:

  • Updated the PR cleanup pipeline to compute environment variables (UniqueResourceGroupName, KeyVaultBaseName, DeploymentEnvironmentName) using the triggering pipeline's build information, ensuring consistency with the main deployment pipeline. These variables are now set and passed to downstream stages for reliable resource identification and cleanup.
  • Updated the pipeline to output and log the new variables, improving traceability and debugging.
  • Added new variables (UniqueResourceGroupName, KeyVaultBaseName) to the pipeline's variable list for use in subsequent jobs.

Improved logging for debugging:

  • Added logging of the triggering pipeline's runId for better traceability in the cleanup process.

Related issues

Addresses AB#180190.

Testing

Describe how this change was tested.

FHIR Team Checklist

  • Update the title of the PR to be succinct and less than 65 characters
  • Add a milestone to the PR for the sprint that it is merged (i.e. add S47)
  • Tag the PR with the type of update: Bug, Build, Dependencies, Enhancement, New-Feature or Documentation
  • Tag the PR with Open source, Azure API for FHIR (CosmosDB or common code) or Azure Healthcare APIs (SQL or common code) to specify where this change is intended to be released.
  • Tag the PR with Schema Version backward compatible or Schema Version backward incompatible or Schema Version unchanged if this adds or updates Sql script which is/is not backward compatible with the code.
  • When changing or adding behavior, if your code modifies the system design or changes design assumptions, please create and include an ADR.
  • CI is green before merge Build Status
  • Review squash-merge requirements

Semver Change (docs)

Patch|Skip|Feature|Breaking (reason)

@jestradaMS jestradaMS added this to the CY25Q3/2Wk13 milestone Jan 6, 2026
@jestradaMS jestradaMS requested a review from a team as a code owner January 6, 2026 22:45
@jestradaMS jestradaMS changed the title Enhance PR cleanup scripts with detailed logging and error handling Enhance PR cleanup scripts Jan 6, 2026
LTA-Thinking
LTA-Thinking previously approved these changes Jan 6, 2026
@jestradaMS
Copy link
Contributor Author

jestradaMS commented Jan 7, 2026

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jestradaMS jestradaMS disabled auto-merge January 7, 2026 01:08
@jestradaMS jestradaMS merged commit 893a5d8 into main Jan 7, 2026
62 checks passed
@jestradaMS jestradaMS deleted the users/jestrada/fix-pr-cleanup-buildid branch January 7, 2026 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants