-
Notifications
You must be signed in to change notification settings - Fork 654
Fix/release issues #1342
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
Fix/release issues #1342
Conversation
…config and get the fallback config, overwrite increment to not have an infinite inherit issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather have too many than too few checks in place to avoid infinite loops, so this looks good to me.
Ok, looked into this a bit harder. Am now actually excluding branches which have no config or their branch config is inherit. This should mean that we don't resolve a branch with increment of inherit. I think this is actually the real fix for now. |
return matchingBranches.Increment == IncrementStrategy.Inherit ? | ||
InheritBranchConfiguration(context, targetBranch, matchingBranches, excludedInheritBranches) : | ||
matchingBranches; | ||
if (matchingBranches.Increment == IncrementStrategy.Inherit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't happen now because we filter the conditions which would cause this code to be executed. But still, I think it's worth keeping in just in case
@@ -50,17 +59,17 @@ static BranchConfig InheritBranchConfiguration(GitVersionContext context, Branch | |||
{ | |||
excludedInheritBranches = repository.Branches.Where(b => | |||
{ | |||
var branchConfig = config.GetConfigForBranch(b.FriendlyName); | |||
var branchConfig = config.GetConfigForBranch(b.NameWithoutRemote()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This I think is the real fix. This will now exclude local and remote branches which do not have config, or the config is Inherit.
Previously we only excluded branches which had config and it was Inherit, but our infinite loops were caused by branches without config..
…nfig without the remote name
Some of these fixes may not be needed because of other fixes, but trying to stamp out any chance of infinite config lookups..