Skip to content

Use ONEESPT_BUILDTYPE for official vs unofficial detection#619

Merged
dagood merged 1 commit into
microsoft/mainfrom
dev/mclayton/oneespt-buildtype
Jun 1, 2026
Merged

Use ONEESPT_BUILDTYPE for official vs unofficial detection#619
dagood merged 1 commit into
microsoft/mainfrom
dev/mclayton/oneespt-buildtype

Conversation

@michelle-clayton-work
Copy link
Copy Markdown
Contributor

This pull request updates the logic for determining official vs. unofficial builds in the set-retain-build-var.yml pipeline step. The change switches the source of truth from a naming convention on Build.DefinitionName to the ONEESPT_BUILDTYPE environment variable, which is more reliable and consistent with other pipeline steps.

Pipeline reliability improvement:

  • eng/pipeline/steps/set-retain-build-var.yml: Updated the method for identifying official builds to use the ONEESPT_BUILDTYPE environment variable instead of relying on the case-sensitive and human-set Build.DefinitionName suffix. This prevents unofficial pipelines with non-conforming names from being incorrectly retained.

The original Build.DefinitionName.EndsWith("(unofficial)") check is

case-sensitive and depends on a human-set naming convention. A pipeline

whose name does not end with exactly that literal suffix would be

misclassified as official and retained forever.

Switch to $env:ONEESPT_BUILDTYPE, which is set by 1ES Pipeline Templates

and is already the source of truth used by docker-tools' validate-branch.yml

and set-dry-run.yml for the same decision.

Mirrors the equivalent fix already applied to microsoft/go-infra-images.
Copilot AI review requested due to automatic review settings June 1, 2026 20:07
@michelle-clayton-work michelle-clayton-work requested a review from a team as a code owner June 1, 2026 20:07
Copy link
Copy Markdown
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

Switches set-retain-build-var.yml from a brittle Build.DefinitionName suffix check to the 1ESPT-provided ONEESPT_BUILDTYPE environment variable for distinguishing official vs unofficial builds, matching the convention already used in validate-branch.yml and set-dry-run.yml.

Changes:

  • Replace Build.DefinitionName.EndsWith("(unofficial)") check with $env:ONEESPT_BUILDTYPE -ne "Unofficial".
  • Add explanatory comment about why the env-var-based approach is more reliable.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dagood dagood merged commit 548707c into microsoft/main Jun 1, 2026
30 checks passed
@dagood dagood deleted the dev/mclayton/oneespt-buildtype branch June 1, 2026 21:45
@dagood
Copy link
Copy Markdown
Member

dagood commented Jun 1, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants