-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[WEB-5050] feat: updated work item urls with issues. #7871
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
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughReplaces Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant C as Client
participant R as Router (__init__.py)
participant WI as work_item module
participant L as label module
participant V as View handlers
rect rgb(242,244,248)
note over R: Aggregates many pattern groups incl. work_item & label
C->>R: GET /workspaces/{slug}/projects/{id}/work-items/...
R->>WI: Match new or legacy work-item patterns
WI->>V: Dispatch to work-item view
V-->>C: Response
end
rect rgb(238,248,242)
note over R: New label routes
C->>R: GET /workspaces/{slug}/projects/{id}/labels/...
R->>L: Match label patterns
L->>V: Dispatch to label view
V-->>C: Response
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ 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. 🧪 Early access (Sonnet 4.5): enabledWe are currently testing the Sonnet 4.5 model, which is expected to improve code review quality. However, this model may lead to increased noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience. Note:
Comment |
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.
Pull Request Overview
This PR introduces new URL patterns for work items as a replacement for the existing issue URLs, while maintaining backward compatibility. The changes rename "issues" to "work-items" in the URL paths and separate label endpoints into their own module.
- Created new work-item URL patterns that mirror existing issue functionality
- Separated label endpoints into dedicated label.py module
- Maintained backward compatibility by combining old and new URL patterns
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 10 comments.
| File | Description |
|---|---|
| apps/api/plane/api/urls/workitem.py | Renamed from issue.py, added new work-item URL patterns and deprecated old issue patterns |
| apps/api/plane/api/urls/label.py | New file containing label endpoints moved from workitem.py |
| apps/api/plane/api/urls/init.py | Updated imports to use workitem patterns and added label patterns |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/api/plane/api/urls/workitem.py (1)
31-39: Add missing PUT upsert routes for IssueDetailAPIEndpoint
Insert the following before the existing list routes in apps/api/plane/api/urls/workitem.py (once in the “issues/” block at lines 31–39, and once in the “work-items/” block at lines 95–103):path( "workspaces/<str:slug>/projects/<uuid:project_id>/issues/", + IssueDetailAPIEndpoint.as_view(http_method_names=["put"]), + name="issue-upsert", ), path( "workspaces/<str:slug>/projects/<uuid:project_id>/issues/", IssueListCreateAPIEndpoint.as_view(http_method_names=["get", "post"]), name="issue", ),path( "workspaces/<str:slug>/projects/<uuid:project_id>/work-items/", + IssueDetailAPIEndpoint.as_view(http_method_names=["put"]), + name="workitem-upsert", ), path( "workspaces/<str:slug>/projects/<uuid:project_id>/work-items/", IssueListCreateAPIEndpoint.as_view(http_method_names=["get", "post"]), name="workitem", ),This ensures the
putmethod in IssueDetailAPIEndpoint is reachable.
🧹 Nitpick comments (3)
apps/api/plane/api/urls/workitem.py (1)
134-143: Consider simplifying attachment paths under work-items.The segment "issue-attachments" under a "work-items" prefix is semantically mixed. If possible, add a new alias "attachments/" for the new routes while keeping the old ones for back-compat.
Example:
path( - "workspaces/<str:slug>/projects/<uuid:project_id>/work-items/<uuid:issue_id>/issue-attachments/", + "workspaces/<str:slug>/projects/<uuid:project_id>/work-items/<uuid:issue_id>/attachments/", IssueAttachmentListCreateAPIEndpoint.as_view(http_method_names=["get", "post"]), - name="workitem-attachment", + name="workitem-attachment", ), path( - "workspaces/<str:slug>/projects/<uuid:project_id>/work-items/<uuid:issue_id>/issue-attachments/<uuid:pk>/", + "workspaces/<str:slug>/projects/<uuid:project_id>/work-items/<uuid:issue_id>/attachments/<uuid:pk>/", IssueAttachmentDetailAPIEndpoint.as_view(http_method_names=["get", "patch", "delete"]), - name="workitem-attachment-detail", + name="workitem-attachment-detail", ),apps/api/plane/api/urls/__init__.py (1)
22-22: If you keep duplicate names between old/new, consider ordering.Placing workitem_patterns before deprecated ones will make reverse() prefer new paths.
Apply:
urlpatterns = [ *asset_patterns, *project_patterns, *state_patterns, - *workitem_patterns, + *workitem_patterns, *cycle_patterns, *module_patterns, *intake_patterns, *member_patterns, *user_patterns, *label_patterns, ](If not handled within workitem.py via urlpatterns = new + old.)
apps/api/plane/api/urls/label.py (1)
6-17: Optional: disambiguate route names.Both routes are named "label". Django can resolve based on provided kwargs, but unique names ("label-list", "label-detail") improve clarity and avoid future ambiguity.
urlpatterns = [ path( "workspaces/<str:slug>/projects/<uuid:project_id>/labels/", LabelListCreateAPIEndpoint.as_view(http_method_names=["get", "post"]), - name="label", + name="label-list", ), path( "workspaces/<str:slug>/projects/<uuid:project_id>/labels/<uuid:pk>/", LabelDetailAPIEndpoint.as_view(http_method_names=["get", "patch", "delete"]), - name="label", + name="label-detail", ), ]
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
apps/api/plane/api/urls/__init__.py(1 hunks)apps/api/plane/api/urls/label.py(1 hunks)apps/api/plane/api/urls/workitem.py(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
apps/api/plane/api/urls/label.py (1)
apps/api/plane/api/views/issue.py (2)
LabelListCreateAPIEndpoint(801-924)LabelDetailAPIEndpoint(927-1033)
apps/api/plane/api/urls/workitem.py (1)
apps/api/plane/api/views/issue.py (11)
WorkspaceIssueAPIEndpoint(161-235)IssueListCreateAPIEndpoint(238-481)IssueDetailAPIEndpoint(484-798)IssueLinkListCreateAPIEndpoint(1036-1137)IssueLinkDetailAPIEndpoint(1140-1280)IssueCommentListCreateAPIEndpoint(1283-1436)IssueCommentDetailAPIEndpoint(1439-1608)IssueActivityListAPIEndpoint(1611-1660)IssueActivityDetailAPIEndpoint(1663-1715)IssueAttachmentListCreateAPIEndpoint(1718-1930)IssueAttachmentDetailAPIEndpoint(1933-2134)
🔇 Additional comments (1)
apps/api/plane/api/urls/__init__.py (1)
3-3: Aggregation update looks correct.Switching to workitem_patterns and appending label_patterns is consistent with the routing refactor. No issues spotted.
Also applies to: 16-16
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: 0
🧹 Nitpick comments (1)
apps/api/plane/api/urls/work_item.py (1)
135-142: Clarify attachment route naming for the new work-item API.
The new work-item endpoints still exposeissue-attachments/in the path, which contradicts the “work-items” terminology you’re introducing and can confuse clients consuming the refreshed API surface. Keepingissue-attachmentsavailable via the deprecated block is great for backward compatibility, but the new block should present the updated naming so consumers aren’t stuck with legacy terminology.Apply this diff to align the new routes with the work-item vocabulary:
@@ - "workspaces/<str:slug>/projects/<uuid:project_id>/work-items/<uuid:issue_id>/issue-attachments/", + "workspaces/<str:slug>/projects/<uuid:project_id>/work-items/<uuid:issue_id>/attachments/", @@ - "workspaces/<str:slug>/projects/<uuid:project_id>/work-items/<uuid:issue_id>/issue-attachments/<uuid:pk>/", + "workspaces/<str:slug>/projects/<uuid:project_id>/work-items/<uuid:issue_id>/attachments/<uuid:pk>/",
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
apps/api/plane/api/urls/__init__.py(1 hunks)apps/api/plane/api/urls/work_item.py(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
apps/api/plane/api/urls/work_item.py (1)
apps/api/plane/api/views/issue.py (11)
WorkspaceIssueAPIEndpoint(161-235)IssueListCreateAPIEndpoint(238-481)IssueDetailAPIEndpoint(484-798)IssueLinkListCreateAPIEndpoint(1036-1137)IssueLinkDetailAPIEndpoint(1140-1280)IssueCommentListCreateAPIEndpoint(1283-1436)IssueCommentDetailAPIEndpoint(1439-1608)IssueActivityListAPIEndpoint(1611-1660)IssueActivityDetailAPIEndpoint(1663-1715)IssueAttachmentListCreateAPIEndpoint(1718-1930)IssueAttachmentDetailAPIEndpoint(1933-2134)
⏰ 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). (1)
- GitHub Check: Analyze (javascript)
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: 0
🧹 Nitpick comments (1)
apps/api/plane/api/urls/__init__.py (1)
12-23: Surface deprecation explicitly (headers + docs + tests).Recommend:
- Add Deprecation and optional Sunset headers on legacy endpoints.
- Document migration in API docs/SDKs; note removal date.
- Add tests ensuring old routes resolve/redirect and names still reverse.
Minimal inline note to prevent future reorder regressions:
urlpatterns = [ - *asset_patterns, + # NOTE: URL order is significant—keep specific sub-resources ahead of any generic catch-alls. + *asset_patterns,
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/api/plane/api/urls/__init__.py(1 hunks)
⏰ 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). (1)
- GitHub Check: Analyze (javascript)
🔇 Additional comments (3)
apps/api/plane/api/urls/__init__.py (3)
4-4: LGTM: label routes inclusion.Bringing
label_patternsin and aggregating them here looks good.Also applies to: 16-16
6-8: No generic or catch-all URL patterns detected; route order change is safe.Verified that the
project,state, andmoduleURL modules contain no<path:…>converters or wildcard*inre_path, so moving their groups earlier poses no shadowing risk.
10-10: Backward compatibility confirmed: legacy issue URLs remain available. old_url_patterns in work_item.py (with names like “issue”, “issue-search”, etc.) are merged into work_item_patterns and included in init.py’s urlpatterns, so all /issues/* routes and URL names continue to resolve.
|
Linked to Plane Work Item(s) This comment was auto-generated by Plane |
* feat: updated work item urls with issues. * chore: updated urls names * chore: rename file * chore: code refactor for url ordering * fix: renamed issue-atachments to attachments
Description
Type of Change
Summary by CodeRabbit
New Features
Changes
Deprecations