[WEB-4435] bug: trigger event for work item comment#7331
[WEB-4435] bug: trigger event for work item comment#7331sriramveeraghanta merged 1 commit intopreviewfrom
Conversation
WalkthroughAsynchronous calls to a new Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant API_View
participant App_View
participant issue_activity (async)
participant model_activity (async)
Client->>API_View: POST/PATCH Issue Comment
API_View->>issue_activity: Enqueue activity (async)
API_View->>model_activity: Enqueue model activity (async)
API_View->>Client: Return response
Client->>App_View: Create/Update Issue Comment
App_View->>issue_activity: Enqueue activity (async)
App_View->>model_activity: Enqueue model activity (async)
App_View->>Client: Return response
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Pylint (3.3.7)apps/server/plane/api/views/issue.pyapps/server/plane/app/views/issue/comment.py📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
⏰ Context from checks skipped due to timeout of 90000ms (1)
🔇 Additional comments (5)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Pull Request Linked with Plane Work Items Comment Automatically Generated by Plane |
There was a problem hiding this comment.
Pull Request Overview
This PR ensures that a webhook event (model_activity) is triggered whenever a work item comment is created or updated.
- Adds
model_activity.delaycalls to both the Django app view and the API view for comment create/update flows - Imports
model_activityin the app view to enable the new calls
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| apps/server/plane/app/views/issue/comment.py | Imported model_activity and added calls to trigger the webhook on comment create/update |
| apps/server/plane/api/views/issue.py | Added calls to trigger the webhook on comment create/update (ensure model_activity import) |
Comments suppressed due to low confidence (2)
apps/server/plane/app/views/issue/comment.py:94
- Consider adding or updating unit tests to verify that
model_activity.delayis called with the correct parameters when comments are created or updated.
# Send the model activity
apps/server/plane/api/views/issue.py:861
- It looks like
model_activityisn't imported in this file, which will cause a NameError at runtime. Please addfrom plane.bgtasks.webhook_task import model_activityat the top.
model_activity.delay(
Description
this pull request fixes the issue where the webhook event was not being triggered when adding or updating work item comments.
Type of Change
Summary by CodeRabbit