Skip to content

Check OneLocReleaseBranch at runtime instead of compile-time#7159

Merged
donnie-msft merged 6 commits intodevfrom
dev-donnie-msft-oneLocRelBranch
Feb 20, 2026
Merged

Check OneLocReleaseBranch at runtime instead of compile-time#7159
donnie-msft merged 6 commits intodevfrom
dev-donnie-msft-oneLocRelBranch

Conversation

@donnie-msft
Copy link
Copy Markdown
Contributor

@donnie-msft donnie-msft commented Feb 20, 2026

Bug

Fixes: https://github.com/NuGet/Client.Engineering/issues/3647

Description

A recent change made to our loc process was to only run for dev and a release branch designated in the OneLocReleaseBranch pipeline variable.

However, the YAML condition was written as a template expression, meaning runtime variables are not yet loaded by the ADO job. Therefore, the condition evaluated to false and did not pass RunOneLocBuild.

I've moved the check to the pipeline.yml with a runtime condition.

  • The official.yml will pass TryRunOneLocBuild: true to inject the stage at compile-time, and then the stage itself will condition on the branches at runtime.
    This way, PR builds don't see the stage at all (just to waste time evaluating the branch name and ultimately skipping running OneLoc on PR builds).
  • Compares directly against Build.SourceBranch to the OneLocReleaseBranch and tries trimming refs/heads/ in case someone puts that in the build variable at some point which would result in a localization issue otherwise.

Tested by switching the variable to one of my branches and running to ensure it can read the ADO variable: https://dev.azure.com/devdiv/DevDiv/_build/results?buildId=13359377&view=results

Will need cherry-pick to release-7.3.x.

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.

@donnie-msft donnie-msft requested a review from a team as a code owner February 20, 2026 20:01
Comment thread eng/pipelines/templates/pipeline.yml Outdated
jebriede
jebriede previously approved these changes Feb 20, 2026
Comment thread eng/pipelines/templates/pipeline.yml Outdated
Copy link
Copy Markdown
Member

@nkolev92 nkolev92 left a comment

Choose a reason for hiding this comment

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

Much simpler

@donnie-msft donnie-msft enabled auto-merge (squash) February 20, 2026 23:16
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.

4 participants