Skip to content

Commit 46ba364

Browse files
committed
branch_worker: update ai_review_comment_preprocessor
A regex detecting start of the response is now wrong, because AI may also quote the original commit message. Use a different marker: a line starting with '>' with at least one non-whitespace character. That would be a start of a quote. Relevant discussion here: https://lore.kernel.org/bpf/65231eeb-1f00-4af2-9234-a290ea3f6585@meta.com/ Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
1 parent 13c68ed commit 46ba364

File tree

4 files changed

+143
-3
lines changed

4 files changed

+143
-3
lines changed

kernel_patches_daemon/branch_worker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,8 +1452,8 @@ async def submit_pr_summary(
14521452
pr_summary_report.add(1)
14531453

14541454
def ai_review_comment_preprocessor(self, body: str) -> str:
1455-
# find the first line starting with > and remove everyting prior
1456-
match = re.search(r"^> diff --git.*$", body, re.MULTILINE)
1455+
# find the first line starting with > and remove everything prior
1456+
match = re.search(r"^>\s*\S.*$", body, re.MULTILINE)
14571457
if match:
14581458
body = body[match.start() :]
14591459
# remove triple backticks
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
```
2+
commit f636685cc0b05bb758bb58729cc65dde79ac7108
3+
Author: Leon Hwang <leon.hwang@linux.dev>
4+
5+
bpf: Add bpf_arch_supports_fsession()
6+
7+
This commit adds architecture-specific gating for fsession programs,
8+
returning -EOPNOTSUPP when the architecture does not implement fsession
9+
support, instead of failing at runtime with -EFAULT.
10+
11+
> bpf: Add bpf_arch_supports_fsession()
12+
13+
The commit subject references bpf_arch_supports_fsession(), but the
14+
actual function implemented is named bpf_jit_supports_fsession().
15+
16+
> Introduce bpf_arch_supports_fsession() to explicitly gate fsession usage
17+
> based on architecture support.
18+
19+
Similarly, the commit body describes bpf_arch_supports_fsession(), while
20+
the code uses bpf_jit_supports_fsession().
21+
22+
Should the commit message be updated to match the actual function name?
23+
The function follows the existing bpf_jit_supports_*() naming convention
24+
used by similar functions in the codebase.
25+
26+
> diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
27+
> index 5a075e06cf..070ba80e39 100644
28+
> --- a/arch/x86/net/bpf_jit_comp.c
29+
> +++ b/arch/x86/net/bpf_jit_comp.c
30+
> @@ -4112,3 +4112,8 @@ bool bpf_jit_supports_timed_may_goto(void)
31+
> {
32+
> return true;
33+
> }
34+
> +
35+
> +bool bpf_jit_supports_fsession(void)
36+
^^^^^^^^^^^^^^^^^^^^^^^^^^
37+
This is the actual function name in the code.
38+
39+
> +{
40+
> + return true;
41+
> +}
42+
43+
[ ... ]
44+
45+
> diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
46+
> index e0b8a8a5aa..3b1eb632bf 100644
47+
> --- a/kernel/bpf/core.c
48+
> +++ b/kernel/bpf/core.c
49+
> @@ -3142,6 +3142,11 @@ bool __weak bpf_jit_supports_insn(struct bpf_insn *insn, bool in_arena)
50+
> return false;
51+
> }
52+
> +
53+
> +bool __weak bpf_jit_supports_fsession(void)
54+
> +{
55+
> + return false;
56+
> +}
57+
58+
59+
```
60+
61+
---
62+
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
63+
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
64+
65+
In-Reply-To-Subject: `bpf: Add bpf_arch_supports_fsession()`
66+
CI run summary: https://github.com/kernel-patches/bpf/actions/runs/21443677441
67+
68+
AI-authorship-score: low
69+
AI-authorship-explanation: The naming inconsistency between commit message and code suggests a human renaming the function during development without updating the commit message, not AI-generated content.
70+
issues-found: 1
71+
issue-severity-score: low
72+
issue-severity-explanation: Documentation-only issue - commit message function name does not match actual code, which may confuse future code archaeology but has no runtime impact.
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
> bpf: Add bpf_arch_supports_fsession()
2+
3+
The commit subject references bpf_arch_supports_fsession(), but the
4+
actual function implemented is named bpf_jit_supports_fsession().
5+
6+
> Introduce bpf_arch_supports_fsession() to explicitly gate fsession usage
7+
> based on architecture support.
8+
9+
Similarly, the commit body describes bpf_arch_supports_fsession(), while
10+
the code uses bpf_jit_supports_fsession().
11+
12+
Should the commit message be updated to match the actual function name?
13+
The function follows the existing bpf_jit_supports_*() naming convention
14+
used by similar functions in the codebase.
15+
16+
> diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
17+
> index 5a075e06cf..070ba80e39 100644
18+
> --- a/arch/x86/net/bpf_jit_comp.c
19+
> +++ b/arch/x86/net/bpf_jit_comp.c
20+
> @@ -4112,3 +4112,8 @@ bool bpf_jit_supports_timed_may_goto(void)
21+
> {
22+
> return true;
23+
> }
24+
> +
25+
> +bool bpf_jit_supports_fsession(void)
26+
^^^^^^^^^^^^^^^^^^^^^^^^^^
27+
This is the actual function name in the code.
28+
29+
> +{
30+
> + return true;
31+
> +}
32+
33+
[ ... ]
34+
35+
> diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
36+
> index e0b8a8a5aa..3b1eb632bf 100644
37+
> --- a/kernel/bpf/core.c
38+
> +++ b/kernel/bpf/core.c
39+
> @@ -3142,6 +3142,11 @@ bool __weak bpf_jit_supports_insn(struct bpf_insn *insn, bool in_arena)
40+
> return false;
41+
> }
42+
> +
43+
> +bool __weak bpf_jit_supports_fsession(void)
44+
> +{
45+
> + return false;
46+
> +}
47+
48+
49+
---
50+
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
51+
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
52+
53+
CI run summary: https://github.com/kernel-patches/bpf/actions/runs/21443677441
54+
55+
AI-authorship-score: low
56+
AI-authorship-explanation: The naming inconsistency between commit message and code suggests a human renaming the function during development without updating the commit message, not AI-generated content.
57+
issues-found: 1
58+
issue-severity-score: low
59+
issue-severity-explanation: Documentation-only issue - commit message function name does not match actual code, which may confuse future code archaeology but has no runtime impact.

tests/test_branch_worker.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1737,7 +1737,16 @@ def test_ai_review_comment_preprocessor(self):
17371737
"test_ai_review_comment_preprocessor/expected-email-body.txt"
17381738
)
17391739
email_body = self._bw.ai_review_comment_preprocessor(comment_body)
1740-
print(email_body)
1740+
self.assertEqual(email_body, expected_email_body)
1741+
1742+
def test_ai_review_comment_preprocessor2(self):
1743+
comment_body = read_test_data_file(
1744+
"test_ai_review_comment_preprocessor/comment-body2.md"
1745+
)
1746+
expected_email_body = read_test_data_file(
1747+
"test_ai_review_comment_preprocessor/expected-email-body2.txt"
1748+
)
1749+
email_body = self._bw.ai_review_comment_preprocessor(comment_body)
17411750
self.assertEqual(email_body, expected_email_body)
17421751

17431752
def test_pr_comment_body_to_email_body_with_no_preprocessor(self):

0 commit comments

Comments
 (0)