Skip to content

fix(ado-pipelines): correct counter() to compile-time $(...) syntax - #22

Merged
ldastey-dev merged 1 commit into
mainfrom
fix/ado-counter-syntax
Jul 3, 2026
Merged

fix(ado-pipelines): correct counter() to compile-time $(...) syntax#22
ldastey-dev merged 1 commit into
mainfrom
fix/ado-counter-syntax

Conversation

@ldastey-dev

Copy link
Copy Markdown
Owner

Summary

Corrects the Azure DevOps counter() expression syntax in the Build Versioning section (§13.2) of standards/ado-pipelines.md.

The text recommended $[counter(...)] (runtime-expression syntax) for the pipeline run identifier. The counter() function used in the name / Build.BuildNumber field is a compile-time expression and must use $(counter(...)). The $[...] form is only valid for runtime expressions inside task bodies and is not evaluated when the name field is set at queue time — so the documented form would not work.

Why a separate PR

This one-line correction was intended for #14 but was accidentally pushed to a detached semver branch rather than the PR's fork branch, so it never merged. main still carried the buggy form. This PR lands the fix.

Change

$[counter(...)]$(counter(...)) (single line).

The Build Versioning section (§13.2) used runtime-expression syntax
$[counter(...)] for the pipeline run identifier. The counter() function in the
name/Build.BuildNumber field is a compile-time expression and must use
$(counter(...)); the $[...] form is only valid for runtime expressions in task
bodies and is not evaluated when the name field is set at queue time.

This correction was intended for PR #14 but was accidentally pushed to a
detached branch rather than the PR, so it never merged. This lands it on main.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 3, 2026 22:36

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

Updates the Azure DevOps pipeline build versioning guidance in standards/ado-pipelines.md, specifically the recommended counter() syntax used when describing name: / Build.BuildNumber queue-time evaluation.

Changes:

  • Replaced the documented counter() syntax in the “Automated versioning” guidance ($[counter(...)]$(counter(...))).

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

| Incompatible breaking change | Remove existing endpoint | `1.3.0 → 2.0.0` |

**Automated versioning.** Separate the two mechanisms. For the run identifier, prefer an automated source — `$[counter(...)]` for a monotonic build counter, or GitVersion where richer version derivation is needed — so `Build.BuildNumber` needs no manual maintenance. Reserve manual SemVer maintenance for the declared release/version variable (§13.1), where the MAJOR/MINOR/PATCH decision reflects a deliberate human judgement about the nature of the change that no counter can infer.
**Automated versioning.** Separate the two mechanisms. For the run identifier, prefer an automated source — `$(counter(...))` for a monotonic build counter, or GitVersion where richer version derivation is needed — so `Build.BuildNumber` needs no manual maintenance. Reserve manual SemVer maintenance for the declared release/version variable (§13.1), where the MAJOR/MINOR/PATCH decision reflects a deliberate human judgement about the nature of the change that no counter can infer.
@ldastey-dev
ldastey-dev merged commit 191f5d5 into main Jul 3, 2026
1 check passed
@ldastey-dev
ldastey-dev deleted the fix/ado-counter-syntax branch July 3, 2026 22:37
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.

2 participants