Skip to content

Commit

Permalink
[FIX] migration_issue_bot: Duplicated line for PRs
Browse files Browse the repository at this point in the history
A new line was created because the regex was expecting something after the module name
  • Loading branch information
SirTakobi committed Oct 17, 2022
1 parent d6b4161 commit 44ad4a5
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 44ad4a5

Please sign in to comment.