From eeaeda51332d510fdeeaf138b594e620ac6d41ef Mon Sep 17 00:00:00 2001 From: Ben Hook <5009589+benhook1013@users.noreply.github.com> Date: Fri, 2 Oct 2026 22:47:18 +1300 Subject: [PATCH] fix(review): accept plural CodeRabbit source footers --- dev-tools/pr_review/sqlite_hosted_capture.py | 4 +++- dev-tools/validation/test_pr_review_sqlite_hosted_capture.py | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/dev-tools/pr_review/sqlite_hosted_capture.py b/dev-tools/pr_review/sqlite_hosted_capture.py index 5205ba9af2..ad48f420ad 100644 --- a/dev-tools/pr_review/sqlite_hosted_capture.py +++ b/dev-tools/pr_review/sqlite_hosted_capture.py @@ -260,8 +260,10 @@ def record_hosted_terminal_result( "cr-indicator-types:", "cr-comment:v1:", ) +_HOSTED_SOURCE_LABEL = r"(?:Path instructions|Learnings|Coding guidelines|Linters/SAST tools)" _HOSTED_COMMENT_FOOTER = re.compile( - r"\A[ \t\r\n]*(?:_Source: (?:Path instructions|Learnings|Coding guidelines|Linters/SAST tools)_[ \t]*\r?\n[ \t\r\n]*)?" + rf"\A[ \t\r\n]*(?:_(?:Source: {_HOSTED_SOURCE_LABEL}|Sources: {_HOSTED_SOURCE_LABEL}(?:, {_HOSTED_SOURCE_LABEL})*)_" + r"[ \t]*\r?\n[ \t\r\n]*)?" r"[ \t\r\n]*\Z" ) diff --git a/dev-tools/validation/test_pr_review_sqlite_hosted_capture.py b/dev-tools/validation/test_pr_review_sqlite_hosted_capture.py index 16c5de1648..0669ae750c 100644 --- a/dev-tools/validation/test_pr_review_sqlite_hosted_capture.py +++ b/dev-tools/validation/test_pr_review_sqlite_hosted_capture.py @@ -1027,6 +1027,8 @@ def test_final_fingerprint_accepts_only_empty_or_known_auxiliary_tail(self) -> N "\n\n_Source: Coding guidelines_\n\n", "\n\n_Source: Linters/SAST tools_\n\n", "\n\n_Source: Linters/SAST tools_\n\n", + "\n\n_Sources: Coding guidelines_\n\n", + "\n\n_Sources: Coding guidelines, Path instructions_\n\n", ) for tail in valid_tails: with self.subTest(tail=tail): @@ -1043,6 +1045,8 @@ def test_final_fingerprint_accepts_only_empty_or_known_auxiliary_tail(self) -> N "\n_Source: Linters/SAST tools_\nUnmarked text.\n", "\n_Source: Coding guidelines_", "\n_Source: Linters/SAST tools_\n", + "\n_Sources: Coding guidelines, Unknown source_\n", + "\n_Sources: Coding guidelines, Path instructions_\nunmarked content\n", ) for tail in invalid_tails: with (