Skip to content

#953 Fix dynamic repositories #1073

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

Merged
merged 1 commit into from
Feb 20, 2017
Merged

#953 Fix dynamic repositories #1073

merged 1 commit into from
Feb 20, 2017

Conversation

GeertvanHorrik
Copy link
Contributor

No description provided.

@GeertvanHorrik
Copy link
Contributor Author

Fixes #953


var executeCore = new ExecuteCore(new TestFileSystem());

var versionVariables = executeCore.ExecuteGitVersion(url, dynamicDirectory, null, targetBranch,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this test need to hit the actual repo or could it just use a fixture like elsewhere?

@asbjornu
Copy link
Member

@GeertvanHorrik: Now that master builds are green again, can you please rebase this so we can see if this turns green as well?

@GeertvanHorrik
Copy link
Contributor Author

I just hit "Update branch", I hope that was the right button :-)

@aateeque
Copy link

Not sure if this fixes the issue with dynamic repositories. As reported by others in #953 it seems an uninitialized GitPreparer may have something to do here. Maybe its my setup and I am looking at this completely the wrong way, but the issue I have found is that the constructor parameter targetPath for GitPreparer needs to be a path that contains a .git directory - in other words the target path has to be within a git repository.
If the targetPath is not set it uses the current directory which will be the download path for GitVersion.exe (from nuget for example while using Cake). In this instance, the call to GetDotGitDirectory() from ConfigurationProvider.Verify() throws an exception as Repository.Discover(targetPath) returns null for a non-git targetPath. Following this GitVersion will exit with 1 after failing an attempt to print a graph for a non-git directory.

@GeertvanHorrik
Copy link
Contributor Author

This requires an update of GitTools.Core, checking the status now.

@GeertvanHorrik
Copy link
Contributor Author

Just verified this stuff locally on my machine, all seems to work, I think we should merge this.

@GeertvanHorrik
Copy link
Contributor Author

But it should be merged into 4.0.0 beta. @JakeGinnivan which branch this I merge this into?

@GeertvanHorrik GeertvanHorrik added this to the 4.0.0 milestone Feb 20, 2017
@asbjornu
Copy link
Member

@GeertvanHorrik: I've restarted all failing builds since it seems like the Mono source server was down when they were run. Stuff targeting v4 should be merged into master.

@GeertvanHorrik
Copy link
Contributor Author

Looks like the builds are not really doing anything (or at least I cannot check the details of the AppVeyor builds).

@GeertvanHorrik
Copy link
Contributor Author

But since GitTools.Core was already merged, this PR only:

  1. Fixes possible NullReferenceException
  2. Adds more unit tests

@asbjornu
Copy link
Member

@GeertvanHorrik: True. Since Windows and OS X builds are green, this can safely be merged. It's only Linux builds that fail with:

Failed to fetch http://download.mono-project.com/repo/debian/pool/main/m/mono/mono-jay_4.6.2.16-0xamarin1_amd64.deb  503  Service Temporarily Unavailable [IP: 52.85.142.49 80]

@GeertvanHorrik
Copy link
Contributor Author

@asbjornu Thanks for the fast replies, really appreciate this. Can you merge it, not sure if I should use "rebase & merge" or "squash & merge".

@asbjornu
Copy link
Member

@GeertvanHorrik: No problem. I've rebased 3badcd2 on top of the HEAD of master to make the merge a bit less messy. When it's done testing, I think it's good to go. :shipit:.

@GeertvanHorrik
Copy link
Contributor Author

Thanks, looks like everything succeeded (at least the AppVeyor builds). I'll merge this now.

@GeertvanHorrik GeertvanHorrik merged commit e4e3959 into master Feb 20, 2017
@asbjornu asbjornu deleted the feature/dynamic branch February 20, 2017 20:48
@JakeGinnivan
Copy link
Contributor

@GeertvanHorrik just running these tests, they are pretty slow because they talk to GitHub and actually close another repo (they take about 5 seconds each..). Can you submit a PR which changes these tests to use the fixture approach. We have other tests which simulate the dynamic repo builds and run super fast.

@JakeGinnivan
Copy link
Contributor

I also get

Message: System.UnauthorizedAccessException : Access to the path 'pack-101bf845e769c8eee6dfff4cefaaf619d573f0b4.idx' is denied.

The second time I run the tests..

JakeGinnivan added a commit that referenced this pull request Feb 25, 2017
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

Successfully merging this pull request may close these issues.

4 participants