Skip to content

Follow up on GitHub tag build documentation and ref classification - #5201

Open
arturcic wants to merge 1 commit into
GitTools:mainfrom
arturcic:codex/5198-tag-build-follow-up
Open

Follow up on GitHub tag build documentation and ref classification#5201
arturcic wants to merge 1 commit into
GitTools:mainfrom
arturcic:codex/5198-tag-build-follow-up

Conversation

@arturcic

@arturcic arturcic commented Sep 10, 2026

Copy link
Copy Markdown
Member

Description

Follow-up to #5198, addressing the review feedback that remained after it merged:

  • Reuse ReferenceName.IsTag to classify the GitHub Actions tag reference instead of duplicating the tag-prefix check. ReferenceName is the shared reference-name value object; the backend-specific Tag represents a repository object.
  • Document how GITHUB_REF_TYPE and GITHUB_REF identify branch and tag builds, including manually dispatched historical tag builds and the local tag/HEAD matching requirement.

Why ReferenceName rather than Tag?

The suggestion was to reuse an existing value object for parsing and validation. At this point the build agent only has the GITHUB_REF string and needs to determine whether it names a tag. ReferenceName already owns that classification through IsTag, without requiring repository access.

GitVersion.Git.Tag is an internal implementation in the LibGit2Sharp backend. Its constructor requires a LibGit2Sharp.Tag, a diff object, and a repository cache; it represents an existing repository tag and resolves its target commit. It is not a parser for an environment-variable string. Using it here would couple the build-agent adapter to one Git backend and require repository objects for a reference-name check.

Using ReferenceName.IsTag therefore follows the intent of the suggestion while keeping the adapter independent of the Git backend. It preserves the existing ordinal tag-prefix classification; it does not claim to validate tag existence or perform full Git ref-name validation. GitPreparer remains responsible for finding the selected local tag and checking that its commit matches HEAD.

Related Issue

Follow-up to #5198, which resolved #4212.

Review feedback: reference-name classification and request for a follow-up.

How Has This Been Tested?

  • All 98 build-agent tests passed, including the existing tag/branch/PR environment cases.
  • Formatting verification for the changed C# file passed.
  • git diff --check passed.

The ref-classification change preserves the existing ordinal, case-sensitive tag-prefix behavior.

Copilot AI lite review requested due to automatic review settings September 10, 2026 12:56

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.

@arturcic
arturcic requested a review from asbjornu September 10, 2026 12:59
Copilot AI review requested due to automatic review settings September 10, 2026 13:15
@arturcic
arturcic force-pushed the codex/5198-tag-build-follow-up branch from 154996f to c3feea5 Compare September 10, 2026 13:15

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.

@sonarqubecloud

Copy link
Copy Markdown

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.

[ISSUE]: GitVersion crashes in GitHub Actions when an action is dispatched on a tag

2 participants