feat: add private mode to /match-candidates#204
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 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.
Pull request overview
Adds an optional private argument to the /match-candidates Discord slash command so users can request ephemeral (private) match results, while keeping the default behavior public.
Changes:
- Add parsing/validation for a new
privatestring argument and reject invalid values with an explicit error. - Make result publishing “private-aware” by deferring ephemerally and forcing followup sends to be ephemeral when requested.
- Add unit tests covering default (public), private mode, and invalid input.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
apps/discord_bot/src/five08/discord_bot/cogs/jobs.py |
Implements private arg parsing + private-aware defer/followup sending for /match-candidates. |
tests/unit/test_crm.py |
Adds unit tests asserting ephemeral behavior for default/private modes and invalid private input. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| """Parse the thread's starter message and find matching candidates ranked by fit. | ||
|
|
||
| Must be invoked inside a thread. The starter message is used as the job posting text. | ||
| The response is posted publicly in the thread. |
There was a problem hiding this comment.
The match_candidates docstring still says "The response is posted publicly in the thread.", but the new private arg can now make results ephemeral. Update the docstring to reflect the new behavior (public by default; ephemeral when private is truthy) so it doesn’t mislead future maintainers.
| The response is posted publicly in the thread. | |
| By default, the response is posted publicly in the thread; when ``private`` is truthy, | |
| results are sent ephemerally instead. |
Description
Adds an optional
privateargument to/match-candidates.When
privateis set to a truthy value (true,1,yes,y, oron), results are posted ephemerally; default behavior remains public.Invalid values now return an explicit error.
Result publishing uses a private-aware sender path, with tests added for default behavior, private mode, and invalid input handling.
Related Issue
None.
How Has This Been Tested?
Commit hooks ran successfully (
ruff,ruff format,mypy) during commit.