Skip to content

Get-BuildVariable: inconsistent commit message detection #109

Description

@peppekerstens

Build environment
Azure Devops

Tested
PS5.1/PS6core
build stage

Issue
the commit message detection code (https://github.com/RamblingCookieMonster/BuildHelpers/blob/303eebee0bf92f9e086f131d89cf478a6ff87275/BuildHelpers/Public/Get-BuildVariable.ps1#L154) fails on detecting 'BUILD_SOURCEVERSIONMESSAGE'

root cause
After testing, the root cause seems to be two-fold:
Cause 1:

  1. 'SYSTEM_DEFAULTWORKINGDIRECTORY' exists in both the BUILD and RELEASE stages of Azure DevOps. In both cases the default value are the 'artifacts' directories of the used agents (d:\a\r1\a when using hosted agents). So they are directory paths(!)
  2. Somehow, PS does not obey the order of the 'switch' command anymore; it 'hits' on 'SYSTEM_DEFAULTWORKINGDIRECTORY' instead of 'BUILD_SOURCEVERSIONMESSAGE'. This is a PS 'thing' and beyond the scope of this issue.

Cause 2:
The detection does not obey the provided path parameter. I will create separate issue (#110) for this.

solution
The simplest solution is to use 'AGENT_RELEASEDIRECTORY' instead of 'SYSTEM_DEFAULTWORKINGDIRECTORY'.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions