Skip to content

Sequence Contains No Matching Elements #1671

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

Closed
borrillis opened this issue May 4, 2019 · 28 comments
Closed

Sequence Contains No Matching Elements #1671

borrillis opened this issue May 4, 2019 · 28 comments
Labels
Milestone

Comments

@borrillis
Copy link

borrillis commented May 4, 2019

I get the following message when running GitVersion against my repo, the repo is currently git, however it has been converted from cvs to svn to hg before git.

INFO [05/04/19 8:49:53:53] Working directory: C:\github\axiom3d\axiom
INFO [05/04/19 8:49:53:54] IsDynamicGitRepository: False
INFO [05/04/19 8:49:53:56] Returning Project Root from DotGitDirectory: C:\github\axiom3d\axiom\.git - C:\github\axiom3d\axiom
INFO [05/04/19 8:49:53:56] Running on Windows.
INFO [05/04/19 8:49:53:57] IsDynamicGitRepository: False
INFO [05/04/19 8:49:53:57] Returning Project Root from DotGitDirectory: C:\github\axiom3d\axiom\.git - C:\github\axiom3d\axiom
INFO [05/04/19 8:49:53:57] Project root is: C:\github\axiom3d\axiom
INFO [05/04/19 8:49:53:57] DotGit directory is: C:\github\axiom3d\axiom\.git
INFO [05/04/19 8:49:53:58] IsDynamicGitRepository: False
INFO [05/04/19 8:49:53:58] Returning Project Root from DotGitDirectory: C:\github\axiom3d\axiom\.git - C:\github\axiom3d\axiom
INFO [05/04/19 8:49:53:61] Begin: Loading version variables from disk cache
  INFO [05/04/19 8:49:53:61] Cache file C:\github\axiom3d\axiom\.git\gitversion_cache\A4BFA58BA7D9A0DD82E47CA1096478A4938DEE97.yml not found.
INFO [05/04/19 8:49:53:62] End: Loading version variables from disk cache (Took: 1.96ms)
INFO [05/04/19 8:49:53:62] IsDynamicGitRepository: False
INFO [05/04/19 8:49:53:62] Returning Project Root from DotGitDirectory: C:\github\axiom3d\axiom\.git - C:\github\axiom3d\axiom
INFO [05/04/19 8:49:53:73] Using latest commit on specified branch
INFO [05/04/19 8:49:53:74] No branch configuration found for branch v0.8.0.0, falling back to default configuration
INFO [05/04/19 8:49:53:75] Begin: Attempting to inherit branch configuration from parent branch
  INFO [05/04/19 8:49:53:77] Begin: Finding branch source of 'v0.8.0.0'
    INFO [05/04/19 8:49:53:80] Begin: Finding merge base between 'v0.8.0.0' and 'develop'.
      INFO [05/04/19 8:49:53:83] Found merge base of 4bae1c05591012d220d58c03531f5fdf32d9daf5
      INFO [05/04/19 8:49:53:85] Merge base of v0.8.0.0' and 'develop is 4bae1c05591012d220d58c03531f5fdf32d9daf5
    INFO [05/04/19 8:49:53:85] End: Finding merge base between 'v0.8.0.0' and 'develop'. (Took: 47.00ms)
    INFO [05/04/19 8:49:53:85] Begin: Finding merge base between 'v0.8.0.0' and 'master'.
      INFO [05/04/19 8:49:53:86] Merge base of v0.8.0.0' and 'master is
    INFO [05/04/19 8:49:53:86] End: Finding merge base between 'v0.8.0.0' and 'master'. (Took: 14.00ms)
    INFO [05/04/19 8:49:53:86] Begin: Finding merge base between 'v0.8.0.0' and 'origin/develop'.
      INFO [05/04/19 8:49:53:88] Found merge base of 4bae1c05591012d220d58c03531f5fdf32d9daf5
      INFO [05/04/19 8:49:53:91] Merge base of v0.8.0.0' and 'origin/develop is 4bae1c05591012d220d58c03531f5fdf32d9daf5
    INFO [05/04/19 8:49:53:91] End: Finding merge base between 'v0.8.0.0' and 'origin/develop'. (Took: 48.00ms)
    INFO [05/04/19 8:49:53:91] Begin: Finding merge base between 'v0.8.0.0' and 'origin/master'.
      INFO [05/04/19 8:49:53:91] Merge base of v0.8.0.0' and 'origin/master is
    INFO [05/04/19 8:49:53:91] End: Finding merge base between 'v0.8.0.0' and 'origin/master'. (Took: 2.00ms)
    INFO [05/04/19 8:49:53:93] Multiple source branches have been found, picking the first one (develop).
This may result in incorrect commit counting.
Options were:
develop, origin/develop
  INFO [05/04/19 8:49:53:93] End: Finding branch source of 'v0.8.0.0' (Took: 157.00ms)
  INFO [05/04/19 8:49:53:93] Begin: Getting branches containing the commit '4bae1c05591012d220d58c03531f5fdf32d9daf5'.
    INFO [05/04/19 8:49:53:93] Trying to find direct branches.
    INFO [05/04/19 8:49:53:93] No direct branches found, searching through tracked branches.
    INFO [05/04/19 8:49:53:94] Searching for commits reachable from 'origin/develop'.
    INFO [05/04/19 8:49:53:97] The branch 'origin/develop' has a matching commit.
    INFO [05/04/19 8:49:53:97] Searching for commits reachable from 'origin/master'.
    INFO [05/04/19 8:49:53:97] The branch 'origin/master' has no matching commits.
  INFO [05/04/19 8:49:53:97] End: Getting branches containing the commit '4bae1c05591012d220d58c03531f5fdf32d9daf5'. (Took: 39.01ms)
  INFO [05/04/19 8:49:53:97] Found possible parent branches: origin/develop
INFO [05/04/19 8:49:53:97] End: Attempting to inherit branch configuration from parent branch (Took: 227.05ms)
INFO [05/04/19 8:49:53:99] Running against branch: v0.8.0.0 (d916c5fd44d1c1f96b6a3543c70416d2a769d3d7)
INFO [05/04/19 8:49:54:00] Begin: Calculating base versions
  INFO [05/04/19 8:49:54:03] Fallback base version: 0.1.0 with commit count source af4e68e39330a1b65f42035668cff977f6512592 (Incremented: None)
  INFO [05/04/19 8:49:54:10] NextVersion in GitVersion configuration file: 0.9.0 with commit count source External Source (Incremented: None)
  INFO [05/04/19 8:49:54:15] Git tag 'v0.8.3376.12322': 0.8.3376+12322 with commit count source a607690d514416d025ff0b8474ffaeedfb0d4984 (Incremented: 0.9.0)
  INFO [05/04/19 8:49:54:17] Git tag 'v0.8.3101.12095': 0.8.3101+12095 with commit count source 88819d35c5ce02eb23b7082a4bfd0bbccb0226ee (Incremented: 0.9.0)
  INFO [05/04/19 8:49:54:23] Begin: Finding branch source of 'v0.8.0.0'
    INFO [05/04/19 8:49:54:23] Multiple source branches have been found, picking the first one (develop).
This may result in incorrect commit counting.
Options were:
develop, origin/develop
  INFO [05/04/19 8:49:54:23] End: Finding branch source of 'v0.8.0.0' (Took: 0.00ms)
  INFO [05/04/19 8:49:54:23] Version in branch name: 0.8.0+0 with commit count source 4bae1c05591012d220d58c03531f5fdf32d9daf5 (Incremented: None)
  INFO [05/04/19 8:49:54:26] Found multiple base versions which will produce the same SemVer (0.9.0), taking oldest source for commit counting (Git tag 'v0.8.3101.12095')
  INFO [05/04/19 8:49:54:27] Base version used: Git tag 'v0.8.3101.12095': 0.8.3101+12095 with commit count source 88819d35c5ce02eb23b7082a4bfd0bbccb0226ee (Incremented: 0.9.0)
INFO [05/04/19 8:49:54:27] End: Calculating base versions (Took: 272.94ms)
INFO [05/04/19 8:49:54:28] Begin: Using mainline development mode to calculate current version
  INFO [05/04/19 8:49:54:31] Multiple possible mainlines pointing at the same commit, dropping origin/master
  INFO [05/04/19 8:49:54:31] Found possible mainline branches:
INFO [05/04/19 8:49:54:35] End: Using mainline development mode to calculate current version (Took: 69.97ms)
ERROR [05/04/19 8:49:54:36] An unexpected error occurred:
System.InvalidOperationException: Sequence contains no matching element
  at System.Linq.Enumerable.First[TSource](IEnumerable`1 source, Func`2 predicate)
  at GitVersion.VersionCalculation.MainlineVersionCalculator.GetMainlineTip(GitVersionContext context)
  at GitVersion.VersionCalculation.MainlineVersionCalculator.FindMainlineModeVersion(BaseVersion baseVersion, GitVersionContext context)
  at GitVersion.VersionCalculation.NextVersionCalculator.FindVersion(GitVersionContext context)
  at GitVersion.GitVersionFinder.FindVersion(GitVersionContext context)
  at GitVersion.ExecuteCore.<>c__DisplayClass6_0.<ExecuteInternal>b__0(IRepository repo)
  at GitVersion.GitPreparer.WithRepository[TResult](Func`2 action)
  at GitVersion.ExecuteCore.ExecuteGitVersion(String targetUrl, String dynamicRepositoryLocation, Authentication authentication, String targetBranch, Boolean noFetch, String workingDirectory, String commitId, Config overrideConfig, Boolean noCache)
  at GitVersion.SpecifiedArgumentRunner.Run(Arguments arguments, IFileSystem fileSystem)
  at GitVersion.Program.VerifyArgumentsAndRun()
INFO [05/04/19 8:49:54:36]
INFO [05/04/19 8:49:54:36] Attempting to show the current git graph (please include in issue):
INFO [05/04/19 8:49:54:36] Showing max of 100 commits
INFO [05/04/19 8:49:54:65] *   1d261cd90 7 days ago  (origin/develop, develop)
|\
| * d44cf7867 7 days ago  (origin/UpgradeToLatest, UpgradeToLatest)
| * 6d38b3503 7 days ago
| * e64d9906b 3 weeks ago
| * e94a5bb17 3 weeks ago
| * 821980450 4 weeks ago
| * c3c3a67b9 4 weeks ago
| * b2ffad98a 4 weeks ago
| * 6bdd21902 4 weeks ago
| * 80750bc34 4 weeks ago
| * aaa27e753 4 weeks ago
| * 37a75f42a 4 weeks ago
| * 2aeb37794 4 weeks ago
| * 4e85c1a40 4 weeks ago
| * 522fd8e3f 4 weeks ago
| * 7fb211136 7 weeks ago
| * 4b245fa5d 7 weeks ago
| * 2c77788bc 7 weeks ago
| * dc131d87d 7 weeks ago
| * 36872f495 7 weeks ago
| * b22b00a19 7 weeks ago
| * 9e69f409f 7 weeks ago
| * 2fbcce393 7 weeks ago
| * 127c75194 7 weeks ago
| * 39c78e35a 7 weeks ago
| * 163b0636a 7 weeks ago
| * 58711c1c9 7 weeks ago
| * e06277197 7 weeks ago
| * f520bc97d 7 weeks ago
| * 221c6b574 7 weeks ago
| * 2834dde16 7 weeks ago
| * 0ae0aff6f 7 weeks ago
| * b85842a4f 7 weeks ago
| * a634b45e0 7 weeks ago
| * 9b548a08d 7 weeks ago
| * ace554d37 8 weeks ago
| * 538e11597 9 weeks ago
| * bef32d1e1 9 weeks ago
| * 4315dc7fb 9 weeks ago
| * b30c6c8e5 9 weeks ago
| | *   19bbcc121 5 months ago  (refs/stash)
| | |\
| | | * 0d9227eca 5 months ago
| | |/
| | * 145744d00 5 months ago  (DotNetStandard2)
| |/
| * 2b4d8ee17 6 months ago
|/
*   588567ebe 2 years, 10 months ago
|\
| *   bf6f0c9a0 2 years, 11 months ago
| |\
| * | d49a6b61f 2 years, 11 months ago
| * | 0500ce07a 2 years, 11 months ago
| * | 6d735658f 2 years, 11 months ago
| * | 0b656d94f 2 years, 11 months ago
| * | de22e1170 2 years, 11 months ago
| * | 204f077a9 2 years, 11 months ago
| * | 371bfb472 2 years, 11 months ago
| * | 937d2cb9b 2 years, 11 months ago
| * | fa1e82570 2 years, 11 months ago
| * | 8d5e30f6e 2 years, 11 months ago
| * | 0681132fd 2 years, 11 months ago
| * | 69493e50e 2 years, 11 months ago
| * | 3b2c09e7a 2 years, 11 months ago
| * | 11cb786c7 2 years, 11 months ago
| * | 14e5fca8e 2 years, 11 months ago
| * | 30ca26640 2 years, 11 months ago
| * | 48e58b07e 2 years, 11 months ago
| * | 4202f3db4 2 years, 11 months ago
| * | 08efe4b06 5 years ago
| * | a8dea04a2 5 years ago
| * | 1281c4030 5 years ago
|  /
* | cfe3d27c1 2 years, 11 months ago  (origin/master, origin/HEAD, master)
* | 1b26c63ca 2 years, 11 months ago
* |   76994381e 2 years, 11 months ago
|\ \
| * | 2925c491e 2 years, 11 months ago
| |\ \
| | * | 64661e024 2 years, 11 months ago
| | * | a4f874828 2 years, 11 months ago
| | * |   53208f08e 2 years, 11 months ago
| | |\ \
| | | * | fdee05a9d 2 years, 11 months ago
| | | * | 246ac9a96 2 years, 11 months ago
| | | * | 4ec6fee10 2 years, 11 months ago
| | | * | dad09ee82 2 years, 11 months ago
| | | * | f6e8f78b1 2 years, 11 months ago
| | | * | c911353fd 2 years, 11 months ago
| | |  /
| | * | 562b937a1 2 years, 11 months ago
| | * | 9d4340b6b 2 years, 11 months ago
| |  /
| * | 36938f9de 2 years, 11 months ago
| * | 32b6d2774 2 years, 11 months ago
|  /
* | 55a90b221 2 years, 11 months ago
* | 0ee380505 2 years, 11 months ago  (origin/opentk)
/
| * ea5d5230d 6 months ago  (origin/mono.simd)
| * 5eaeb50aa 6 years ago
| * b75e9eeba 10 years ago
| * f8b4fd18d 10 years ago
| * 2c1c0704d 10 years ago
| * bc46eb35b 10 years ago
| * 6171eb2f5 10 years ago
| * 2a90cb8fa 10 years ago
| | * 1339b33c3 5 years ago  (origin/WinRT, WinRT)
| | * 85fc2dc26 5 years ago
| | * 569afda98 6 years ago
@borrillis
Copy link
Author

I was able to get past this by changing from Mainline to ContinuousDelivery

@asbjornu
Copy link
Member

Since the problem is solved, I'll close. Please reopen if you are able to reproduce this in a public repository we can investigate.

@davidvedvick
Copy link

davidvedvick commented Jul 3, 2019

I had this issue as well. For me, the issue was that the build server (TFS) did not have master or the branch checked out, rather it was operating in detached head state. Normally, GitVersion is smart enough to detect this condition, but it is powerless to do so in a Docker container.

I was able to work around the issue using a bash script like this (please note that the $(...) looking variables are TFS specific variables):

branchName="$(Build.SourceBranchName)"

if [ -n "$(System.PullRequest.PullRequestId)" ]
then
  branchName="PullRequest$(System.PullRequest.PullRequestId)"
fi

# Checkout branch
git checkout -B $branchName
# Checkout master for mainline calculation
git checkout master
# Checkout branch again
git checkout $branchName

@tijujohn83
Copy link

I had this issue as well. For me, the issue was that the build server (TFS) did not have master or the branch checked out, rather it was operating in detached head state. Normally, GitVersion is smart enough to detect this condition, but it is powerless to do so in a Docker container.

I was able to work around the issue using a bash script like this (please note that the $(...) looking variables are TFS specific variables):

branchName="$(Build.SourceBranchName)"

if [ -n "$(System.PullRequest.PullRequestId)" ]
then
  branchName="PullRequest$(System.PullRequest.PullRequestId)"
fi

# Checkout branch
git checkout -B $branchName
# Checkout master for mainline calculation
git checkout master
# Checkout branch again
git checkout $branchName

this saved some of our time, thanks!

@da9l
Copy link
Contributor

da9l commented Oct 7, 2019

I know it's not exactly the way one should do it but this error can easily be reproduced by a edgy configuration in an almost empty repo.

Since gitversion could give a more helpful error message here I think this issue should be reopened even if there is a workaround.

I did this on a pretty empty repository

git init .
<add .gitignore>

Then I add this gitversion.yml

mode: Mainline
branches:
  master:
    regex: ^master$
    tag: beta
    is-mainline: true
  release:
    tag: ''
    regex: ^release/
    is-mainline: false

and then..

git add -A
git commit -m "Initial commit"
git checkout -b "feature/new-feature"
"hello" > hello.txt
git add -A
git commit -m "add hello"
git checkout master

gitversion works, then I swap the is-mainline flags of release and mainline like this. (I really don't know why one would like to do this but...)

mode: Mainline
branches:
  master:
    regex: ^master$
    tag: beta
    is-mainline: false
  release:
    tag: ''
    regex: ^release/
    is-mainline: true

and calling gitversion gives an exception:

...
  INFO [10/07/19 8:02:06:58] End: Using mainline development mode to calculate current version (Took: 10.00ms)
  ERROR [10/07/19 8:02:06:63] An unexpected error occurred:
System.InvalidOperationException: Sequence contains no matching element
   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source, Func`2 predicate)
   at GitVersion.VersionCalculation.MainlineVersionCalculator.GetMainline(GitVersionContext context, Commit baseVersionSource)
   at GitVersion.VersionCalculation.MainlineVersionCalculator.FindMainlineModeVersion(BaseVersion baseVersion, GitVersionContext context)
   at GitVersion.VersionCalculation.NextVersionCalculator.FindVersion(GitVersionContext context)
   at GitVersion.GitVersionFinder.FindVersion(GitVersionContext context)
   at GitVersion.ExecuteCore.<>c__DisplayClass8_0.<ExecuteInternal>b__0(IRepository repo)
   at GitVersion.GitPreparer.WithRepository[TResult](Func`2 action)
   at GitVersion.ExecuteCore.ExecuteGitVersion(String targetUrl, String dynamicRepositoryLocation, Authentication authentication, String targetBranch, Boolean noFetch, String workingDirectory, String commitId, Config overrideConfig, Boolean noCache, Boolean noNormalize)
   at GitVersion.SpecifiedArgumentRunner.Run(Arguments arguments, IFileSystem fileSystem, IEnvironment environment)
   at GitVersion.Program.VerifyArgumentsAndRun()
...

@asbjornu
Copy link
Member

asbjornu commented Oct 7, 2019

Are you able to reproduce this in a RepositoryFixture test akin to the following, @da9l?

[Test]
public void ShouldInheritIncrementCorrectlyWithMultiplePossibleParentsAndWeirdlyNamedDevelopBranch()
{
using (var fixture = new EmptyRepositoryFixture())
{
fixture.Repository.MakeATaggedCommit("1.0.0");
fixture.Repository.CreateBranch("development");
Commands.Checkout(fixture.Repository, "development");
//Create an initial feature branch
var feature123 = fixture.Repository.CreateBranch("feature/JIRA-123");
Commands.Checkout(fixture.Repository, "feature/JIRA-123");
fixture.Repository.MakeCommits(1);
//Merge it
Commands.Checkout(fixture.Repository, "development");
fixture.Repository.Merge(feature123, Generate.SignatureNow());
//Create a second feature branch
fixture.Repository.CreateBranch("feature/JIRA-124");
Commands.Checkout(fixture.Repository, "feature/JIRA-124");
fixture.Repository.MakeCommits(1);
fixture.AssertFullSemver("1.1.0-JIRA-124.1+2");
}
}

If we could get a failing test in place, it would be much easier to output a better error message.

@asbjornu asbjornu reopened this Oct 7, 2019
@da9l
Copy link
Contributor

da9l commented Oct 7, 2019 via email

@asbjornu
Copy link
Member

asbjornu commented Oct 7, 2019

Thanks, that's awesome! The name of the branch is irrelevant, but a descriptive name is of course preferable. 😃👍

@da9l
Copy link
Contributor

da9l commented Oct 7, 2019 via email

@asbjornu
Copy link
Member

asbjornu commented Oct 7, 2019

Excellent! If you have ideas for what the error message should say, feel free to change that in the PR and then do var exception = Assert.Throws<CustomExceptionType>(() => ...) to assert that the correct exception is thrown and that it contains the expected stuff inside .Message.

@stale
Copy link

stale bot commented Jan 5, 2020

This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jan 5, 2020
@asbjornu asbjornu removed the stale label Jan 6, 2020
@stale
Copy link

stale bot commented Apr 5, 2020

This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 5, 2020
@stale stale bot closed this as completed May 5, 2020
@xalikoutis
Copy link

just ran into this today in mainline strategy i use

@asbjornu
Copy link
Member

@xalikoutis, that's unfortunate. We still haven't received pull requests fixing the problem, though, so it remains.

@asbjornu asbjornu reopened this Sep 23, 2020
@stale stale bot removed the stale label Sep 23, 2020
@asbjornu asbjornu added the bug label Sep 23, 2020
@mohaemen
Copy link

In my case, I think the issue was that there was no master branch, after the new default branch name became 'main'.
I just had this and the build passed

mode: Mainline
increment: Minor
branches: 
  main: 
    regex: ^main$
    is-mainline: true
    source-branches: ['main']
next-version: 1.0.0

@eduardojdreis
Copy link

I had the same issue when using mode Mainline on Jenkins. What I did that solved my issue was adding this regex to master:

master:
    regex: (^master$|^origin\/master$)
    tag: ''
    increment: minor

GitVersion will now look at origin/master also, instead of just looking at master.

@asbjornu
Copy link
Member

That's great, @eduardojdreis! A PR that changes the default regex would be welcome.

@xalikoutis
Copy link

xalikoutis commented Dec 11, 2020

i am still gertting this error when i clone the main branch and run gitversion

mode: Mainline
major-version-bump-message: '\+semver:\s?(breaking|major)'
minor-version-bump-message: '\+semver:\s?(feature|minor)'
patch-version-bump-message: '\+semver:\s?(fix|patch)'
legacy-semver-padding: 4
build-metadata-padding: 4
commits-since-version-source-padding: 4
commit-message-incrementing: Enabled
no-bump-message: '\+semver:\s?(none|skip)'
branches:
  master:
    regex: (^main$|^origin\/main$)
    increment: none
    is-mainline: false
  develop:
    regex: ^new_app$
    tag: "beta"
    increment: Inherit
    is-mainline: true
    is-source-branch-for: ['feature', 'hotfix']
  feature:
    regex: ^features?[/-]
    tag: feature
    increment: Minor
    source-branches: ['develop']
  hotfix:
    regex: ^hotfix(es)?[/-]
    tag: hotfix
    increment: Patch
    source-branches: ['develop']
ignore:
  sha: []
merge-message-formats: {}

@testworksau
Copy link

Based on my understanding, issues with this exception being raised when using the main branch without an appropriate regex should have been resolved in GitVersion 5.5.0 by:

#2367

@tmm360
Copy link

tmm360 commented Oct 21, 2021

I'm using GitVersion 5.7.0 but issue is not solved. A github build action failed: https://github.com/Etherna/etherna-sso/runs/3958670617

Unfortunately this didn't help: #1671 (comment)

Edit: I'm receiving same error also after have changed branch name in master: https://github.com/Etherna/etherna-sso/runs/3958733097

tmm360 added a commit to Etherna/etherna-sso that referenced this issue Oct 21, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@asbjornu
Copy link
Member

Are you able to reproduce that failed build in an isolated repository or (even better) in a test fixture within the GitVersion repository (preferably as a pull request), @tmm360?

@tmm360
Copy link

tmm360 commented Oct 21, 2021

Are you able to reproduce that failed build in an isolated repository or (even better) in a test fixture within the GitVersion repository (preferably as a pull request), @tmm360?

I'll try to isolate into a repo at first.

@tmm360
Copy link

tmm360 commented Oct 21, 2021

Are you able to reproduce that failed build in an isolated repository or (even better) in a test fixture within the GitVersion repository (preferably as a pull request), @tmm360?

This is the repository that I was able to build https://github.com/tmm360/gitversion-issue1671 with a basic "Hello world" console.
On main branch you can find the minimal version.

Issue seams to be related to various condition: removing elements, any time that it was able to build I forked with a new worked-X branch. Conditions seams to be:

  • Build with Docker
  • Build using tags
  • Use Mainline mode with GitVersion.yml file

image
Branch structure

On actions there are any attempt performed with failed and succeeded: https://github.com/tmm360/gitversion-issue1671/actions

I'm not able to write test for this, but I hope to have provided sufficient info.

@asbjornu
Copy link
Member

asbjornu commented Mar 3, 2022

Thanks for providing a public repository to reproduce this error, @tmm360. I am, however, unable to reproduce the error. I've cloned https://github.com/tmm360/gitversion-issue1671 and have checked out HEAD (https://github.com/tmm360/gitversion-issue1671/commit/9bcd6d411c1b5e649a1e2f56cf88ecb7fa38aaa0) of main. Running GitVersion there succeeds. What do I need to do to make it fail?

@tmm360
Copy link

tmm360 commented Mar 3, 2022

Thanks for providing a public repository to reproduce this error, @tmm360. I am, however, unable to reproduce the error. I've cloned https://github.com/tmm360/gitversion-issue1671 and have checked out HEAD (tmm360/gitversion-issue1671@9bcd6d4) of main. Running GitVersion there succeeds. What do I need to do to make it fail?

I've tried again, and now it works also for me. What is not fixed to a specific version is the container mcr.microsoft.com/dotnet/sdk:5.0, that could has been updated. After all, I saw that to use docker was a requirement for the issue to manifest (v0.1.4). Maybe issue was related to a previous version of that container, and now it has been resolved.

@asbjornu
Copy link
Member

asbjornu commented Mar 3, 2022

I think that with #2379 and #3018, this error may go away or at least be replaced by a much more explanatory error message.

@asbjornu asbjornu added this to the 5.x milestone Mar 4, 2022
@asbjornu
Copy link
Member

asbjornu commented Mar 4, 2022

As #2379 is now merged, I'll close this. Please reopen if the same issue persists in the next release of GitVersion.

@asbjornu asbjornu closed this as completed Mar 4, 2022
@arturcic arturcic modified the milestones: 5.x, 5.8.3 Mar 5, 2022
@github-actions
Copy link

github-actions bot commented Mar 5, 2022

🎉 This issue has been resolved in version 5.8.3 🎉
The release is available on:

Your GitReleaseManager bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests