Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE]: Unable To Run Commands On Azure DevOps #1336

Closed
2 tasks done
bendursley opened this issue Nov 13, 2024 · 7 comments
Closed
2 tasks done

[ISSUE]: Unable To Run Commands On Azure DevOps #1336

bendursley opened this issue Nov 13, 2024 · 7 comments

Comments

@bendursley
Copy link

Prerequisites

  • I have written a descriptive issue title
  • I have searched issues to ensure it has not already been reported

GitVersion package

AzureDevops task

GitVersion version

6.0.0 - 6.0.5

Operating system

Windows, Linux

What are you seeing?

We've got a set up where we use a GitVersion YML template file. We've been on v0 of the ADO tasks and 5.12 spec for quite some time and have finally upgrades to v3 \ 6.x, but now we're just getting 'Command Failed' on both Ubuntu and Windows, and the error messages aren't clear to the issue.

Command: C:\hostedtoolcache\windows\GitVersion.Tool\6.0.5\dotnet-gitversion.exe D:/a/1/s /output json /output buildserver /config D:\a\1\s\pipelines\GitVersion.yml /updateassemblyinfo

##[error]Command failed: C:\hostedtoolcache\windows\GitVersion.Tool\6.0.5\dotnet-gitversion.exe D:/a/1/s /output json /output buildserver /config D:\a\1\s\pipelines\GitVersion.yml /updateassemblyinfo
      - task: gitversion/setup@3
        displayName: 'Install GitVersion dotnet tool'
        inputs:
          versionSpec: '${{ parameters.GitVersionVersion }}' ##6.0.5

      - task: gitversion/execute@3
        displayName: 'Run GitVersion'
        inputs:
          useConfigFile: true
          configFilePath: '${{ parameters.GitVersionConfigurationPath }}'
          updateAssemblyInfo: true

What is expected?

Git Version correctly runs

Steps to Reproduce

Above tasks cause an issue, using them

RepositoryFixture Test

No response

Output log or link to your CI build (if appropriate).

Starting: Install GitVersion dotnet tool

==============================================================================

Task : Setup GitVersion Task

Description : Easy Semantic Versioning (https://semver.org) for projects using Git

Version : 3.0.0

Author : GitTools Contributors

Help : See the [documentation](https://gitversion.net/docs/) for help

==============================================================================

Running on: 'Azure Pipelines'

Disable Telemetry

--------------------------

Acquiring GitVersion.Tool for version spec: 6.0.5

--------------------------

Looking for local tool [email protected]

Directory C:\hostedtoolcache\windows\GitVersion.Tool\6.0.5 not found

Command: dotnet tool install GitVersion.Tool --tool-path D:\a\_temp\23d2f512-567f-4398-9d20-ab40f2291c6f --version 6.0.5

--------------------------

GitVersion.Tool version: 6.0.5 installed.

--------------------------

Prepending C:\hostedtoolcache\windows\GitVersion.Tool\6.0.5 to PATH

Updated PATH: C:\hostedtoolcache\windows\GitVersion.Tool\6.0.5;C:\Users\VssAdministrator\.dotnet\tools;C:\hostedtoolcache\windows/dotnet;C:\agents\3.246.0\externals\git\cmd;C:\agents\3.246.0\externals\git\mingw64\bin;C:\Program Files\MongoDB\Server\5.0\bin;C:\aliyun-cli;C:\vcpkg;C:\Program Files (x86)\NSIS\;C:\tools\zstd;C:\Program Files\Mercurial\;C:\hostedtoolcache\windows\stack\3.1.1\x64;C:\cabal\bin;C:\\ghcup\bin;C:\mingw64\bin;C:\Program Files\dotnet;C:\Program Files\MySQL\MySQL Server 8.0\bin;C:\Program Files\R\R-4.4.1\bin\x64;C:\SeleniumWebDrivers\GeckoDriver;C:\SeleniumWebDrivers\EdgeDriver\;C:\SeleniumWebDrivers\ChromeDriver;C:\Program Files (x86)\sbt\bin;C:\Program Files (x86)\GitHub CLI;C:\Program Files\Git\bin;C:\Program Files (x86)\pipx_bin;C:\npm\prefix;C:\hostedtoolcache\windows\go\1.21.13\x64\bin;C:\hostedtoolcache\windows\Python\3.9.13\x64\Scripts;C:\hostedtoolcache\windows\Python\3.9.13\x64;C:\hostedtoolcache\windows\Ruby\3.0.7\x64\bin;C:\Program Files\OpenSSL\bin;C:\tools\kotlinc\bin;C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\8.0.432-6\x64\bin;C:\Program Files\ImageMagick-7.1.1-Q16-HDRI;C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin;C:\ProgramData\kind;C:\ProgramData\Chocolatey\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\PowerShell\7\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files (x86)\WiX Toolset v3.14\bin;C:\Program Files\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\Microsoft SQL Server\160\DTS\Binn\;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\ProgramData\chocolatey\lib\pulumi\tools\Pulumi\bin;C:\Program Files\CMake\bin;C:\ProgramData\chocolatey\lib\maven\apache-maven-3.8.7\bin;C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code;C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Program Files\GitHub CLI\;c:\tools\php;C:\Program Files (x86)\sbt\bin;C:\Program Files\Amazon\AWSCLIV2\;C:\Program Files\Amazon\SessionManagerPlugin\bin\;C:\Program Files\Amazon\AWSSAMCLI\bin\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\LLVM\bin;C:\Users\VssAdministrator\.dotnet\tools;C:\Users\VssAdministrator\.cargo\bin;C:\Users\VssAdministrator\AppData\Local\Microsoft\WindowsApps

Set GITVERSION_PATH to C:\hostedtoolcache\windows\GitVersion.Tool\6.0.5

GitVersion installed successfully


Starting: Run GitVersion
==============================================================================

Task : Execute GitVersion Task

Description : Easy Semantic Versioning (https://semver.org) for projects using Git

Version : 3.0.0

Author : GitTools Contributors

Help : See the [documentation](https://gitversion.net/docs/) for help

==============================================================================

Running on: 'Azure Pipelines'

Disable Telemetry

Executing GitVersion

Command: git -C D:/a/1/s rev-parse --is-shallow-repository

Command: C:\hostedtoolcache\windows\GitVersion.Tool\6.0.5\dotnet-gitversion.exe D:/a/1/s /output json /output buildserver /config D:\a\1\s\pipelines\GitVersion.yml /updateassemblyinfo

##[error]Command failed: C:\hostedtoolcache\windows\GitVersion.Tool\6.0.5\dotnet-gitversion.exe D:/a/1/s /output json /output buildserver /config D:\a\1\s\pipelines\GitVersion.yml /updateassemblyinfo

Finishing: Run GitVersion
@arturcic arturcic transferred this issue from GitTools/GitVersion Nov 13, 2024
@DaleMckeown
Copy link

DaleMckeown commented Nov 14, 2024

I am also having this issue. I am upgrading from gitversion/execute@0 to gitversion/execute@3 due to Node10 deprecation warnings in my pipelines.

- task: gitversion/setup@3
  displayName: GitVersion Install
  inputs:
    versionSpec: '6.x'

- task: gitversion/execute@3
  displayName: GitVersion Execute
  inputs:
    useConfigFile: true
    configFilePath: $(gitVersionFileLocation)

gitVersionFileLocation points to the correct location of my GitVersion.yml file.

Error:

##[error]Command failed: /opt/hostedtoolcache/GitVersion.Tool/6.0.5/dotnet-gitversion /home/vsts/work/1/s /output json /output buildserver /config /home/vsts/work/1/s/UoL.AspNetCore/Automation/GitVersion.yml

EDIT:

For me at least it seems to be a problem with the v6 spec. Targetting v5 works as expected:

- task: gitversion/setup@3
  displayName: GitVersion Install
  inputs:
    versionSpec: '5.x'

@bendursley
Copy link
Author

bendursley commented Nov 15, 2024

Yup, I've just gone back to try that (it didn't work first time) but looks like it has this time round, targeting 5.x (Downloading 5.12)

Edit - just tried it on a different service with a large number of branches, and it failed with the error 'stdout maxBuffer length exceeded', so looks like it doesn't always work with v3 / 5.x

@arturcic
Copy link
Member

Closed by #1278

@bendursley
Copy link
Author

@arturcic I've tried the new version (3.0.2) and it worked at v3 / 5.12, for one of our repos.

However, it still failed with the buffer issue for another one. That one has got a lot of stale release branches (around 100 or so) - is the recommendation to clean up or tag them off, to reduce the amount of work the tool has to do?

@arturcic
Copy link
Member

@bendursley yes, that is the recommendation, that will also speed up the running time of the tool as well

@bendursley
Copy link
Author

@arturcic Will tagging the release branches off be ok? Or will that leave us in the same situation? (IE - we should just delete the release branches) Thanks for your help!

@arturcic
Copy link
Member

tagging might help in terms of finding the version base, but that could still not improve much the max buffer situation, better to clean it up if possible

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

No branches or pull requests

3 participants