-
Notifications
You must be signed in to change notification settings - Fork 652
filter on tags on prefix or regex, to make it possible to use multiple git versions in one repository #2436
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'm looking for something similar, it looks like something like this might exist already:
|
You can put a
If you now run GitVersion inside the FooLib directory, it only considers However, you will run into problems if you checkout tagged commits for one package and try to get the version of the other package. For example, if you checkout |
GitVersion operates on the basic principle of having one versionable entity per repository. Monorepo and similar methodologies is explicitly not supported. If you manage to get GitVersion to work in your environment regardless, please consider that a hack and not something you can be confident GitVersion will support in the future. |
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. |
Hello there, FYI, I have forked GitVersion in Oct,2019 (based on the version 4.0), to add a new To use it, you have just to add in the GitVersion files the new section "paths" to include (or exclude) paths under the section "ignore" :
When GitVersion calculate the next version, the path filter check each commit to ignore those that not modifiy any files within the list. You can add paths to "include" or to "exclude".
I use this forked version since Oct, 2019 for all my projects, It works like a charm. I also suggest to use this with the "tag-prefix". Take an example : you have 1 git repository with 2 projects/directories (to make it simple) :
You create one GitVersion config file (.yml) per project : MyLib.yml :
MyWebApp.yml :
Then :
In the build pipelines, tag Enjoy! |
That looks interesting, @sebastienwarin. If you are able to rebase those changes on |
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. |
The described feature looks very good and is actually exactly what we need. Is there any ETA when a PR would be ready? |
@marc-mueller, someone would have to take @sebastienwarin's code, rebase it against |
I can have a look on how complex this will get, but currently I cannot guarantee to take care of it (too many things on my personal backlog). Do you already have a globbing library in use in the project? Is there some information available how you do your testing? Do you test against a real repository or is it mocked? |
@marc-mueller, yes we have GitVersion/src/GitVersion.Core.Tests/IntegrationTests/IgnoreBeforeScenarios.cs Lines 14 to 33 in c9df1c4
|
Thanks for the info. I tried porting the source code to the latest master. I'm currently struggling with the Path Diffs. The current master is not compatible with the original code. I thought that creating an additional Diff Method on the IGitRepository would hide the implementation details appropriately. But currently I am struggling how to get a reference to the IGitRepository from the PathFilter. The PathFilter is used in IgnoreConfig but also there I'm not sure how to inject the IGitRepository. From my current understanding, the easiest way would be to have a reference to IGitRepository from the GitVersionContext which is available in the Filter implementation. Is this a valid solution approach? Current work in progress: main...marc-mueller:feature/pathfilter |
@marc-mueller, please submit a draft pull request so we can discuss the code and figure out its direction within it. |
this is exactly what we need. Any chance it will be incorporated into main version? |
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. |
@sebastienwarin wow, really cool feature that we would like to have. Is there any plan to manage this feature into GitVersion? |
Context
We are trying to merge a solution that build nuget packages from one repo to another.
This repo already has a tagging structure for other nuget packages. we do not want to mix up these tags.
The most obvious thing for us, seems to be able to have a filter, in which we can state a prefix or regex, so that a certain git version task, will only analyze the ones having this prefix or regex.
Other issue that we see: the analysis of the already existing tags takes about 10 minutes, because we have a lot of them. having the filter possibility, just as command git tag -l "prefix*" has, would make the analysis a lot quicker. Or is there any other way?
Solution that we think would help:
specify a prefix, that is used both for tagging and for filtering during the analysis to specify which git tag will have to be added.
Or am I missing a feature that already does this?
The text was updated successfully, but these errors were encountered: