Skip to content

Replace dotted Azure Pipelines variable names in v7 - #5227

Open
arturcic wants to merge 1 commit into
GitTools:mainfrom
arturcic:codex/5219-azure-variable-names
Open

arturcic wants to merge 1 commit into
GitTools:mainfrom
arturcic:codex/5219-azure-variable-names

Conversation

@arturcic

@arturcic arturcic commented Sep 17, 2026

Copy link
Copy Markdown
Member

Description

Replace dotted Azure Pipelines variable names with GitVersion_<Property> in v7.0 for both ordinary and isOutput=true outputs. For example, $(GitVersion.SemVer) becomes $(GitVersion_SemVer), and outputs['version.GitVersion.SemVer'] becomes outputs['version.GitVersion_SemVer']. Dotted output aliases are not retained.

Preserve both dotted and underscore build-number placeholders and existing environment-variable projection. Update adapter/MSBuild regression coverage, the Azure reference page, the v6-to-v7 migration guide, and BREAKING_CHANGES.md.

Related Issue

Resolves #5219

Motivation and Context

Use the 7.0 major-version boundary to align the core Azure adapter with the GitVersion_ naming convention. Existing dotted macro, expression, and dependency consumers must migrate. GitTools' Azure task already publishes underscore-prefixed/camel-case names from JSON; task support for GitVersion v7 remains separate work.

How Has This Been Tested?

  • BuildAgents: 107 passed.
  • MSBuild WriteVersionInfoTest: 11 passed.
  • Output FormatArgumentTests: 29 passed.
  • Markdown lint, reference-link checks, and diff whitespace checks passed.
  • Changed C# files passed formatting verification before rebase; rebase only required preserving both documentation reference links.
  • CodeRabbit review completed with no remaining findings.

Hosted Azure cross-job/stage execution and collision/read-only scenarios have not been run. This PR remains draft pending CI and integration validation.

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • Focused new and existing tests passed; full CI is pending.

Summary by CodeRabbit

  • Breaking Changes

    • Azure Pipelines variable outputs now use underscore-separated names, such as GitVersion_SemVer, instead of dotted names like GitVersion.SemVer.
    • Update pipeline macros, expressions, dependencies, templates, mappings, parsers, and task inputs when migrating from v6 to v7.
    • Existing conventions for environment variables, build-number placeholders, JSON, DotEnv, MSBuild, and other build agents remain unchanged.
  • Documentation

    • Added Azure DevOps configuration guidance, migration examples, output-variable usage, and links to relevant reference documentation.

@coderabbitai

coderabbitai Bot commented Sep 17, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 6209c397-430e-4e92-b475-0f5f33ab175c

📥 Commits

Reviewing files that changed from the base of the PR and between 5dc1c23 and fe0b7af.

📒 Files selected for processing (6)
  • BREAKING_CHANGES.md
  • docs/input/docs/migration/v6-to-v7.md
  • docs/input/docs/reference/build-servers/azure-devops.md
  • src/GitVersion.BuildAgents.Tests/Agents/AzurePipelinesTests.cs
  • src/GitVersion.BuildAgents/Agents/AzurePipelines.cs
  • src/GitVersion.MsBuild.Tests/Tasks/WriteVersionInfoTest.cs

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

Azure Pipelines output variables now use GitVersion_<Property> names instead of GitVersion.<Property>. Implementation tests verify ordinary and output-scoped variables. v7 migration and Azure DevOps documentation describe affected references and retained naming conventions.

Changes

Azure Pipeline Variables

Layer / File(s) Summary
Variable emission and validation
src/GitVersion.BuildAgents/Agents/AzurePipelines.cs, src/GitVersion.BuildAgents.Tests/Agents/AzurePipelinesTests.cs, src/GitVersion.MsBuild.Tests/Tasks/WriteVersionInfoTest.cs
Azure Pipelines emits underscore-separated ordinary and output-scoped variables. Tests cover nullable values, build-number references, direct task execution, MSBuild execution, and disabled build-number updates.
Migration and reference documentation
BREAKING_CHANGES.md, docs/input/docs/migration/v6-to-v7.md, docs/input/docs/reference/build-servers/azure-devops.md
Documentation describes the v6-to-v7 variable-name change, Azure Pipelines usage across jobs and stages, affected references, compatibility details, and migration resources.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~15 minutes

Change: Other

Suggested reviewers: asbjornu

Merge Risk: ⚪ Minimal · up to fe0b7

The Azure variable naming change is internally consistent and documented; the remaining hosted-integration scenarios are normal validation follow-up rather than an established merge-blocking risk.

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning Issue #5219 records a decision request, not approval to rename or remove dotted variables. It states that no renaming or removal is implied until the decision is made. The PR changes ordinary and outp… Record and accept the compatibility decision for #5219 before merging the breaking behavior. Add the required Azure Pipelines integration coverage for same-job, cross-job, and cross-stage consumers, including collision and read-only scenari…
Out of Scope Changes check ⚠️ Warning The adapter changes remove the existing dotted Azure Pipelines names and replace them with underscore names. Issue #5219 explicitly schedules a design decision and states that it does not approve rena… Do not merge the production rename or removal until #5219 records the selected option, release scope, and compatibility policy. If the decision selects replacement, update the issue and retain the migration documentation and tests as suppor…
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 3 files. (3 skipped: 3… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: replacing dotted Azure Pipelines variable names in v7.
Full details: Linked Issues check

Explanation

Issue #5219 records a decision request, not approval to rename or remove dotted variables. It states that no renaming or removal is implied until the decision is made. The PR changes ordinary and output variables to underscore names. The issue also requires validation of same-job, cross-job, and cross-stage behavior, plus macro, expression, environment, collision, and compatibility behavior. The PR summary confirms that hosted cross-job, cross-stage, collision, and read-only scenarios remain untested.

Resolution

Record and accept the compatibility decision for #5219 before merging the breaking behavior. Add the required Azure Pipelines integration coverage for same-job, cross-job, and cross-stage consumers, including collision and read-only scenarios, or document an accepted limitation in the issue and release contract.

Full details: Out of Scope Changes check

Explanation

The adapter changes remove the existing dotted Azure Pipelines names and replace them with underscore names. Issue #5219 explicitly schedules a design decision and states that it does not approve renaming or removal. The documentation and regression tests support the issue topic, but the production rename is outside the approved scope of the directly linked issue.

Resolution

Do not merge the production rename or removal until #5219 records the selected option, release scope, and compatibility policy. If the decision selects replacement, update the issue and retain the migration documentation and tests as supporting changes.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 3 files. (3 skipped: 3 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

@arturcic
arturcic marked this pull request as ready for review September 17, 2026 21:41
Copilot AI lite review requested due to automatic review settings September 17, 2026 21:41

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

Discuss replacing dotted Azure Pipelines output variable names

2 participants