Skip to content

Commit

Permalink
Merge pull request #215 from SirTakobi/fix-issue214
Browse files Browse the repository at this point in the history
[FIX] ocabot migration duplicating lines in migration issue?
  • Loading branch information
sbidoul authored Oct 18, 2022
2 parents 0d64b24 + 44ad4a5 commit 74bee31
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
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

0 comments on commit 74bee31

Please sign in to comment.