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 consistent Discord “link target” mention formatting to CRM-related embeds by centralizing the formatting logic in ResumeUpdateConfirmationView, and expands unit coverage to validate the new embed output.
Changes:
- Introduces a shared formatter for Discord link mentions (
<@user_id> (username)) and uses it in both the “Resume Parsed” preview embed and “CRM Updated” success embed. - Refactors the “CRM Updated” embed construction into a dedicated
_build_apply_success_embedhelper. - Adds unit tests asserting the Discord link field includes both the
<@id>mention and username.
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/crm.py | Adds shared Discord link formatting and applies it to preview + success embeds. |
| tests/unit/test_crm.py | Adds tests validating the new Discord link mention formatting in embeds. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| return None | ||
|
|
||
| mention = f"<@{user_id}>" | ||
| return f"{mention} ({username})" if username else mention |
There was a problem hiding this comment.
_format_discord_link_value interpolates username directly into the embed field. If the stored username/display name contains @everyone, @here, or role/user mentions, this can trigger unwanted pings when the embed is sent. Consider sanitizing the username portion (e.g., discord.utils.escape_mentions(username); optionally also escape markdown) before formatting the final string, while leaving the <@id> mention intact if you want the user ping.
| return f"{mention} ({username})" if username else mention | |
| safe_username = discord.utils.escape_markdown( | |
| discord.utils.escape_mentions(username) | |
| ) | |
| return f"{mention} ({safe_username})" if username else mention |
Description
Add embed-only Discord mention formatting for the Resume Parsed and CRM Updated embeds when a Discord link target is present.
Extract the shared formatting into
ResumeUpdateConfirmationViewso both embeds render<@user_id> (username)consistently.Related Issue
None.
How Has This Been Tested?
uv run pytest tests/unit/test_crm.py -quv run ruff check apps/discord_bot/src/five08/discord_bot/cogs/crm.py tests/unit/test_crm.py