Skip to content

Improved support for dynamic repositories #269

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
wants to merge 3 commits into from
Closed

Improved support for dynamic repositories #269

wants to merge 3 commits into from

Conversation

GeertvanHorrik
Copy link
Contributor

New PR for #245 which was buggy

@nulltoken
Copy link
Contributor

I'm unsure about something: what is a dynamic repository?

Could you please add tests to cover those changes?

@GeertvanHorrik
Copy link
Contributor Author

Dynamic repositories are already part of the software. I will write unit tests, but too busy now. Will take at least a week.

@GeertvanHorrik
Copy link
Contributor Author

Dynamic repositories are repositories where the local .git is not available and the information has to be fetched from the git repository url.

{
Logger.WriteInfo(string.Format("Switching to branch '{0}'", arguments.TargetBranch));
Copy link
Contributor

Choose a reason for hiding this comment

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

Why dropping this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added it back

@nulltoken
Copy link
Contributor

@gep13 Could you please peek at this? I'd like to make sure those changes wouldn't conflict with #262

@nulltoken
Copy link
Contributor

Dynamic repositories are repositories where the local .git is not available and the information has to be fetched from the git repository url.

Now I remember. You already explained me this once. Maybe that would deserver some docco/commnet in the code.

What kind of CI build require this?

@nulltoken
Copy link
Contributor

I will write unit tests, but too busy now. Will take at least a week.

@GeertvanHorrik 👍

@GeertvanHorrik
Copy link
Contributor Author

Any server that doesn't provide the full repository (like Continua CI, that only provides the actual files needed to build). I might write some docs once.

// Github Message: refs/heads/pull/5/merge
// Stash Message: refs/heads/pull-requests/5/merge

var regex = new Regex(MergeMessageRegexPattern);
var match = regex.Match(mergeMessage);
// Note by @GeertvanHorrik: sorry, I suck at regex so did a quick hack, feel free to replace by regex
Copy link
Member

Choose a reason for hiding this comment

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

For the MergeMessageRegexPattern you should be able to use something like this

@gep13
Copy link
Member

gep13 commented Oct 5, 2014

@gep13 Could you please peek at this? I'd like to make sure those changes wouldn't conflict with #262

Sure.

@nulltoken I don't see anything that would immediately clash, but I am not entirely clear on exactly what is being done here, or why the need to do this for ContinuaCI.

@GeertvanHorrik when I added the Stash Pull Request verification, I added an additional TestCase here:

https://github.com/Particular/GitVersion/blob/2fe94bdef99698e97514345da0c52e2c86130c7d/GitVersionExe.Tests/PullRequestInTeamCityTest.cs

Which was suggested by @JakeGinnivan, so I think you could at least add another TestCase here for the additional PR message that is now being tested for.

I have also added a suggestion for the Regex parsing, rather than what you have implemented currently.

@gep13
Copy link
Member

gep13 commented Oct 5, 2014

Dynamic repositories are repositories where the local .git is not available and the information has to be fetched from the git repository url.

Given that this is the case, and the presence of the .git directory is the trigger for anything else happening, then I don't think #262 should be affected, as the .git directory is present in AppVeyor.

@nulltoken
Copy link
Contributor

I'm starting to wonder if we shouldn't rather provide GitVersion with some information about the context regarding the hoster (Stash, GitHub, ..) and the CI platform (AppVeyor, Continua, TeamCity, ...) rather than letting it guessing...

/cc @andreasohlund @SimonCropp @JakeGinnivan

@SimonCropp
Copy link
Contributor

@nulltoken how would you do that?

@JakeGinnivan
Copy link
Contributor

I think we should try and make it 'just work'. I dont want to have to pass more info.

Also, passing context means it no longer is portable and you can't build in different contexts (like CI server and local).

We do need more scenario based tests though to cover these things

@GeertvanHorrik
Copy link
Contributor Author

Isn't that out of scope for this issue?

@JakeGinnivan
Copy link
Contributor

@GeertvanHorrik could you add a test or two around this functionality. There are quite a few nice changes in this so I have no problem with the PR itself, just want to our test coverage to move forward not backwards :)

@GeertvanHorrik
Copy link
Contributor Author

I understand, just need to find time. Was a bit overwhelmed with all other things I had to finish. It's still on my todo list, just need to find 30 minutes somewhere ;-)

@JakeGinnivan
Copy link
Contributor

I want to get 2.0.0 released this weekend. Recon you could find 30 mins to throw some tests around this over next day or two? Would be good to have this in.

I am happy to rebase if you just add the tests in :)

@GeertvanHorrik
Copy link
Contributor Author

I forgot, my mistake. So many PRs going on atm. I will do it now.

@JakeGinnivan
Copy link
Contributor

I know the feeling, I just don't know much about this feature otherwise I would have just done it myself to get it in :)

@GeertvanHorrik
Copy link
Contributor Author

Disabling pepita (it is giving me build errors for now). If I forget to re-enable, forgive me.

ps. dumping status info here, then I won't forget to put some stuff back later.

@GeertvanHorrik
Copy link
Contributor Author

Written unit tests, can you take a quick look if that is sufficient? I also wrote a test for local repositories to prove that works as well. I have implemented the unit tests as explicit, but you can change that if you like.

@JakeGinnivan
Copy link
Contributor

It would be good to create a local remote repository so we don't have online requirements then it doesnt have to be explicit. But I can change that

@GeertvanHorrik
Copy link
Contributor Author

"online requirements". I think you need to get the latest code anyway, but yes, in theory you could abstract it away into a mock / local repository.

@dazinator
Copy link
Member

There are current issues with Dynamic Repositories, see #101 and #336 - and I was wondering if this PR would perhaps also aid in fixing those.

If so an ideas when this will get merged?

@JakeGinnivan
Copy link
Contributor

It needs to be rebased and the test needs to be made to work offline (i.e create a fake repo then clone it). if someone gets to that before me, great. Otherwise I hope to do it in the next few days

@JakeGinnivan JakeGinnivan mentioned this pull request Jan 15, 2015
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.

6 participants