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]: parameter "update-build-number=false" does not work #4437

Open
2 tasks done
enb-f opened this issue Feb 24, 2025 · 0 comments
Open
2 tasks done

[ISSUE]: parameter "update-build-number=false" does not work #4437

enb-f opened this issue Feb 24, 2025 · 0 comments

Comments

@enb-f
Copy link

enb-f commented Feb 24, 2025

Prerequisites

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

GitVersion package

GitVersion.Tool, gittools/actions

GitVersion version

6.0.5

Operating system

Linux

What are you seeing?

When starting a task in CI (Azure DevOps Service)

- task: gitversion/[email protected]
  name: execute_gitversion
  displayName: execute gitversion
  inputs: 
    useConfigFile: true
    configFilePath: './.gitversion.yaml'
    overrideConfig: |
      update-build-number=false

with "overrideConfig" param update-build-number=false, the task still updates the pipeline name

........
GitVersion executed successfully
Async Command Start: Update Build Number
Update build number to 1.1.1 for build 1416
Async Command End: Update Build Number
Finishing: execute gitversion
........

in .gitversion.yaml the parameter update-build-number: true is specified, but changing it also has no effect, the task still updates the name regardless of this

What is expected?

This should not change the build number

Steps to Reproduce

Use the following pipeline structure for Azure DevOps Service

steps:
- task: UseDotNet@2
  displayName: use dotnet
  inputs:
    packageType: 'sdk'
    version: '8.x'

- task: gitversion/[email protected]
  displayName: install gitversion
  inputs:
    versionSpec: '6.0.x'

- task: gitversion/[email protected]
  name: execute_gitversion
  displayName: execute gitversion
  inputs: 
    useConfigFile: true
    configFilePath: './.gitversion.yaml'
    overrideConfig: |
      update-build-number=false

configuration file .gitversion.yaml

assembly-versioning-scheme: MajorMinorPatch
assembly-file-versioning-scheme: MajorMinorPatch
tag-prefix: '[vV]?'
version-in-branch-pattern: (?<version>[vV]?\d+(\.\d+)?(\.\d+)?).*
major-version-bump-message: \+semver:\s?(breaking|major)
minor-version-bump-message: \+semver:\s?(feature|minor)
patch-version-bump-message: \+semver:\s?(fix|patch)
no-bump-message: \+semver:\s?(none|skip)
tag-pre-release-weight: 60000
commit-date-format: yyyy-MM-dd
merge-message-formats: {}
update-build-number: true
semantic-version-format: Strict
strategies:
- ConfiguredNextVersion
- Mainline
branches:
  main:
    mode: ContinuousDeployment
    label: ''
    increment: Patch
    prevent-increment:
      of-merged-branch: true
    track-merge-target: false
    track-merge-message: true
    regex: ^master$|^main$
    source-branches: []
    is-source-branch-for: []
    tracks-release-branches: false
    is-release-branch: false
    is-main-branch: true
    pre-release-weight: 55000
ignore:
  sha: []

RepositoryFixture Test

No response

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

2025-02-21T12:52:43.3389662Z ##[section]Starting: execute gitversion
2025-02-21T12:52:43.3395452Z ==============================================================================
2025-02-21T12:52:43.3395699Z Task         : Execute GitVersion Task
2025-02-21T12:52:43.3395770Z Description  : Easy Semantic Versioning (https://semver.org) for projects using Git
2025-02-21T12:52:43.3395868Z Version      : 3.1.11
2025-02-21T12:52:43.3395982Z Author       : GitTools Contributors
2025-02-21T12:52:43.3396054Z Help         : See the [documentation](https://gitversion.net/docs/) for help
2025-02-21T12:52:43.3396143Z ==============================================================================
2025-02-21T12:52:43.4368625Z Running on: 'Azure Pipelines'
2025-02-21T12:52:43.4380865Z Disable Telemetry
2025-02-21T12:52:43.4437502Z Command: git -C /home/vsts-agent/_work/3/s rev-parse --is-shallow-repository
2025-02-21T12:52:43.4545381Z Command: /home/vsts-agent/_work/_tool/GitVersion.Tool/6.0.5/dotnet-gitversion --roll-forward Major /home/vsts-agent/_work/3/s /output json /l console /config /home/vsts-agent/_work/3/s/.gitversion.yaml /overrideconfig update-build-number=false
2025-02-21T12:52:44.2838078Z GitVersion executed successfully
2025-02-21T12:52:44.2840575Z dotnet-gitversion Output:
2025-02-21T12:52:44.2840967Z -------------------
2025-02-21T12:52:44.2841532Z INFO [25-02-21 12:52:43:68] Working directory: /home/vsts-agent/_work/3/s
2025-02-21T12:52:44.2842000Z INFO [25-02-21 12:52:43:70] Project root is: /home/vsts-agent/_work/3/s/
2025-02-21T12:52:44.2842366Z INFO [25-02-21 12:52:43:70] DotGit directory is: /home/vsts-agent/_work/3/s/.git
2025-02-21T12:52:44.2842687Z INFO [25-02-21 12:52:43:70] Branch from build environment: refs/heads/main
2025-02-21T12:52:44.2843066Z INFO [25-02-21 12:52:43:70] -< Begin: Normalizing git directory for branch 'refs/heads/main' >-
2025-02-21T12:52:44.2843476Z   INFO [25-02-21 12:52:43:73] One remote found (origin -> 'https://<hidden>@dev.azure.com/<hidden>/infrastructure/_git/packer').
2025-02-21T12:52:44.2844024Z   INFO [25-02-21 12:52:43:74] Skipping fetching, if GitVersion does not calculate your version as expected you might need to allow fetching or use dynamic repositories
2025-02-21T12:52:44.2844727Z   INFO [25-02-21 12:52:43:74] Creating local branch main
2025-02-21T12:52:44.2845329Z   INFO [25-02-21 12:52:43:78] HEAD points at branch 'refs/heads/main'.
2025-02-21T12:52:44.2845805Z INFO [25-02-21 12:52:43:78] -< End: Normalizing git directory for branch 'refs/heads/main' (Took: 71.89ms) >-
2025-02-21T12:52:44.2846165Z INFO [25-02-21 12:52:43:79] Found configuration file at '/home/vsts-agent/_work/3/s/.gitversion.yaml'
2025-02-21T12:52:44.2846751Z INFO [25-02-21 12:52:43:84] -< Begin: Loading version variables from disk cache file /home/vsts-agent/_work/3/s/.git/gitversion_cache/148BA1953D3B4E7EC0CBBEE47DACDD3E41F79A81 >-
2025-02-21T12:52:44.2847243Z   INFO [25-02-21 12:52:43:84] Cache file /home/vsts-agent/_work/3/s/.git/gitversion_cache/148BA1953D3B4E7EC0CBBEE47DACDD3E41F79A81 not found.
2025-02-21T12:52:44.2847828Z INFO [25-02-21 12:52:43:84] -< End: Loading version variables from disk cache file /home/vsts-agent/_work/3/s/.git/gitversion_cache/148BA1953D3B4E7EC0CBBEE47DACDD3E41F79A81 (Took: 0.18ms) >-
2025-02-21T12:52:44.2848261Z INFO [25-02-21 12:52:43:84] Found configuration file at '/home/vsts-agent/_work/3/s/.gitversion.yaml'
2025-02-21T12:52:44.2848581Z INFO [25-02-21 12:52:43:98] Using latest commit on specified branch
2025-02-21T12:52:44.2848903Z INFO [25-02-21 12:52:43:99] Getting tagged semantic versions. TagPrefix: [vV]? and Format: Strict
2025-02-21T12:52:44.2849311Z INFO [25-02-21 12:52:44:05] Running against branch: main ('3eb5464' - fix(build): error 'The repository is shallow')
2025-02-21T12:52:44.2849831Z INFO [25-02-21 12:52:44:05] -< Begin: Fetching the base versions for version calculation... >-
2025-02-21T12:52:44.2850159Z   INFO [25-02-21 12:52:44:06] Calculating base versions for 'main'
2025-02-21T12:52:44.2850499Z   INFO [25-02-21 12:52:44:06] -< Begin: [Using 'ConfiguredNextVersionVersionStrategy' strategy] >-
2025-02-21T12:52:44.2851093Z   INFO [25-02-21 12:52:44:06] -< End: [Using 'ConfiguredNextVersionVersionStrategy' strategy] (Took: 0.57ms) >-
2025-02-21T12:52:44.2851431Z   INFO [25-02-21 12:52:44:06] -< Begin: [Using 'MainlineVersionStrategy' strategy] >-
2025-02-21T12:52:44.2851949Z     INFO [25-02-21 12:52:44:07] -< Begin: Getting tagged semantic versions on branch 'refs/heads/main'. TagPrefix: [vV]? and Format: Strict >-
2025-02-21T12:52:44.2852604Z     INFO [25-02-21 12:52:44:07] -< End: Getting tagged semantic versions on branch 'refs/heads/main'. TagPrefix: [vV]? and Format: Strict (Took: 2.66ms) >-
2025-02-21T12:52:44.2853013Z     INFO [25-02-21 12:52:44:08] -< Begin: Finding branches source of 'main' >-
2025-02-21T12:52:44.2853349Z     INFO [25-02-21 12:52:44:09] -< End: Finding branches source of 'main' (Took: 5.71ms) >-
2025-02-21T12:52:44.2853755Z     INFO [25-02-21 12:52:44:12] CommitOnTrunk: Force version increment '1.1.0' +semver 'Patch' with label '' based on commit '2424dc7'.
2025-02-21T12:52:44.2854252Z   INFO [25-02-21 12:52:44:12] -< End: [Using 'MainlineVersionStrategy' strategy] (Took: 59.77ms) >-
2025-02-21T12:52:44.2854707Z   INFO [25-02-21 12:52:44:12] -< Begin: [Using 'MergeMessageVersionStrategy' strategy] >-
2025-02-21T12:52:44.2855136Z   INFO [25-02-21 12:52:44:12] -< End: [Using 'MergeMessageVersionStrategy' strategy] (Took: 1.33ms) >-
2025-02-21T12:52:44.2855507Z   INFO [25-02-21 12:52:44:12] -< Begin: [Using 'TaggedCommitVersionStrategy' strategy] >-
2025-02-21T12:52:44.2855868Z   INFO [25-02-21 12:52:44:12] -< End: [Using 'TaggedCommitVersionStrategy' strategy] (Took: 0.84ms) >-
2025-02-21T12:52:44.2856287Z   INFO [25-02-21 12:52:44:12] -< Begin: [Using 'TrackReleaseBranchesVersionStrategy' strategy] >-
2025-02-21T12:52:44.2856772Z   INFO [25-02-21 12:52:44:12] -< End: [Using 'TrackReleaseBranchesVersionStrategy' strategy] (Took: 0.51ms) >-
2025-02-21T12:52:44.2857141Z   INFO [25-02-21 12:52:44:12] -< Begin: [Using 'VersionInBranchNameVersionStrategy' strategy] >-
2025-02-21T12:52:44.2857734Z   INFO [25-02-21 12:52:44:12] -< End: [Using 'VersionInBranchNameVersionStrategy' strategy] (Took: 0.28ms) >-
2025-02-21T12:52:44.2858126Z INFO [25-02-21 12:52:44:12] -< End: Fetching the base versions for version calculation... (Took: 66.82ms) >-
2025-02-21T12:52:44.2858473Z INFO [25-02-21 12:52:44:12] -------------------------------------------------------
2025-02-21T12:52:44.2858841Z INFO [25-02-21 12:52:44:12] Base version used: CommitOnTrunk: Take '1.1.0' based on commit '2424dc7'.
2025-02-21T12:52:44.2859312Z INFO [25-02-21 12:52:44:12] -------------------------------------------------------
2025-02-21T12:52:44.2859769Z INFO [25-02-21 12:52:44:12] -< Begin: Using continuous deployment workflow to calculate the incremented version. >-
2025-02-21T12:52:44.2860384Z   INFO [25-02-21 12:52:44:13] 1 commits found between '2424dc7' - Merged PR 32: feat: packer validate, semver in description, update win .iso, refactor ci and '3eb5464' - fix(build): error 'The repository is shallow'
2025-02-21T12:52:44.2860872Z INFO [25-02-21 12:52:44:13] -< End: Using continuous deployment workflow to calculate the incremented version. (Took: 2.23ms) >-
2025-02-21T12:52:44.2861259Z INFO [25-02-21 12:52:44:13] Found configuration file at '/home/vsts-agent/_work/3/s/.gitversion.yaml'
2025-02-21T12:52:44.2861706Z INFO [25-02-21 12:52:44:13] -< Begin: Write version variables to cache file /home/vsts-agent/_work/3/s/.git/gitversion_cache/148BA1953D3B4E7EC0CBBEE47DACDD3E41F79A81 >-
2025-02-21T12:52:44.2862231Z INFO [25-02-21 12:52:44:17] -< End: Write version variables to cache file /home/vsts-agent/_work/3/s/.git/gitversion_cache/148BA1953D3B4E7EC0CBBEE47DACDD3E41F79A81 (Took: 37.28ms) >-
2025-02-21T12:52:44.2862748Z INFO [25-02-21 12:52:44:17] Found configuration file at '/home/vsts-agent/_work/3/s/.gitversion.yaml'
2025-02-21T12:52:44.2862957Z {
2025-02-21T12:52:44.2863145Z   "AssemblySemFileVer": "1.1.1.0",
2025-02-21T12:52:44.2863376Z   "AssemblySemVer": "1.1.1.0",
2025-02-21T12:52:44.2863558Z   "BranchName": "main",
2025-02-21T12:52:44.2863887Z   "BuildMetaData": null,
2025-02-21T12:52:44.2864184Z   "CommitDate": "2025-02-21",
2025-02-21T12:52:44.2864376Z   "CommitsSinceVersionSource": 1,
2025-02-21T12:52:44.2864526Z   "EscapedBranchName": "main",
2025-02-21T12:52:44.2864727Z   "FullBuildMetaData": "Branch.main.Sha.3eb54649b5106ec4b93fd7d8e44dad4a0afe7528",
2025-02-21T12:52:44.2864920Z   "FullSemVer": "1.1.1",
2025-02-21T12:52:44.2865122Z   "InformationalVersion": "1.1.1+Branch.main.Sha.3eb54649b5106ec4b93fd7d8e44dad4a0afe7528",
2025-02-21T12:52:44.2865311Z   "Major": 1,
2025-02-21T12:52:44.2865505Z   "MajorMinorPatch": "1.1.1",
2025-02-21T12:52:44.2865674Z   "Minor": 1,
2025-02-21T12:52:44.2865812Z   "Patch": 1,
2025-02-21T12:52:44.2865954Z   "PreReleaseLabel": "",
2025-02-21T12:52:44.2866098Z   "PreReleaseLabelWithDash": "",
2025-02-21T12:52:44.2866258Z   "PreReleaseNumber": null,
2025-02-21T12:52:44.2866408Z   "PreReleaseTag": "",
2025-02-21T12:52:44.2866558Z   "PreReleaseTagWithDash": "",
2025-02-21T12:52:44.2866715Z   "SemVer": "1.1.1",
2025-02-21T12:52:44.2866884Z   "Sha": "3eb54649b5106ec4b93fd7d8e44dad4a0afe7528",
2025-02-21T12:52:44.2867070Z   "ShortSha": "3eb5464",
2025-02-21T12:52:44.2867224Z   "UncommittedChanges": 0,
2025-02-21T12:52:44.2867404Z   "VersionSourceSha": "2424dc7f444620e24e60866d5a8f5a4945cdf6c5",
2025-02-21T12:52:44.2867581Z   "WeightedPreReleaseNumber": 60000
2025-02-21T12:52:44.2867724Z }
2025-02-21T12:52:44.2867771Z 
2025-02-21T12:52:44.2867950Z -------------------
2025-02-21T12:52:44.2868882Z GitVersion executed successfully
2025-02-21T12:52:44.2872092Z ##[section]Async Command Start: Update Build Number
2025-02-21T12:52:44.7552578Z Update build number to 1.1.1 for build 1416
2025-02-21T12:52:44.7552871Z ##[section]Async Command End: Update Build Number
2025-02-21T12:52:44.7554303Z ##[section]Finishing: execute gitversion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant