-
Notifications
You must be signed in to change notification settings - Fork 652
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
Comments
I was able to get past this by changing from Mainline to ContinuousDelivery |
Since the problem is solved, I'll close. Please reopen if you are able to reproduce this in a public repository we can investigate. |
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
|
this saved some of our time, thanks! |
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
Then I add this gitversion.yml
and then..
gitversion works, then I swap the
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()
... |
Are you able to reproduce this in a GitVersion/src/GitVersionCore.Tests/IntegrationTests/FeatureBranchScenarios.cs Lines 15 to 40 in 84b4af9
If we could get a failing test in place, it would be much easier to output a better error message. |
I'd love to. When I create a branch for this failing test in my fork, does
it matter what I call it?
Would it be ok to name it failingtest\<description>
Regards, Daniel
…On Mon, Oct 7, 2019 at 10:47 AM Asbjørn Ulsberg ***@***.***> wrote:
Are you able to reproduce this in a RepositoryFixture test akin to the
following, @da9l <https://github.com/da9l>?
https://github.com/GitTools/GitVersion/blob/84b4af965855ab5c8d503521c075518af943659f/src/GitVersionCore.Tests/IntegrationTests/FeatureBranchScenarios.cs#L15-L40
If we could get a failing test in place, it would be much easier to output
a better error message.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1671?email_source=notifications&email_token=AABD23P3LSM7ZKNBOS6QS2TQNLZP7A5CNFSM4HKY3FAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAPPN7A#issuecomment-538900220>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABD23IBISVWZ4Z4Q2ZZ7PLQNLZP7ANCNFSM4HKY3FAA>
.
--
mail & MSN:daniel@hegner.se
twitter.com/8DH
|
Thanks, that's awesome! The name of the branch is irrelevant, but a descriptive name is of course preferable. 😃👍 |
Ok, I've created a very simple but failing test for this. It does probably
not cover all possible cases.
Thanks for nudging me into the right direction.
/Daniel
…On Mon, Oct 7, 2019 at 11:04 AM Asbjørn Ulsberg ***@***.***> wrote:
Thanks, that's awesome! The name of the branch is irrelevant, but a
descriptive name is of course preferable. 😃👍
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1671?email_source=notifications&email_token=AABD23L3O2L7Z3F5LR56WKTQNL3Q3A5CNFSM4HKY3FAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAPRBTI#issuecomment-538906829>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABD23ORK2QKZHN3WIAA24DQNL3Q3ANCNFSM4HKY3FAA>
.
--
mail & MSN:daniel@hegner.se
twitter.com/8DH
|
Excellent! If you have ideas for what the error message should say, feel free to change that in the PR and then do |
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. |
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. |
just ran into this today in mainline strategy i use |
@xalikoutis, that's unfortunate. We still haven't received pull requests fixing the problem, though, so it remains. |
In my case, I think the issue was that there was no master branch, after the new default branch name became 'main'.
|
I had the same issue when using mode Mainline on Jenkins. What I did that solved my issue was adding this regex to
GitVersion will now look at |
That's great, @eduardojdreis! A PR that changes the default regex would be welcome. |
i am still gertting this error when i clone the
|
Based on my understanding, issues with this exception being raised when using the |
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 |
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. |
This is the repository that I was able to build https://github.com/tmm360/gitversion-issue1671 with a basic "Hello world" console. Issue seams to be related to various condition: removing elements, any time that it was able to build I forked with a new
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. |
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 |
I've tried again, and now it works also for me. What is not fixed to a specific version is the container |
As #2379 is now merged, I'll close this. Please reopen if the same issue persists in the next release of GitVersion. |
🎉 This issue has been resolved in version 5.8.3 🎉 Your GitReleaseManager bot 📦🚀 |
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.
The text was updated successfully, but these errors were encountered: