feat: do not autoreply to noreply@ and no-reply@ senders - #13467
Conversation
|
Thanks for the fix! |
ChristophWurst
left a comment
There was a problem hiding this comment.
Makes sense!
Did not test
|
@coderabbitai review the changes and double-check the Sieve syntax validity |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- PR metadata ---'
gh pr view 13467 --repo nextcloud/mail --json title,baseRefName,headRefName,files
printf '%s\n' '--- Changed diff ---'
gh pr diff 13467 --repo nextcloud/mail --patch
printf '%s\n' '--- Sieve-related files ---'
fd -t f . | rg -i 'sieve|autorepl|vacation'
printf '%s\n' '--- Sieve references, excluding generated/dependency paths ---'
rg -n -i -C 3 'sieve|autoreply|auto.?reply|vacation|noreply|no-reply' \
-g '!node_modules/**' -g '!vendor/**' -g '!dist/**' -g '!build/**' .Length of output: 198664 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- PR metadata and changed files ---'
gh pr view 13467 --repo nextcloud/mail --json files --jq '.files[] | "\(.path) (+\(.additions) -\(.deletions))"'
printf '%s\n' '--- Exact PR patch ---'
gh pr diff 13467 --repo nextcloud/mail --patch -- \
lib/Service/OutOfOffice/OutOfOfficeParser.php \
tests/Unit/Service/OutOfOffice/OutOfOfficeParserTest.php \
tests/data/sieve-vacation-on.sieve \
tests/data/sieve-vacation-on-no-end-date.sieve \
tests/data/sieve-vacation-on-subject-placeholder.sieve \
tests/data/sieve-vacation-on-special-chars-message.sieve \
tests/data/sieve-vacation-on-special-chars-subject.sieve
printf '%s\n' '--- Generator ---'
sed -n '80,195p' lib/Service/OutOfOffice/OutOfOfficeParser.php
printf '%s\n' '--- Out-of-office fixtures that contain the new condition ---'
rg -n -i -C 8 'noreply@|no-reply@|automaticMailCondition|vacation' tests/data -g '*.sieve'
printf '%s\n' '--- Existing syntax pattern used by the filter builder ---'
sed -n '35,65p' lib/Service/MailFilter/FilterBuilder.phpLength of output: 1530 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- Complete PR patch ---'
gh pr diff 13467 --repo nextcloud/mail --patch
printf '%s\n' '--- Changed source with line numbers ---'
nl -ba lib/Service/OutOfOffice/OutOfOfficeParser.php | sed -n '115,185p'
printf '%s\n' '--- Relevant test coverage ---'
nl -ba tests/Unit/Service/OutOfOffice/OutOfOfficeParserTest.php | sed -n '75,185p'Length of output: 1981 🤖 web_search executed:
Length of output: 14653
The Sieve syntax is valid. RFC 5228 defines the form: address [COMPARATOR] [ADDRESS-PART] [MATCH-TYPE] <header-list> <key-list>The generated expression uses valid ✅ Action performedReview finished.
|
📝 WalkthroughWalkthroughThe out-of-office parser now excludes messages with ChangesAutomatic-mail filtering
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: 🟡 Moderate · up to The PR changes autoreply filtering, but the existing Sieve fixture does not match the new output and focused tests for the affected sender headers are missing. Merge should wait until the fixture and coverage are updated. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: f6107c9f-1971-4f59-a3cd-157435f38237
📒 Files selected for processing (1)
lib/Service/OutOfOffice/OutOfOfficeParser.php
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.
| $skipConditions = [ | ||
| 'exists "List-Id"', | ||
| 'exists "List-Unsubscribe"', | ||
| 'address :all :matches ["From", "Sender"] ["noreply@*", "no-reply@*"]', | ||
| ]; | ||
|
|
||
| $automaticMailCondition = 'anyof(' . join(', ', $skipConditions) . ')'; |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Update the enabled-responder fixture before merging.
The new condition changes the complete Sieve output. tests/Unit/Service/OutOfOffice/OutOfOfficeParserTest.php still compares that output with tests/data/sieve-vacation-on.sieve, which does not contain the new address condition. Update the fixture and add focused coverage for both noreply@* and no-reply@* in the From and Sender headers.
fd56cc7 to
9aa8afd
Compare
|
Updating the branch for a full CI run |
|
The AI rabbit is right, tests need adjustment :) |
Signed-off-by: Roberto Guido <info@madbob.org>
Do not autoreply to
noreply@andno-reply@senders.Fixes #11600
🤖 AI (if applicable)
I've asked an advice to Gemini about Sieve syntax.
Summary by CodeRabbit
noreply@*orno-reply@*.List-IdandList-Unsubscribeheaders.