Skip to content
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
4 changes: 3 additions & 1 deletion dev-tools/pr_review/sqlite_hosted_capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"<!-- This is an auto-generated (?:comment|reply) by CodeRabbit -->[ \t\r\n]*\Z"
)

Expand Down
4 changes: 4 additions & 0 deletions dev-tools/validation/test_pr_review_sqlite_hosted_capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -1027,6 +1027,8 @@ def test_final_fingerprint_accepts_only_empty_or_known_auxiliary_tail(self) -> N
"\n\n_Source: Coding guidelines_\n<!-- This is an auto-generated comment by CodeRabbit -->\n",
"\n\n_Source: Linters/SAST tools_\n<!-- This is an auto-generated comment by CodeRabbit -->\n",
"\n\n_Source: Linters/SAST tools_\n<!-- This is an auto-generated reply by CodeRabbit -->\n",
"\n\n_Sources: Coding guidelines_\n<!-- This is an auto-generated comment by CodeRabbit -->\n",
"\n\n_Sources: Coding guidelines, Path instructions_\n<!-- This is an auto-generated comment by CodeRabbit -->\n",
)
for tail in valid_tails:
with self.subTest(tail=tail):
Expand All @@ -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<!-- This is an auto-generated comment by CodeRabbit -->",
"\n_Source: Coding guidelines_",
"\n_Source: Linters/SAST tools_\n<!-- This is an auto-generated reply by another bot -->",
"\n_Sources: Coding guidelines, Unknown source_\n<!-- This is an auto-generated comment by CodeRabbit -->",
"\n_Sources: Coding guidelines, Path instructions_\nunmarked content\n<!-- This is an auto-generated comment by CodeRabbit -->",
)
for tail in invalid_tails:
with (
Expand Down
Loading