Skip to content

[ci] Fix empty conditional block breaking internal pipeline YAML - #37686

Merged
kubaflo merged 1 commit into
mainfrom
rmarinho-fix-empty-conditional-variables-yml
Aug 20, 2026
Merged

kubaflo merged 1 commit into
mainfrom
rmarinho-fix-empty-conditional-variables-yml

Conversation

@rmarinho

Copy link
Copy Markdown
Member

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Problem

The internal dotnet-maui official build currently fails to compile the pipeline YAML, before any stage runs:

/eng/pipelines/common/variables.yml (Line: 81, Col: 7): Expected at least one key-value pair in the mapping

Cause

#37589 removed - group: Publish-Build-Assets, but that group was the only child of the conditional that enclosed it, leaving an empty block behind:

    - group: AzureDevOps-Artifact-Feeds-Pats
    - ${{ if eq(variables['Build.DefinitionName'], 'dotnet-maui') }}:   # <- nothing under it

Azure DevOps requires a conditional insertion block to contain at least one entry, so template expansion fails outright.

Why PR validation stayed green

The empty block is nested inside an outer guard:

- ${{ if or(eq(variables['Build.DefinitionName'], 'dotnet-maui'), eq(variables['Build.DefinitionName'], 'dotnet-maui-build')) }}:
  - ${{ if notin(variables['Build.Reason'], 'PullRequest') }}:

For the public maui-pr definition that outer condition is false, so Azure DevOps short-circuits and never expands the inner block. The breakage is therefore invisible to PR CI and only manifests on the internal official build.

Fix

Remove the empty conditional. No file in the repository references the Publish-Build-Assets variable group any more, so it is deleted outright rather than repopulated.

Validation

  • eng/pipelines/common/variables.yml parses as valid YAML.
  • Swept all 39 YAML files under eng/pipelines/ for conditional blocks with no body — this was the only one.
  • grep for Publish-Build-Assets across eng/ and .github/ returns no remaining references.

This blocks the internal build entirely, so it is worth merging ahead of larger infra work such as #36257 (which carries the same one-line fix, but cannot be validated on the internal pipeline until this is on main).

PR #37589 removed `- group: Publish-Build-Assets`, which was the only
child of the `${{ if eq(variables['Build.DefinitionName'], 'dotnet-maui') }}`
conditional, but left the now-empty conditional header behind.

Azure DevOps requires a conditional insertion block to contain at least
one entry, so the internal `dotnet-maui` pipeline fails to compile the
pipeline YAML before running any stage:

    /eng/pipelines/common/variables.yml (Line: 81, Col: 7):
    Expected at least one key-value pair in the mapping

The public `maui-pr` definition is unaffected because the outer guard only
matches the `dotnet-maui` / `dotnet-maui-build` definition names, so the
block is never expanded there. That is why PR validation stayed green
while the official build was broken.

No other file references the `Publish-Build-Assets` variable group, so the
conditional is removed entirely rather than repopulated.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings August 20, 2026 17:10
@rmarinho
rmarinho temporarily deployed to copilot-pat-pool August 20, 2026 17:10 — with GitHub Actions Inactive
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 37686

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 37686"

@rmarinho
rmarinho temporarily deployed to copilot-pat-pool August 20, 2026 17:10 — with GitHub Actions Inactive
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

@rmarinho
rmarinho temporarily deployed to copilot-pat-pool August 20, 2026 17:11 — with GitHub Actions Inactive
@rmarinho
rmarinho temporarily deployed to copilot-pat-pool August 20, 2026 17:13 — with GitHub Actions Inactive
@rmarinho
rmarinho temporarily deployed to copilot-pat-pool August 20, 2026 17:14 — with GitHub Actions Inactive
@github-actions github-actions Bot added the area-infrastructure CI, Maestro / Coherency, upstream dependencies/versions label Aug 20, 2026
@rmarinho
rmarinho temporarily deployed to copilot-pat-pool August 20, 2026 17:14 — with GitHub Actions Inactive

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 fixes a YAML template compilation failure in the internal dotnet-maui official Azure DevOps pipeline by removing an empty conditional insertion block in the shared variables template.

Changes:

  • Removes an empty ${{ if ... }} conditional entry that had no children, which Azure DevOps rejects during template expansion.

@kubaflo
kubaflo merged commit d48c3ba into main Aug 20, 2026
39 checks passed
@kubaflo
kubaflo deleted the rmarinho-fix-empty-conditional-variables-yml branch August 20, 2026 21:37
@github-actions github-actions Bot added this to the .NET 10 SR11 milestone Aug 20, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 20, 2026

This branch was previously deployed

1 inactive deployment
copilot-pat-pool — 2e6e797c Deployed Aug 20, 2026 by rmarinho via conclusion #1446
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-infrastructure CI, Maestro / Coherency, upstream dependencies/versions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants