feat: add ignored_slash_commands setting to skip foreign-bot comments#273
feat: add ignored_slash_commands setting to skip foreign-bot comments#273eg-ayoub wants to merge 1 commit into
Conversation
7f60778 to
813e7a2
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #273 +/- ##
==========================================
+ Coverage 89.62% 89.70% +0.07%
==========================================
Files 81 81
Lines 10614 10680 +66
==========================================
+ Hits 9513 9580 +67
+ Misses 1101 1100 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Design feedback
|
813e7a2 to
3d677d4
Compare
|
ok @matthiasL-scality I will first split this into two PRs and we'll look at them separately. |
3d677d4 to
e9fdd63
Compare
Bert-E's reactor treats any comment starting with `/word` as a shorthand for one of its own commands, and posts an "UnknownCommand" reply when the keyword doesn't match a registered command. On pull requests shared with bots such as CodeRabbit, Gemini or GitHub Copilot, that behaviour produces noisy "unknown command" replies every time a user runs `/coderabbit review`, `/gemini …`, `/copilot …`, etc. Add a new optional `ignored_slash_commands` list setting. When a comment starts with `/<keyword>` and `<keyword>` (case-insensitive) is on the list, the reactor drops the comment silently instead of dispatching. The check applies only to the `/…` shorthand; comments that explicitly address Bert-E via its `@<robot>` mention are unaffected. Backward-compatible: the marshmallow schema defaults the field to `[]`, `handle_comments` reads it via `settings.get(..., [])`, and the reactor methods default `ignored_slash_commands` to `()`, so existing settings files that never mention the option keep working unchanged. Ticket: PTFE-3408 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
e9fdd63 to
7422ee2
Compare
|
@matthiasL-scality this is the offshoot PR #274 for the approve issue |
Bert-E's reactor treats any comment starting with
/wordas a shorthand for one of its own commands, and posts an "UnknownCommand" reply when the keyword doesn't match a registered command. On pull requests shared with bots such as CodeRabbit, Gemini or GitHub Copilot, that behaviour produces noisy "unknown command" replies every time a user runs/coderabbit review,/gemini …,/copilot …, etc.Add a new optional
ignored_slash_commandslist setting. When a comment starts with/<keyword>and<keyword>(case-insensitive) is on the list, the reactor drops the comment silently instead of dispatching.The check applies only to the
/…shorthand; comments that explicitly address Bert-E via its@<robot>mention are unaffected.Backward-compatible: the marshmallow schema defaults the field to
[],handle_commentsreads it viasettings.get(..., []), and the reactor methods defaultignored_slash_commandsto(), so existing settings files that never mention the option keep working unchanged.Ticket: PTFE-3408