-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[SILO-449] fix: add missing methods in external APIs #7601
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
WalkthroughAdds four fields to ProjectCreateSerializer, enables PATCH on issue attachment detail endpoint, and switches project_id path converter to UUID in the project members URL. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Client
participant API as API Router
participant View as IssueAttachmentDetailAPIEndpoint
participant Store as Storage/DB
Client->>API: PATCH /issues/{issue_id}/attachments/{id}
API->>View: Dispatch PATCH
alt Validation passes
View->>Store: Update attachment fields
Store-->>View: Updated record
View-->>Client: 200 OK + updated payload
else Validation fails
View-->>Client: 400/422 Error
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: CodeRabbit UI 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
✨ Finishing Touches
🧪 Generate unit tests
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. CodeRabbit Commands (Invoked using PR/Issue comments)Type 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
apps/api/plane/api/serializers/project.py (1)
48-52: Project model fields verifiedAll four newly added fields on ProjectCreateSerializer exist on the Project model and are writable:
- logo_props (models.JSONField(default=dict))
- external_source (models.CharField(max_length=255, null=True, blank=True))
- external_id (models.CharField(max_length=255, blank=True, null=True))
- is_issue_type_enabled (models.BooleanField(default=False))
Optional enhancements:
- In ProjectSerializer.validate(), add a minimal check that logo_props is a JSON-compatible type (dict/list) to catch malformed payloads early.
- If you have a fixed list of integration names, consider using a ChoiceField or manual check for external_source.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (3)
apps/api/plane/api/serializers/project.py(1 hunks)apps/api/plane/api/urls/issue.py(1 hunks)apps/api/plane/api/urls/member.py(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: NarayanBavisetti
PR: makeplane/plane#7460
File: apps/api/plane/app/serializers/draft.py:112-122
Timestamp: 2025-07-23T18:18:06.875Z
Learning: In the Plane codebase serializers, workspace_id is not consistently passed in serializer context, so parent issue validation in DraftIssueCreateSerializer only checks project_id rather than both workspace_id and project_id. The existing project member authentication system already validates that users can only access projects they belong to, providing sufficient security without risking breaking functionality by adding workspace_id validation where the context might not be available.
🔇 Additional comments (1)
apps/api/plane/api/urls/issue.py (1)
92-94: IssueAttachmentDetailAPIEndpoint PATCH behavior and serializer restrictions verified
- The endpoint defines its own
def patch(...), so partial updates are explicitly supported without relying on mixins.- Inside
patch(), only theis_uploadedflag is toggled and saved—no user-supplied blob or metadata fields are passed through the serializer for update.IssueAttachmentSerializeralready marks"workspace","project","issue", timestamps, and user fields as read-only.- Access is gated by
ProjectEntityPermission.No further changes needed.
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.
Actionable comments posted: 4
🧹 Nitpick comments (1)
apps/api/plane/api/views/member.py (1)
180-191: Simplify validation logic for required fields.The current validation can be simplified and made more robust by checking for both missing and empty values.
Apply this diff to improve the validation:
def post(self, request, slug, project_id): # ------------------- Validation ------------------- - if ( - request.data.get("email") is None - or request.data.get("display_name") is None - ): + email = request.data.get("email", "").strip() + display_name = request.data.get("display_name", "").strip() + + if not email or not display_name: return Response( { - "error": "Expected email, display_name, workspace_slug, project_id, one or more of the fields are missing." + "error": "Email and display_name are required fields." }, status=status.HTTP_400_BAD_REQUEST, ) - - email = request.data.get("email")
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
apps/api/plane/api/views/member.py(2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: NarayanBavisetti
PR: makeplane/plane#7460
File: apps/api/plane/app/serializers/draft.py:112-122
Timestamp: 2025-07-23T18:18:06.875Z
Learning: In the Plane codebase serializers, workspace_id is not consistently passed in serializer context, so parent issue validation in DraftIssueCreateSerializer only checks project_id rather than both workspace_id and project_id. The existing project member authentication system already validates that users can only access projects they belong to, providing sufficient security without risking breaking functionality by adding workspace_id validation where the context might not be available.
🧬 Code Graph Analysis (1)
apps/api/plane/api/views/member.py (4)
apps/api/plane/api/serializers/user.py (1)
UserLiteSerializer(9-34)apps/api/plane/db/models/user.py (2)
User(38-170)save(152-170)apps/api/plane/db/models/workspace.py (3)
Workspace(115-182)WorkspaceMember(202-234)save(196-199)apps/api/plane/db/models/project.py (5)
ProjectMember(206-250)Project(59-169)save(167-169)save(183-185)save(222-232)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Analyze (javascript)
- GitHub Check: Analyze (python)
🔇 Additional comments (1)
apps/api/plane/api/views/member.py (1)
256-258: Add workspace parameter to ProjectMember creation.According to the retrieved learnings and the
ProjectMembermodel which inherits fromProjectBaseModel, the workspace should be explicitly set when creating project members for consistency.Apply this diff:
project_member = ProjectMember.objects.create( - project=project, member=user, role=request.data.get("role", 5) + project=project, member=user, workspace=workspace, role=request.data.get("role", 5) )⛔ Skipped due to learnings
Learnt from: NarayanBavisetti PR: makeplane/plane#7460 File: apps/api/plane/app/serializers/draft.py:112-122 Timestamp: 2025-07-23T18:18:06.875Z Learning: In the Plane codebase serializers, workspace_id is not consistently passed in serializer context, so parent issue validation in DraftIssueCreateSerializer only checks project_id rather than both workspace_id and project_id. The existing project member authentication system already validates that users can only access projects they belong to, providing sufficient security without risking breaking functionality by adding workspace_id validation where the context might not be available.
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
apps/api/plane/api/urls/member.py(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: NarayanBavisetti
PR: makeplane/plane#7460
File: apps/api/plane/app/serializers/draft.py:112-122
Timestamp: 2025-07-23T18:18:06.875Z
Learning: In the Plane codebase serializers, workspace_id is not consistently passed in serializer context, so parent issue validation in DraftIssueCreateSerializer only checks project_id rather than both workspace_id and project_id. The existing project member authentication system already validates that users can only access projects they belong to, providing sufficient security without risking breaking functionality by adding workspace_id validation where the context might not be available.
📚 Learning: 2025-07-23T18:18:06.875Z
Learnt from: NarayanBavisetti
PR: makeplane/plane#7460
File: apps/api/plane/app/serializers/draft.py:112-122
Timestamp: 2025-07-23T18:18:06.875Z
Learning: In the Plane codebase serializers, workspace_id is not consistently passed in serializer context, so parent issue validation in DraftIssueCreateSerializer only checks project_id rather than both workspace_id and project_id. The existing project member authentication system already validates that users can only access projects they belong to, providing sufficient security without risking breaking functionality by adding workspace_id validation where the context might not be available.
Applied to files:
apps/api/plane/api/urls/member.py
🧬 Code Graph Analysis (1)
apps/api/plane/api/urls/member.py (1)
apps/api/plane/api/views/member.py (1)
ProjectMemberAPIEndpoint(103-264)
🔇 Additional comments (1)
apps/api/plane/api/urls/member.py (1)
7-7: All project routes consistently use<uuid:project_id>
Scan ofapps/api/plane/api/urlsconfirmed no remaining<str:project_id>patterns, ensuring type safety and alignment with other endpoints.
Description
Type of Change
Summary by CodeRabbit