-
Notifications
You must be signed in to change notification settings - Fork 979
feat: Add user mention functionality to incident comments #4649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@hemangsk is attempting to deploy a commit to the KeepHQ Team on Vercel. A member of the Team first needs to authorize it. |
d2bdd19
to
8c758a1
Compare
@Kiryous may I ask your help with reviewing the UI part here? ππΌ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
Added user mention functionality to incident comments, including a new CommentMention table and UI components for handling @mentions in the activity feed.
- Added new
CommentMention
table with proper indexes and foreign key constraints in/keep/api/models/db/migrations/2025-04-29-15-21_1b12e6d6ad1f.py
- Implemented mention dropdown UI with keyboard navigation in
/keep-ui/app/(keep)/incidents/[id]/activity/ui/IncidentActivityComment.tsx
- Added mention highlighting and user data fetching in
/keep-ui/app/(keep)/incidents/[id]/activity/ui/IncidentActivityItem.tsx
- Modified
/keep/api/routes/incidents.py
to handle tagged users in comments with proper transaction management - Added
CommentMentionDto
interface and updatedAuditEvent
type in/keep-ui/entities/alerts/model/types.ts
π‘ (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!
9 file(s) reviewed, 9 comment(s)
Edit PR Review Bot Settings | Greptile
keep-ui/app/(keep)/incidents/[id]/activity/ui/IncidentActivityItem.tsx
Outdated
Show resolved
Hide resolved
keep-ui/app/(keep)/incidents/[id]/activity/ui/IncidentActivityComment.tsx
Outdated
Show resolved
Hide resolved
keep-ui/app/(keep)/incidents/[id]/activity/ui/IncidentActivityComment.tsx
Outdated
Show resolved
Hide resolved
keep-ui/app/(keep)/incidents/[id]/activity/ui/IncidentActivityComment.tsx
Outdated
Show resolved
Hide resolved
keep/api/models/db/migrations/versions/2025-04-29-15-21_1b12e6d6ad1f.py
Outdated
Show resolved
Hide resolved
tests/e2e_tests/incidents_alerts_tests/test_mentions_in_incident_comments.py
Show resolved
Hide resolved
Hey! |
@skynetigor Thanks for the review! I'll get right on it |
1ea6e5a
to
c8507ad
Compare
@skynetigor , I've updated the MR with quill-mention package and here's the comment box in action. ![]() |
keep-ui/app/(keep)/incidents/[id]/activity/ui/IncidentCommentInput.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check the comment on quill-mention.js lib
@Kiryous @skynetigor is this done? |
The latest updates on your projects. Learn more about Vercel for Git βοΈ 1 Skipped Deployment
|
@hemangsk hey! Please merge my PR into your branch and I have a few more important comments for you a bit later today. |
@Kiryous Done π |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
(updates since last review)
Added user mention functionality to incident comments with backend support and UI components.
- Added
extractTaggedUsers
utility in/keep-ui/app/(keep)/incidents/[id]/activity/lib/extractTaggedUsers.ts
to parse mentions from Quill editor content - Potential XSS vulnerability in
/keep-ui/app/(keep)/incidents/[id]/activity/ui/IncidentActivityItem.tsx
due to unsanitized HTML rendering - Added proper mention handling in
/keep/api/routes/incidents.py
with CommentMention model integration - Empty merge migration in
/keep/api/models/db/migrations/versions/2025-05-19-18-48_90e3eababbf0.py
needs review - Empty root
package.json
file needs to be addressed
17 file(s) reviewed, 14 comment(s)
Edit PR Review Bot Settings | Greptile
keep-ui/app/(keep)/incidents/[id]/activity/lib/extractTaggedUsers.ts
Outdated
Show resolved
Hide resolved
keep-ui/app/(keep)/incidents/[id]/activity/ui/IncidentActivityItem.tsx
Outdated
Show resolved
Hide resolved
keep-ui/app/(keep)/incidents/[id]/activity/ui/IncidentActivityItem.tsx
Outdated
Show resolved
Hide resolved
keep-ui/app/(keep)/incidents/[id]/activity/ui/IncidentActivityComment.tsx
Outdated
Show resolved
Hide resolved
keep/api/models/db/migrations/versions/2025-05-19-18-48_90e3eababbf0.py
Outdated
Show resolved
Hide resolved
keep/api/models/db/migrations/versions/2025-05-19-20-54_combined_commentmention.py
Outdated
Show resolved
Hide resolved
tests/e2e_tests/incidents_alerts_tests/test_mentions_in_incident_comments.py
Outdated
Show resolved
Hide resolved
tests/e2e_tests/incidents_alerts_tests/test_mentions_in_incident_comments.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @hemangsk! I left a few comments and greptileai bot also left a few important (I resolved unimportant). Please review and fix them and let's merge it!
reach out if you have questions
keep-ui/app/(keep)/incidents/[id]/activity/ui/IncidentActivityItem.tsx
Outdated
Show resolved
Hide resolved
keep-ui/app/(keep)/incidents/[id]/activity/ui/IncidentActivityItem.tsx
Outdated
Show resolved
Hide resolved
keep-ui/app/(keep)/incidents/[id]/activity/lib/extractTaggedUsers.ts
Outdated
Show resolved
Hide resolved
keep-ui/app/(keep)/incidents/[id]/activity/ui/IncidentActivityItem.tsx
Outdated
Show resolved
Hide resolved
@Kiryous , I've pushed an update and all the changes are now done Regarding #4649 (comment) I added the usage of IncidentActivity 96b35b5 Please let me know if that's alright or should we tackle it differently? |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4649 +/- ##
===========================================
- Coverage 46.14% 30.87% -15.28%
===========================================
Files 165 93 -72
Lines 17428 11051 -6377
===========================================
- Hits 8043 3412 -4631
+ Misses 9385 7639 -1746 β View full report in Codecov by Sentry. π New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hemangsk thank you for the changes, it looks good to me now! approving
π Fantastic work @hemangsk! Your very first PR to keep has been merged! ππ₯³ You've just taken your first step into open-source, and we couldn't be happier to have you onboard. π For any support, feel free to reach out on the community: https://slack.keephq.dev. Happy coding! π©βπ»π¨βπ» |
Added proper support for @mentions in incident comments. Created a dedicated CommentMention model with relationships to AlertAudit.
Closes #2187
π Description
β Checks
βΉ Additional Information
/claim #2187