Skip to content
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

Automatic backward/forward porting? #55

Open
yajo opened this issue Jul 5, 2019 · 7 comments
Open

Automatic backward/forward porting? #55

yajo opened this issue Jul 5, 2019 · 7 comments
Labels
Bot Task A task the bot does or should do enhancement New feature or request needs spec This issue is blocked due to lack of detailed specification

Comments

@yajo
Copy link
Member

yajo commented Jul 5, 2019

This was discussed long ago at OCA/maintainer-tools#381 but it seems that today the part of version bumping is solved by the bot and... well, we have a bot; so it might be a good moment to reopen the discussion.

One of the worst parts about code maintenance here in OCA is the presence of several versions of the same code across different git branches, and I know it won't change, but today we have this bot, which is a good foundation to finally attack this problem without altering current workflow.

Odoo itself uses the same system, but they actually have a combination of bot and humans to perform the merge+forwardport loop sanely, and a different product and policy to offer, which helps their maintenance.

It would be great if the bot could handle forward ports (backward would be awesome too). To avoid the dangers of automatic code ports, all the bot should do is:

  1. Am I instructed to do the forward port? then:
  2. Try to rebase this patch onto the next version branch. Some special machinery will be needed to ignore conflicts in version bumps. Did it rebase? then:
    1. Open a PR to that new version.
    2. Assign it to whoever instructed the bot to forwardport the original PR.
  3. If it didn't rebase, just add a comment there in the original PR specifying the reasons for not forwardporting. Humans will have to handle this case.

The same for backward ports (that could be left for the future).

A cool thing to have in mind would be massive version migrations. This again can be left for the future, but imagine a scenario where Odoo 13.0 is released, then the 13.0 branches are opened, and then the bot does by itself the commit and code forward ports and opens a PR per module.

This would let humans focus in the corner cases, increasing speed of development and reducing repetitive maintenance tasks 💪, which often get undone due to their nature. 😊

@pedrobaeza
Copy link
Member

pedrobaeza commented Jul 5, 2019

It's a good idea, but the best one is the automatic migration try for all the modules.

For the forward-port/backport, this is now simpler: as the version bumping is now done by the bot, it's way easier to just cherry-pick the PR commit without conflicts and push directly for a qualified maintainer, or create the pull request. Any way, an instruction in the original PR like:

/ocabot cherry-pick branch

is very feasible, that performs:

  1. Create branch starting out of branch.
  2. Cherry-pick the commits of the PR (without extra ones that OCA Bot merger does on another branch)
  3. Create a pull request with this.

And then, the usual review or /ocabot merge instruction process will act.

For the mass migration, it looks like more a tool for maintainer-tools than something for the bot IMO.

@sbidoul sbidoul added Bot Task A task the bot does or should do enhancement New feature or request needs spec This issue is blocked due to lack of detailed specification labels Jul 5, 2019
@yajo

This comment has been minimized.

@pedrobaeza
Copy link
Member

No, I mean that you instruct the bot to make the forward-port/backport for you.

@sbidoul
Copy link
Member

sbidoul commented Nov 8, 2019

On which repo would we create the source branch for the back/forward port PR?

If we create it on the OCA repo, contributors that are not PSC members will not be able to work on it.

@yajo
Copy link
Member Author

yajo commented Nov 8, 2019

I like the way that Odoo chose. The fw port bot pings reviewers, mergers and contributors from original PR. Then if something goes wrong with the port, he notifies them every now and then. The original contributor can:

  1. Add code suggestions.
  2. Open its own PR superseding the automatic one.
  3. Open a PR against the fwport branch.

Maybe the bot should display instructions on how to do any of those.

I guess it's a matter of time until github allows adding permissions to specific PR branches.

@sbidoul
Copy link
Member

sbidoul commented Jun 1, 2020

I made myself this little tool to facilitate back/forward porting or PRs.

@yajo
Copy link
Member Author

yajo commented Jun 2, 2020

Cool, although this should be a bot job IMHO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bot Task A task the bot does or should do enhancement New feature or request needs spec This issue is blocked due to lack of detailed specification
Projects
None yet
Development

No branches or pull requests

3 participants