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

[FIX] ocabot migration duplicating lines in migration issue? #215

Merged
merged 1 commit into from
Oct 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/oca_github_bot/tasks/migration_issue_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def _set_lines_issue(gh_pr_user_login, gh_pr_number, issue_body, module):
if added: # Bypass the checks for faster completion
lines.append(line)
continue
groups = re.match(rf"^- \[( |x)\] {module}( |\r)", line)
groups = re.match(rf"^- \[( |x)\] \b{module}\b", line)
if groups: # Line found
# Get the Old PR value
regex = r"\#(\d*)"
Expand Down
8 changes: 8 additions & 0 deletions tests/test_migration_issue_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ def test_set_lines_issue(gh):
f"- [x] {module} - By @{gh_pr_user_login} - #{gh_pr_number}\n"
f"- [ ] z_module_1 - By @pedrobaeza - #2",
),
(
f"Issue with list containing the module with no PR\n"
f"- [x] {module}\n"
f"- [ ] z_module_1 - By @pedrobaeza - #2",
f"Issue with list containing the module with no PR\n"
f"- [x] {module} - By @{gh_pr_user_login} - #{gh_pr_number}\n"
f"- [ ] z_module_1 - By @pedrobaeza - #2",
),
(
"Issue with no list",
f"Issue with no list\n"
Expand Down