Open bradmac-ats opened 1 year ago
Hi @bradmac-ats ,
have you tried merging with --no-commit
? This should let you commit manually and get back in control of tagging.
When the same happened to me I realized I needed to improve my branching strategy to avoid these issues. I'm also curious to know if anyone has found some other way.
Sorry, I'm not following. What would I do after --no-commit
to address this?
I did find a way to recover from this in my setup at least. In my setup, I'm extracting variables from Nyx's state after running infer
and passing to subsequent jobs as environment variables: VERSION
, IS_NEW_VERSION
, IS_NEW_RELEASE
, and IS_LATEST_VERSION
. So if I run our GitLab pipeline manually and set those variables manually I can generate a correctly versioned release to create a new baseline for future version calculations.
It seems like automatic semantic versioning heavily favors a rebasing workflow, which had never occurred to me until I started experimenting with it. It's not a bad idea either, but I'd rather not have to force it on our development teams just to make build automation happy.
I'm guessing the issue with following both parents is related to supporting multiple release branches? And I don't see a good alternative for that if it was to follow both. Looking at the commit message for "merge remote-tracking branch" and only checking the other parent on those might hypothetically work but doesn't seem nearly as robust as anyone would like. Only other thing I can think of would be a toggle to check both parents that people could turn on if they aren't using release branches?
I agree, a toggle could be viable and people may turn it on at their own risk.
The point is that following both parents (potentially many, in case of octopus merges) could easily drive to inconsistencies in case of overlapping or unordered tags. It may even lead to re-bumping based on commits that have already been included in other releases/tags.
Hey @flelli ,
you redirected me to this issue, that means the problem can't be solved?
Hi @lxke19 , I just linked this issue because it brings the same request about the first parent commit so that you know where to watch for updates.
I'll give this a try and implement a toggle to enable all parents, although I'm not 100% confident it will work.
Hi @flelli what is the status on the merge commit implementation? Are u still working on it?
Hi @lxke19 ,
I gave it a try but things turn out to be more complicated than they seemed. I'll work on it but not in the very short time as my regular job is keeping me under pressure these times.
Hi, @flelli
Do you have any updates?
Maybe, if it's very complicated, you could add experimental option, which allows to disable --first-parent
option. And mark this as experimental in docs
The problem is that just following both parents using the current algorithm won't get you want you/I want. I ended up creating my own little tool to get the calculation to work how I wanted. You have to follow each parent of each commit back until you find a core version, while keeping track of the largest bump you find along each path, then apply the largest bump to the highest core version, even if those occurred on different paths. Then in the case of prereleases you also check if the result is an already-used prerelease, and if so you just bump the prerelease index of the last-used prerelease version by one. I'm sure trying to fit all that into Nyx while supporting all the existing configuration options would indeed be tricky.
I understand that Nyx only follows the first parent in merge commits, but I've encountered what I think is a fairly normal situation where this seems to break down. I suspect there's a different workflow people are using that doesn't run into this or you would've addressed it by now, but I'm not sure what that workflow is.
What I did is:
A1
, version1.0.0
B1
to the branchA2
to the server, which becomes version1.0.1
B2
, whose first parent isB1
and whose second parent isA2
B2
gets calculated as1.0.1
, when it should be1.0.2
.Now I've severed the latest commit from all the previous version tags as far as Nyx is concerned.
Am I missing something? how are people dealing with or preventing this issue?