我们拥有主人,并发展分支机构。大师目前为1.0.0。
从开发开始,我已经分支了一个新分支,进行了一些小的更改,然后将next-version属性更改为1.0.0。当我发出请求时,我希望GitVersion将其计算为1.0.1或类似的值,但是由于某种原因,它总是会将其提高到2.0.0。
我尝试在拥有+semver: major
的同时使用next-version 0.0.1
,但这并没有将其从0.9.0提高到1.0.0。
我尝试使用下一个版本0.9.9。 GitVersion将其增加到0.10.0
我尝试使用下一版本1.0.0。 GitVersion将其提高到2.0.0。
我的猜测是,问题出在我的GitVersion.yml中,或者我如何使用GitVersion ...
next-version: 1.0.1
branches:
master:
regex: master
mode: ContinuousDelivery
tag: ''
increment: Minor
prevent-increment-of-merged-branch-version: true
track-merge-target: false
tracks-release-branches: false
is-release-branch: false
release:
regex: release(s)?[/-]
mode: ContinuousDelivery
tag: beta
increment: Minor
prevent-increment-of-merged-branch-version: true
track-merge-target: false
tracks-release-branches: false
is-release-branch: true
feature:
regex: feature(s)?[/-]
mode: ContinuousDelivery
tag: alpha.{BranchName}
increment: Inherit
prevent-increment-of-merged-branch-version: false
track-merge-target: false
tracks-release-branches: false
is-release-branch: false
pull-request:
regex: (pull|pull\-requests|pr)[/-]
mode: ContinuousDelivery
tag: PullRequest
increment: Inherit
prevent-increment-of-merged-branch-version: false
tag-number-pattern: '[/-](?<number>\d+)[-/]'
track-merge-target: false
tracks-release-branches: false
is-release-branch: false
develop:
regex: dev(elop)?(ment)?$
mode: ContinuousDeployment
tag: alpha
increment: Minor
prevent-increment-of-merged-branch-version: false
track-merge-target: true
tracks-release-branches: true
is-release-branch: false
我原本希望有可能将其发展为……1.0.1或1.1.0或类似版本。
相反,我得到的只是将主要碰撞提高到2.0.0。
这是我最新尝试的输出,带有下一版本1.0.0:
##[section]Starting: GitVersion
==============================================================================
Task : GitVersion Task
Description : Easy Semantic Versioning (http://semver.org) for projects using Git
Version : 4.0.3
Author : GitVersion Contributors
Help : See the [documentation](http://gitversion.readthedocs.org/en/latest/) for help
==============================================================================
[command]C:\ProgramData\Chocolatey\bin\GitVersion.exe D:\a\1\s /output buildserver /nofetch /updateassemblyinfo true
INFO [08/30/19 14:41:06:51] Working directory: D:\a\1\s
INFO [08/30/19 14:41:06:54] IsDynamicGitRepository: False
INFO [08/30/19 14:41:07:07] Returning Project Root from DotGitDirectory: D:\a\1\s\.git - D:\a\1\s
INFO [08/30/19 14:41:07:07] Running on Windows.
INFO [08/30/19 14:41:07:07] Applicable build agent found: 'VsoAgent'.
INFO [08/30/19 14:41:07:07] Branch from build environment: refs/pull/31377/merge
INFO [08/30/19 14:41:07:08] Begin: Normalizing git directory for branch 'refs/pull/31377/merge'
INFO [08/30/19 14:41:07:16] One remote found (origin -> '<foobar>').
INFO [08/30/19 14:41:07:18] Skipping fetching, if GitVersion does not calculate your version as expected you might need to allow fetching or use dynamic repositories
INFO [08/30/19 14:41:07:62] Creating local branch refs/heads/pull/31377/merge pointing at 04339992208324c21a1ebcb5f2abbdd9f3d7906e
INFO [08/30/19 14:41:07:67] Creating local branch from remote tracking 'refs/remotes/origin/create-application-without-manifest'.
INFO [08/30/19 14:41:07:70] Creating local branch from remote tracking 'refs/remotes/origin/develop'.
INFO [08/30/19 14:41:07:70] Creating local branch from remote tracking 'refs/remotes/origin/feature/some-branch-name'.
INFO [08/30/19 14:41:07:70] Creating local branch from remote tracking 'refs/remotes/origin/master'.
INFO [08/30/19 14:41:07:71] HEAD points at branch 'refs/heads/pull/31377/merge'.
INFO [08/30/19 14:41:07:71] End: Normalizing git directory for branch 'refs/pull/31377/merge' (Took: 628.41ms)
INFO [08/30/19 14:41:07:71] IsDynamicGitRepository: False
INFO [08/30/19 14:41:07:71] Returning Project Root from DotGitDirectory: D:\a\1\s\.git - D:\a\1\s
INFO [08/30/19 14:41:07:71] Project root is: D:\a\1\s
INFO [08/30/19 14:41:07:71] DotGit directory is: D:\a\1\s\.git
INFO [08/30/19 14:41:07:71] IsDynamicGitRepository: False
INFO [08/30/19 14:41:07:71] Returning Project Root from DotGitDirectory: D:\a\1\s\.git - D:\a\1\s
INFO [08/30/19 14:41:07:73] Begin: Loading version variables from disk cache
INFO [08/30/19 14:41:07:73] Cache file D:\a\1\s\.git\gitversion_cache\CE0AE3C9137253E65D3608329BB0061CFF5305C7.yml not found.
INFO [08/30/19 14:41:07:73] End: Loading version variables from disk cache (Took: 0.00ms)
INFO [08/30/19 14:41:07:73] IsDynamicGitRepository: False
INFO [08/30/19 14:41:07:73] Returning Project Root from DotGitDirectory: D:\a\1\s\.git - D:\a\1\s
INFO [08/30/19 14:41:07:92] Using latest commit on specified branch
INFO [08/30/19 14:41:07:92] Begin: Attempting to inherit branch configuration from parent branch
INFO [08/30/19 14:41:07:93] HEAD is merge commit, this is likely a pull request using feature/some-branch-name as base
INFO [08/30/19 14:41:07:93] Begin: Finding branch source of 'feature/some-branch-name'
INFO [08/30/19 14:41:07:96] Begin: Finding merge base between 'feature/some-branch-name' and 'develop'.
INFO [08/30/19 14:41:07:96] Found merge base of 6072f970bd748d1464f04314e290bd67c1b41f4d
INFO [08/30/19 14:41:07:98] Merge base of feature/some-branch-name' and 'develop is 6072f970bd748d1464f04314e290bd67c1b41f4d
INFO [08/30/19 14:41:07:98] End: Finding merge base between 'feature/some-branch-name' and 'develop'. (Took: 15.62ms)
INFO [08/30/19 14:41:07:98] Begin: Finding merge base between 'feature/some-branch-name' and 'master'.
INFO [08/30/19 14:41:07:98] Found merge base of 335272315abebd4b71d7891ce34010a9462075bb
INFO [08/30/19 14:41:07:98] Merge base of feature/some-branch-name' and 'master is 335272315abebd4b71d7891ce34010a9462075bb
INFO [08/30/19 14:41:07:98] End: Finding merge base between 'feature/some-branch-name' and 'master'. (Took: 0.00ms)
INFO [08/30/19 14:41:07:98] Begin: Finding merge base between 'feature/some-branch-name' and 'origin/develop'.
INFO [08/30/19 14:41:07:98] Found merge base of 6072f970bd748d1464f04314e290bd67c1b41f4d
INFO [08/30/19 14:41:07:98] Merge base of feature/some-branch-name' and 'origin/develop is 6072f970bd748d1464f04314e290bd67c1b41f4d
INFO [08/30/19 14:41:07:98] End: Finding merge base between 'feature/some-branch-name' and 'origin/develop'. (Took: 0.00ms)
INFO [08/30/19 14:41:07:98] Begin: Finding merge base between 'feature/some-branch-name' and 'origin/master'.
INFO [08/30/19 14:41:07:98] Found merge base of 335272315abebd4b71d7891ce34010a9462075bb
INFO [08/30/19 14:41:07:98] Merge base of feature/some-branch-name' and 'origin/master is 335272315abebd4b71d7891ce34010a9462075bb
INFO [08/30/19 14:41:07:98] End: Finding merge base between 'feature/some-branch-name' and 'origin/master'. (Took: 0.00ms)
INFO [08/30/19 14:41:07:99] Multiple source branches have been found, picking the first one (develop).
This may result in incorrect commit counting.
Options were:
develop, origin/develop, master, origin/master
INFO [08/30/19 14:41:07:99] End: Finding branch source of 'feature/some-branch-name' (Took: 62.50ms)
INFO [08/30/19 14:41:07:99] Begin: Getting branches containing the commit '6072f970bd748d1464f04314e290bd67c1b41f4d'.
INFO [08/30/19 14:41:07:99] Trying to find direct branches.
INFO [08/30/19 14:41:07:99] Direct branch found: 'develop'.
INFO [08/30/19 14:41:07:99] End: Getting branches containing the commit '6072f970bd748d1464f04314e290bd67c1b41f4d'. (Took: 0.00ms)
INFO [08/30/19 14:41:07:99] Found possible parent branches: develop
INFO [08/30/19 14:41:07:99] End: Attempting to inherit branch configuration from parent branch (Took: 78.13ms)
INFO [08/30/19 14:41:07:99] Running against branch: pull/31377/merge (04339992208324c21a1ebcb5f2abbdd9f3d7906e)
INFO [08/30/19 14:41:08:01] Begin: Calculating base versions
INFO [08/30/19 14:41:08:02] Fallback base version: 0.1.0 with commit count source 8f456208b87a07033ecd5db42257c5162f8d054f (Incremented: None)
INFO [08/30/19 14:41:08:10] NextVersion in GitVersion configuration file: 1.0.0 with commit count source External Source (Incremented: None)
INFO [08/30/19 14:41:08:20] Base version used: NextVersion in GitVersion configuration file: 1.0.0 with commit count source 8f456208b87a07033ecd5db42257c5162f8d054f (Incremented: None)
INFO [08/30/19 14:41:08:20] End: Calculating base versions (Took: 188.65ms)
INFO [08/30/19 14:41:08:21] 73 commits found between 8f456208b87a07033ecd5db42257c5162f8d054f and 04339992208324c21a1ebcb5f2abbdd9f3d7906e
INFO [08/30/19 14:41:08:21] Begin: Getting version tags from branch 'refs/heads/pull/31377/merge'.
INFO [08/30/19 14:41:08:21] End: Getting version tags from branch 'refs/heads/pull/31377/merge'. (Took: 0.00ms)
INFO [08/30/19 14:41:08:23] Begin: Creating dictionary
INFO [08/30/19 14:41:08:24] End: Creating dictionary (Took: 15.60ms)
INFO [08/30/19 14:41:08:24] Begin: Storing version variables to cache file D:\a\1\s\.git\gitversion_cache\CE0AE3C9137253E65D3608329BB0061CFF5305C7.yml
INFO [08/30/19 14:41:08:31] End: Storing version variables to cache file D:\a\1\s\.git\gitversion_cache\CE0AE3C9137253E65D3608329BB0061CFF5305C7.yml (Took: 62.48ms)
INFO [08/30/19 14:41:08:31] Applicable build agent found: 'VsoAgent'.
Executing GenerateSetVersionMessage for 'VsoAgent'.
Executing GenerateBuildLogOutput for 'VsoAgent'.
INFO [08/30/19 14:41:08:32] Updating assembly info files
INFO [08/30/19 14:41:08:32] Found 2 files
##[section]Async Command Start: Update Build Number
Update build number to 2.0.0-PullRequest31377.73 for build 151740
##[section]Async Command End: Update Build Number
##[section]Finishing: GitVersion
答案 0 :(得分:1)
我的猜测是,问题出在我的GitVersion.yml中,或者 我如何使用GitVersion ...
否,您的GitVersion.yml没有错误。一切都成功了,并使用您的GitVersion.yml完成了我的GitVersion任务:
已记录:我刚刚修改了next-version
:next-version: 1.0.0
的值。
您收到的问题似乎是由您正在使用的任务引起的。
根据您的详细日志,我注意到您正在使用的GitVersion任务的版本为4.0.3
。实际上,此任务已修复了一些错误,并已更新为5.0.1
,这也是我用来测试和成功的工具。此外,另一种不寻常的事情是,您只是从some-branch-name
到develop
发出拉取请求,但是在日志中,您可以看到进程和循环在some-branch-name
至master
/ original master
之间:
要解决此问题,请尝试使用版本5. *的任务。
如果您无法从任务下拉列表中选择5. *,则只需卸载此扩展,然后重新安装即可获取并使用最新版本的GitVersion任务。