OCA / oca-github-bot

The GitHub Bot of the Odoo Community Association (OCA)
MIT License
40 stars 57 forks source link

[RFC] bot message when migration PR doesn't respect history. #159

Open legalsylvain opened 2 years ago

legalsylvain commented 2 years ago

Event : On new PR

Check : If PR name contains [MIG] (not sensitive check) AND commit quantity = 1

Message :

Thanks for the contribution.

Please preserve commit history following technical method explained in https://github.com/OCA/maintainer-tools/wiki/#migration

If the jump is between several versions, you have to modify the source branch in the main command to accommodate it to this circumstance.

You can also take a look on the project https://github.com/OCA/odoo-module-migrator/ to make easier migration

Ref : @pedrobaeza in https://github.com/OCA/web/pull/2067#issuecomment-957251756.

Nice to have feature in my opinion to avoid to repeat always the same thing. (even it will not cover all the case, specially if the PR contains more than 1 commit).

pedrobaeza commented 2 years ago

👍

rousseldenis commented 2 years ago

Mmmh, your check can be false in some repositories as they maintain branches from preceding ones (and so, len(migration commit) == 1.

I'm in favor of this, but with a check a little bit cleverer (but don't know how yet).

Apart of that, I think we should change OCA main branches behaviour with the one I described above. It will facilitate review in order to have less commit history

legalsylvain commented 2 years ago

What about to change the texte of the message ? Something like "are you sûre you preserved history" ?

legalsylvain commented 2 years ago

@rousseldenis : any pov regarding my proposal ?

rousseldenis commented 2 years ago

@rousseldenis : any pov regarding my proposal ?

Yes that's sound good.

IMHO, we should add to conditions 'if module directory isn't in repo yet'. So, this will work in all conditions I explained before.