Skip to content

Commit 44ad4a5

Browse files
committed
[FIX] migration_issue_bot: Duplicated line for PRs
A new line was created because the regex was expecting something after the module name
1 parent d6b4161 commit 44ad4a5

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/oca_github_bot/tasks/migration_issue_bot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def _set_lines_issue(gh_pr_user_login, gh_pr_number, issue_body, module):
3939
if added: # Bypass the checks for faster completion
4040
lines.append(line)
4141
continue
42-
groups = re.match(rf"^- \[( |x)\] {module}( |\r)", line)
42+
groups = re.match(rf"^- \[( |x)\] \b{module}\b", line)
4343
if groups: # Line found
4444
# Get the Old PR value
4545
regex = r"\#(\d*)"

tests/test_migration_issue_bot.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ def test_set_lines_issue(gh):
5353
f"- [x] {module} - By @{gh_pr_user_login} - #{gh_pr_number}\n"
5454
f"- [ ] z_module_1 - By @pedrobaeza - #2",
5555
),
56+
(
57+
f"Issue with list containing the module with no PR\n"
58+
f"- [x] {module}\n"
59+
f"- [ ] z_module_1 - By @pedrobaeza - #2",
60+
f"Issue with list containing the module with no PR\n"
61+
f"- [x] {module} - By @{gh_pr_user_login} - #{gh_pr_number}\n"
62+
f"- [ ] z_module_1 - By @pedrobaeza - #2",
63+
),
5664
(
5765
"Issue with no list",
5866
f"Issue with no list\n"

0 commit comments

Comments
 (0)