- Notifications
You must be signed in to change notification settings - Fork3k
[WEB-5537]refactor: rename IssueUserProperty to ProjectUserProperty and update related references#8206
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:preview
Are you sure you want to change the base?
Conversation
…related references across the codebase
Linked to Plane Work Item(s) This comment was auto-generated byPlane |
coderabbitaibot commentedDec 1, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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. WalkthroughUser-project properties renamed/moved from IssueUserProperty to ProjectUserProperty with new fields and constraints; migrations added (schema + data) to migrate data; serializers, views, URLs, tasks, management commands, and tests updated; APIToken.allowed_rate_limit field added. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for usingCodeRabbit! 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.
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 (2)
apps/api/plane/db/models/api.py (1)
35-39:Newallowed_rate_limitfield is consistent with migration; consider minor cleanupsThe
allowed_rate_limitCharField with default"60/min"looks fine and matches the migration; this should be safe for existing tokens. You may also want to (optionally) addhelp_textclarifying the expected format and fix the existing typo"API Tokems"inverbose_name_pluralwhile you’re in this model.apps/api/plane/db/migrations/0113_alter_issueuserproperty_table.py (1)
1-38:Migration sequence and new fields look consistent with the model changesThe migration cleanly renames the
IssueUserPropertytable/model toProjectUserPropertyand adds theallowed_rate_limit,preferences, andsort_orderfields in line with the model definitions. If you want extra long‑term safety, you could inline a simple dict default forpreferencesin this migration instead of importingget_default_preferences, but it’s not strictly required.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (16)
apps/api/plane/api/views/project.py(3 hunks)apps/api/plane/app/serializers/issue.py(2 hunks)apps/api/plane/app/urls/issue.py(1 hunks)apps/api/plane/app/views/issue/base.py(3 hunks)apps/api/plane/app/views/project/base.py(3 hunks)apps/api/plane/app/views/project/invite.py(2 hunks)apps/api/plane/app/views/project/member.py(3 hunks)apps/api/plane/bgtasks/workspace_seed_task.py(2 hunks)apps/api/plane/db/management/commands/create_project_member.py(2 hunks)apps/api/plane/db/migrations/0113_alter_issueuserproperty_table.py(1 hunks)apps/api/plane/db/migrations/0114_auto_20251201_0857.py(1 hunks)apps/api/plane/db/models/__init__.py(1 hunks)apps/api/plane/db/models/api.py(1 hunks)apps/api/plane/db/models/issue.py(0 hunks)apps/api/plane/db/models/project.py(1 hunks)apps/api/plane/tests/contract/app/test_project_app.py(3 hunks)
💤 Files with no reviewable changes (1)
- apps/api/plane/db/models/issue.py
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-07-23T18:18:06.875Z
Learnt from: NarayanBavisettiRepo: makeplane/plane PR: 7460File: apps/api/plane/app/serializers/draft.py:112-122Timestamp: 2025-07-23T18:18:06.875ZLearning: 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/app/views/project/member.pyapps/api/plane/app/serializers/issue.pyapps/api/plane/api/views/project.pyapps/api/plane/tests/contract/app/test_project_app.pyapps/api/plane/bgtasks/workspace_seed_task.py
📚 Learning: 2025-10-29T09:17:54.815Z
Learnt from: NarayanBavisettiRepo: makeplane/plane PR: 7905File: apps/api/plane/app/views/search/base.py:241-276Timestamp: 2025-10-29T09:17:54.815ZLearning: In apps/api/plane/app/views/search/base.py, the `filter_intakes` method uses `Issue.objects` (base manager) instead of `Issue.issue_objects` (custom manager) because the custom manager filters out all intake statuses, which would prevent querying pending and snoozed intake issues.Applied to files:
apps/api/plane/api/views/project.pyapps/api/plane/app/views/issue/base.py
📚 Learning: 2025-09-12T07:29:36.083Z
Learnt from: dheeru0198Repo: makeplane/plane PR: 7625File: apps/api/plane/bgtasks/workspace_seed_task.py:95-98Timestamp: 2025-09-12T07:29:36.083ZLearning: In the Plane codebase, workspace seed data should have project features (cycle_view, module_view, issue_views_view) enabled by default, even when regular project creation has these features disabled. This provides users with a complete demo experience in the seeded workspace.Applied to files:
apps/api/plane/bgtasks/workspace_seed_task.py
🧬 Code graph analysis (14)
apps/api/plane/app/views/project/member.py (1)
apps/api/plane/db/models/project.py (2)
Project(64-158)ProjectUserProperty(317-348)
apps/api/plane/app/serializers/issue.py (1)
apps/api/plane/db/models/project.py (1)
ProjectUserProperty(317-348)
apps/api/plane/db/models/__init__.py (1)
apps/api/plane/db/models/project.py (1)
ProjectUserProperty(317-348)
apps/api/plane/db/management/commands/create_project_member.py (1)
apps/api/plane/db/models/project.py (1)
ProjectUserProperty(317-348)
apps/api/plane/app/urls/issue.py (1)
apps/api/plane/app/views/issue/base.py (1)
IssueUserDisplayPropertyEndpoint(718-735)
apps/api/plane/api/views/project.py (2)
apps/api/plane/db/models/project.py (1)
ProjectUserProperty(317-348)apps/api/plane/app/views/project/base.py (3)
create(238-299)create(501-508)create(578-606)
apps/api/plane/db/migrations/0114_auto_20251201_0857.py (2)
apps/api/plane/db/models/project.py (2)
ProjectMember(191-235)ProjectUserProperty(317-348)apps/api/plane/db/migrations/0113_alter_issueuserproperty_table.py (1)
Migration(8-38)
apps/api/plane/app/views/issue/base.py (1)
apps/api/plane/db/models/project.py (1)
ProjectUserProperty(317-348)
apps/api/plane/tests/contract/app/test_project_app.py (1)
apps/api/plane/db/models/project.py (1)
ProjectUserProperty(317-348)
apps/api/plane/bgtasks/workspace_seed_task.py (1)
apps/api/plane/db/models/project.py (1)
ProjectUserProperty(317-348)
apps/api/plane/db/models/project.py (1)
apps/api/plane/db/models/issue.py (3)
get_default_filters(43-54)get_default_display_filters(57-66)get_default_display_properties(69-84)
apps/api/plane/app/views/project/base.py (2)
apps/api/plane/db/models/project.py (1)
ProjectUserProperty(317-348)apps/api/plane/app/views/project/member.py (1)
create(42-150)
apps/api/plane/app/views/project/invite.py (1)
apps/api/plane/db/models/project.py (1)
ProjectUserProperty(317-348)
apps/api/plane/db/migrations/0113_alter_issueuserproperty_table.py (2)
apps/api/plane/db/migrations/0114_auto_20251201_0857.py (1)
Migration(31-42)apps/api/plane/db/models/project.py (1)
get_default_preferences(60-61)
⏰ 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). (4)
- GitHub Check: Agent
- GitHub Check: Cursor Bugbot
- GitHub Check: Lint API
- GitHub Check: Analyze (javascript)
🔇 Additional comments (22)
apps/api/plane/app/urls/issue.py (1)
211-217:Comment rename correctly reflects underlying modelThe updated
## ProjectUserPropertycomments around theuser-properties/route align with the new model name and keep the URL behavior unchanged.apps/api/plane/db/models/__init__.py (1)
48-56:Public model surface correctly switched toProjectUserPropertyExporting
ProjectUserPropertyfrom.project(withIssueUserPropertyno longer present) correctly aligns the public API with the new model.apps/api/plane/app/serializers/issue.py (2)
16-41:Model import updated correctly toProjectUserPropertySwitching the import in
plane.db.modelsfrom the old property model toProjectUserPropertykeeps this serializer file aligned with the new model layout.
349-353:IssueUserPropertySerializernow bound toProjectUserPropertyPointing the serializer’s
Meta.modeltoProjectUserPropertymatches the refactor and stays compatible with existing views that use this serializer. Theread_only_fieldslist still matches the new model’s base fields, so no further changes seem necessary.apps/api/plane/app/views/project/base.py (1)
24-37:Project creation flow now correctly seedsProjectUserPropertyImporting and creating
ProjectUserPropertyfor the creator (and distinct project lead) keeps per-user project properties in sync with the new model and respects the unique (user, project) constraint. The conditional onproject_leadstill prevents duplicate records for the same user.Also applies to: 245-266
apps/api/plane/db/management/commands/create_project_member.py (1)
6-12:Management command now seedsProjectUserPropertyinstead ofIssueUserPropertyUpdating the import and using
ProjectUserProperty.objects.get_or_create(user=user, project=project)keeps this command aligned with the new model while preserving idempotent behavior.Also applies to: 69-71
apps/api/plane/tests/contract/app/test_project_app.py (1)
6-13:Tests correctly updated to assertProjectUserPropertycreationSwitching the import and expectations from
IssueUserPropertytoProjectUserPropertymatches the refactor: you now assert a property for the creator and two properties when a distinct project lead is set, which aligns with the updated create flow.Also applies to: 80-87, 116-121
apps/api/plane/bgtasks/workspace_seed_task.py (2)
23-23:LGTM!The import correctly references the renamed
ProjectUserPropertymodel.
121-160:LGTM!The bulk creation correctly uses
ProjectUserPropertyinstead ofIssueUserProperty. The new fieldspreferencesandsort_orderare not explicitly set, which is acceptable as they have sensible defaults defined in the model.apps/api/plane/app/views/issue/base.py (3)
54-54:LGTM!Import correctly updated to
ProjectUserProperty.
720-729:LGTM!The
patchmethod correctly usesProjectUserProperty.objects.get()and accesses fields that exist in the new model definition. Note that the serializer is still namedIssueUserPropertySerializer, which appears to be intentional as it's not part of this refactor's scope.
732-735:LGTM!The
getmethod correctly usesProjectUserProperty.objects.get_or_create()with appropriate fields matching the model's unique constraints.apps/api/plane/app/views/project/member.py (3)
16-16:LGTM!Import statement correctly includes
ProjectUserProperty.
121-127:LGTM!
ProjectUserPropertyinstantiation correctly sets the required fields. The new fieldspreferencesandsort_orderwill use their default values, consistent with the pattern used elsewhere in the codebase.
132-132:LGTM!
bulk_createcorrectly usesProjectUserPropertywith appropriate parameters includingignore_conflicts=Trueto handle the unique constraint on user and project.apps/api/plane/api/views/project.py (3)
21-21:LGTM!Import correctly updated to
ProjectUserProperty.
220-220:LGTM!
ProjectUserPropertycreation for the requesting user correctly setsproject_idanduser. The new fields will use their default values.
231-234:LGTM!
ProjectUserPropertycreation for the project lead is correctly implemented with appropriate conditional logic. Usinguser_idas a keyword argument is valid.apps/api/plane/db/migrations/0114_auto_20251201_0857.py (2)
5-28:LGTM!The data migration correctly copies
preferencesandsort_orderfromProjectMembertoProjectUserPropertyfor matching user-project pairs. The implementation is efficient using dictionary-based lookups and bulk updates with an appropriate batch size.
31-42:LGTM!The migration structure is correct with appropriate dependency on the previous migration and a no-op reverse operation, which is standard for data migrations.
apps/api/plane/app/views/project/invite.py (2)
27-27:LGTM!Import correctly updated to
ProjectUserProperty.
163-174:LGTM!The bulk creation of
ProjectUserPropertyis correctly implemented with appropriate fields andignore_conflicts=Trueto handle the unique constraint on user and project.
Uh oh!
There was an error while loading.Please reload this page.
sriramveeraghanta commentedDec 1, 2025
@pablohashescobar Update the |
Uh oh!
There was an error while loading.Please reload this page.
…date related fields and constraints
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 refactors theIssueUserProperty model toProjectUserProperty, reflecting its broader scope beyond issue-specific properties. The refactoring includes addingpreferences andsort_order fields migrated fromProjectMember, and also addsallowed_rate_limit to theAPIToken model.
Key changes:
- Renamed
IssueUserPropertytoProjectUserPropertyand moved fromissue.pytoproject.py - Added
preferencesandsort_orderfields toProjectUserProperty, populated via data migration fromProjectMember - Updated all references across views, serializers, tests, management commands, and background tasks
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| apps/api/plane/db/models/issue.py | RemovedIssueUserProperty model definition |
| apps/api/plane/db/models/project.py | AddedProjectUserProperty model with additional fields |
| apps/api/plane/db/models/init.py | Updated import fromIssueUserProperty toProjectUserProperty |
| apps/api/plane/db/models/api.py | Addedallowed_rate_limit field toAPIToken |
| apps/api/plane/db/migrations/0113_alter_issueuserproperty_table.py | Migration to rename model, alter table, and add new fields |
| apps/api/plane/db/migrations/0114_alter_projectuserproperty_options_and_more.py | Data migration fromProjectMember toProjectUserProperty |
| apps/api/plane/app/serializers/issue.py | UpdatedIssueUserPropertySerializer to useProjectUserProperty model |
| apps/api/plane/app/views/issue/base.py | Updated references to useProjectUserProperty |
| apps/api/plane/app/views/project/base.py | Updated project creation to useProjectUserProperty |
| apps/api/plane/app/views/project/member.py | Updated member addition to useProjectUserProperty |
| apps/api/plane/app/views/project/invite.py | Updated invite acceptance to useProjectUserProperty |
| apps/api/plane/api/views/project.py | Updated API project creation to useProjectUserProperty |
| apps/api/plane/bgtasks/workspace_seed_task.py | Updated seed task to useProjectUserProperty |
| apps/api/plane/db/management/commands/create_project_member.py | Updated management command to useProjectUserProperty |
| apps/api/plane/app/urls/issue.py | Updated comments to reflect rename |
| apps/api/plane/tests/contract/app/test_project_app.py | Updated tests to assertProjectUserProperty creation |
💡Add Copilot custom instructions for smarter, more guided reviews.Learn how to get started.
Uh oh!
There was an error while loading.Please reload this page.
…property-migrations
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: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
apps/api/plane/db/migrations/0113_alter_issueuserproperty_table.py(1 hunks)apps/api/plane/db/migrations/0114_alter_projectuserproperty_options_and_more.py(1 hunks)apps/api/plane/db/models/project.py(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- apps/api/plane/db/models/project.py
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: NarayanBavisettiRepo: makeplane/plane PR: 7460File: apps/api/plane/app/serializers/draft.py:112-122Timestamp: 2025-07-23T18:18:06.875ZLearning: 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 (2)
apps/api/plane/db/migrations/0114_alter_projectuserproperty_options_and_more.py (2)
apps/api/plane/db/models/project.py (2)
ProjectMember(191-235)ProjectUserProperty(317-348)apps/api/plane/db/migrations/0113_alter_issueuserproperty_table.py (1)
Migration(8-54)
apps/api/plane/db/migrations/0113_alter_issueuserproperty_table.py (2)
apps/api/plane/db/migrations/0114_alter_projectuserproperty_options_and_more.py (1)
Migration(31-39)apps/api/plane/db/models/project.py (1)
get_default_preferences(60-61)
⏰ 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). (3)
- GitHub Check: CodeQL analysis (python)
- GitHub Check: Agent
- GitHub Check: Cursor Bugbot
Uh oh!
There was an error while loading.Please reload this page.
apps/api/plane/db/migrations/0114_alter_projectuserproperty_options_and_more.pyShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
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.
This is the final PR Bugbot will review for you during this billing cycle
Your free Bugbot reviews will reset on December 20
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit theCursor dashboard to activate Pro and start your 14-day free trial.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
…ertyEndpoint to ProjectUserPropertySerializer and ProjectUserDisplayPropertyEndpoint, updating all related references
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
📒 Files selected for processing (5)
apps/api/plane/app/serializers/__init__.py(1 hunks)apps/api/plane/app/serializers/issue.py(2 hunks)apps/api/plane/app/urls/issue.py(2 hunks)apps/api/plane/app/views/__init__.py(1 hunks)apps/api/plane/app/views/issue/base.py(3 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- apps/api/plane/app/serializers/issue.py
- apps/api/plane/app/views/issue/base.py
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-07-23T18:18:06.875Z
Learnt from: NarayanBavisettiRepo: makeplane/plane PR: 7460File: apps/api/plane/app/serializers/draft.py:112-122Timestamp: 2025-07-23T18:18:06.875ZLearning: 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/app/serializers/__init__.py
🧬 Code graph analysis (3)
apps/api/plane/app/serializers/__init__.py (1)
apps/api/plane/app/serializers/issue.py (1)
ProjectUserPropertySerializer(349-353)
apps/api/plane/app/views/__init__.py (1)
apps/api/plane/app/views/issue/base.py (1)
ProjectUserDisplayPropertyEndpoint(718-735)
apps/api/plane/app/urls/issue.py (1)
apps/api/plane/app/views/issue/base.py (1)
ProjectUserDisplayPropertyEndpoint(718-735)
⏰ 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: Cursor Bugbot
🔇 Additional comments (2)
apps/api/plane/app/serializers/__init__.py (1)
55-55:LGTM!The serializer rename correctly reflects the model rename from
IssueUserPropertytoProjectUserProperty.apps/api/plane/app/views/__init__.py (1)
118-118:LGTM!The public export correctly reflects the endpoint rename from
IssueUserDisplayPropertyEndpointtoProjectUserDisplayPropertyEndpoint, maintaining consistency with the model rename.
Uh oh!
There was an error while loading.Please reload this page.
…perties by creating new entries and improve response handling
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/app/views/issue/base.py (1)
718-745:Endpoint now supports updating new fields; consider minor cleanupsThe renamed
ProjectUserDisplayPropertyEndpointnow usesProjectUserPropertySerializerwithpartial=True, sopreferencesandsort_order(and other writable fields) can be updated via PATCH, which addresses the earlier review concern. You could optionally:
- Replace the explicit try/except +
createinpatchwith a singleget_or_createcall (to mirrorgetand reduce duplication).- Rename
issue_propertytoproject_user_propertyoruser_propertyfor clarity post‑refactor.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/api/plane/app/views/issue/base.py(3 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-07-23T18:18:06.875Z
Learnt from: NarayanBavisettiRepo: makeplane/plane PR: 7460File: apps/api/plane/app/serializers/draft.py:112-122Timestamp: 2025-07-23T18:18:06.875ZLearning: 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/app/views/issue/base.py
🧬 Code graph analysis (1)
apps/api/plane/app/views/issue/base.py (2)
apps/api/plane/app/serializers/issue.py (3)
ProjectUserPropertySerializer(349-353)create(194-269)create(580-583)apps/api/plane/db/models/project.py (1)
ProjectUserProperty(317-348)
⏰ 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: Cursor Bugbot
- GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
apps/api/plane/app/views/issue/base.py (1)
37-38:Imports correctly updated to ProjectUserProperty model/serializerThe imports for
ProjectUserPropertySerializerandProjectUserPropertyare consistent with the refactor and are used appropriately in this module; no issues from this change set.Also applies to: 54-59
Uh oh!
There was an error while loading.Please reload this page.
…emove workspace association
apps/api/plane/db/migrations/0114_alter_projectuserproperty_options_and_more.pyShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
…y excluding bot users from workspace removal
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
♻️ Duplicate comments (1)
apps/api/plane/db/migrations/0114_alter_projectuserproperty_options_and_more.py (1)
20-25:Add None checks before copying ProjectMember fields.The concern raised in previous review remains unresolved: older ProjectMember records may have
Noneforpreferencesandsort_order(migration 0110 did not backfill), which would overwrite the defaults already set in migration 0113. Add conditional checks to preserve existing defaults when source fields are None.
🧹 Nitpick comments (1)
apps/api/plane/db/migrations/0114_alter_projectuserproperty_options_and_more.py (1)
31-39:Cursor bot comment is a false positive; the migration logic is correct.The previous concern about
user__is_bot=Falsein anupdate()call is incorrect. Line 35 usesuser__is_bot=Falsein the.filter()clause (which supports related lookups), while line 36 only updatesworkspace_id(a direct field onAPIToken). This is valid Django ORM usage.The migration correctly clears workspace associations for non-service, non-bot tokens as intended.
Minor formatting note: Line 37 has an unnecessary blank line, and line 39 has an unnecessary return statement, but these are purely stylistic.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/api/plane/db/migrations/0114_alter_projectuserproperty_options_and_more.py(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
apps/api/plane/db/migrations/0114_alter_projectuserproperty_options_and_more.py (3)
apps/api/plane/db/models/project.py (1)
ProjectUserProperty(317-348)apps/api/plane/db/models/api.py (1)
APIToken(19-44)apps/api/plane/db/migrations/0113_alter_issueuserproperty_table.py (1)
Migration(8-55)
⏰ 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: Cursor Bugbot
Uh oh!
There was an error while loading.Please reload this page.
Description
IssueUserPropertytoProjectUserPropertysort_orderandpreferencestoProjectUserPropertyProjectMemberstoProjectUserPropertyIssueUserPropertytoProjectUserPropertyallowed_rate_limittoAPITokensType of Change
Test Scenarios
References
WEB-5537
Note
Renames
IssueUserPropertytoProjectUserPropertyacross code, addspreferencesandsort_orderwith migrations and endpoint updates, and introducesallowed_rate_limitonAPIToken.IssueUserProperty→ProjectUserProperty; move/define model indb/models/project.pywith new fields:preferences,sort_orderand updated constraints/related names.0113,0114handle table rename, new fields, backfill fromProjectMember.preferences/sort_order, and adjust uniqueness; setworkspace_id=Nonefor non-service API tokens.allowed_rate_limittoAPITokenmodel.IssueUserDisplayPropertyEndpointwithProjectUserDisplayPropertyEndpoint; PATCH now upserts viaProjectUserPropertySerializerand returns 200.ProjectUserPropertyrecords; seed task bulk-creates them..../user-properties/endpoint and all imports/serializers toProjectUserPropertySerializer.ProjectUserPropertycreation.Written byCursor Bugbot for commitab9a6b4. This will update automatically on new commits. Configurehere.
Summary by CodeRabbit
New Features
Bug Fixes
Tests
✏️ Tip: You can customize this high-level summary in your review settings.