Skip to content

[ADD] migration_pr_check: Remind migration guidelines - #363

Open
SirPyTech wants to merge 1 commit into
OCA:masterfrom
PyTech-SRL:imp-issue159
Open

SirPyTech wants to merge 1 commit into
OCA:masterfrom
PyTech-SRL:imp-issue159

Conversation

@SirPyTech

Copy link
Copy Markdown

Superseding #220 because https://github.com/SirTakobi is no more active.

@HekkiMelody HekkiMelody left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review, LGTM

Comment thread src/oca_github_bot/config.py Outdated

@legalsylvain legalsylvain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks !

@SirPyTech
SirPyTech marked this pull request as draft September 22, 2026 11:56
@SirPyTech
SirPyTech marked this pull request as ready for review September 22, 2026 11:58

@rousseldenis rousseldenis left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems great! Thanks!

@rousseldenis

Copy link
Copy Markdown

@OCA/core-maintainers

@rousseldenis

Copy link
Copy Markdown

@SirPyTech Do you have studied the possibility to add the migration tag on the PR too ?

@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

Comment thread src/oca_github_bot/config.py Outdated
to accommodate it to this circumstance.

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not also point to oca-port?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I though https://github.com/OCA/oca-port/ was only to port spare missing commits instead of a whole module.
Now I see it can migrate whole modules too (https://github.com/OCA/oca-port/#migrate), somehow leveraging https://github.com/OCA/odoo-module-migrator/ by the way.
Anyway I added it 👍

@SirPyTech

Copy link
Copy Markdown
Author

@SirPyTech Do you have studied the possibility to add the migration tag on the PR too ?

Thanks for having a look!
No because that and other PR management tasks are already in the ocabot migration command.
This PR's purpose is to add a little automated guidance to the contributor proposing a migration.

@SirPyTech
SirPyTech requested a review from hbrunn October 8, 2026 07:54

@hbrunn hbrunn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...but given you detect which module is added anyways, wouldn't it be great if the bot writes

/ocabot migration $module

too? I think it has write permissions, so this should actually work.

I can imagine some other stuff I'd like to see eventually, like actually enforcing all of the module's commits exist in the PR, but that would be future extensions I think.

new_addons_paths = _get_added_modules(org, repo, gh_pr)
new_addons = map(os.path.basename, new_addons_paths)
for addon in new_addons:
module_regex = re.compile(rf"- \[[ x]] {addon}")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
module_regex = re.compile(rf"- \[[ x]] {addon}")
module_regex = re.compile(rf"- \[[ x]] {addon}\b")

so as not to confuse sale and sale_stock

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @hbrunn. Your command failed:

Invalid options for command migration: .

Ocabot commands

  • ocabot merge major|minor|patch|nobump
  • ocabot rebase
  • ocabot migration {MODULE_NAME}

More information

@OCA OCA deleted a comment from OCA-git-bot Oct 9, 2026
gh_migration_issue = _find_issue(gh_repo, milestone, target_branch)

# The PR is mentioned in the migration issue
pr_regex = re.compile(rf"#({gh_pr.number})")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pr_regex = re.compile(rf"#({gh_pr.number})")
pr_regex = re.compile(rf"#({gh_pr.number})\b")

see above

@legalsylvain

Copy link
Copy Markdown
Collaborator

...but given you detect which module is added anyways, wouldn't it be great if the bot writes

this could save a lot of time for PSC ! 👍 if it's possible easily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants