Fix version detection for branch layout with / - #1441
Conversation
…ches
Use split('/', 3) consistently when extracting branch names from git refs
so nested paths like 19.0/foo are not truncated to foo.
Match base bundles when branch names use a slash version prefix (e.g. 19.0/foo) in addition to the existing hyphen prefix (e.g. 19.0-dev-tri).
|
Hello and sorry for the delay I tried to define the purpose of your change and to be honest, it looks like even if it could work in some cases, I don't really get how it could work in a standard git repository since you cannot have both a 18.0 and a 18.0/dev branch We could imagine to support dev/18.0-something What do you think ? |
|
Hello @Xavier-Do, Thanks for your feedback! You are completely right that in a standard, single Git repository you cannot have both a However, in our setup, we use runbot with a mixture of different branching models across multiple repositories. For example:
While we can manually set the base version for these main custom branches once, our developers also follow a branching model like Does this context make sense? Let me know what you think! Best regards, |
|
But the problem is that you need a 19.0 branch as a base branch to automatically match the 19.0 odoo/enterprise one. |
|
Hello @Xavier-Do,
We have been running this patch in production for a while now and version detection, bundle grouping, and multi-repo builds work as expected with this setup. I understand this is a niche use case and that upstream may prefer the dev/19.0-something naming convention to avoid the Git ref conflict in a single repo. If you feel this pattern is not something runbot should support generically, I'm completely fine with closing the PR — we'll keep the patch in our fork. I just wanted to share that it does work in practice when the base bundle is properly defined on the main remote. Thanks again for reviewing! |
|
To be honest the structure 18.0/dev-branch looks interesting and I have no objection to make change that can improve the experience for other runbot users. My issue here is that it may work for your use cases but some features may be broken when using such branch format that could be hidden in the code base, and that you didn't notice because you don't care or you don't use the specific feature. I don't have an exhaustive list of what could break in mind, but having only the 19.0 in odoo and enterprise and not in your custom repo is not expected. Without a 19.0 branch in your project, I can't really figure out how the mergebase can be defined for diff bases checkers, and how the best commits can be found based on the mergebase too (maybe not a big issue for you) Maybe that you have another branch from your repo in the 19.0 base bundle that will be used. In any case we if we add such an hard coded way to define a branch, it would look like it is supported and it is not really the case. Wa already have some way to tweak the runbot behaviour using icp, as an example for the To cover your use case we may define a I prefer the _get than _has version to make it more versatile. |
With commit 3ec0f7e runbot supports branches with /.
But the version detection was not working for branches like 19.0/foo.