Chore: replace relation choices with TextChoices in IssueRelation model#7295
Chore: replace relation choices with TextChoices in IssueRelation model#7295sriramveeraghanta merged 1 commit intopreviewfrom
Conversation
WalkthroughThe update refactors the way issue relation types are defined in the Django model by introducing a Changes
Poem
✨ 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 (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
apiserver/plane/db/models/issue.py (1)
274-279: Enum introduction looks good, but consider naming & i18n upfrontGreat move adopting
TextChoices; it improves type-safety and discoverability. A couple of minor points for future-proofing:
IssueRelationType(or simplyRelationType) would read clearer thanIssueRelationChoices, because the class represents the domain type whereas.choicesis just Django plumbing.- If you ever localise UI labels, wrap the second tuple element with
gettext_lazynow to avoid a noisy migration later.Both are non-blocking; flagging as optional polish.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apiserver/plane/db/models/issue.py(2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
apiserver/plane/db/models/issue.py (1)
apiserver/plane/db/models/project.py (1)
ProjectBaseModel(172-185)
🪛 Pylint (3.3.7)
apiserver/plane/db/models/issue.py
[refactor] 274-274: Too few public methods (0/2)
(R0903)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Analyze (javascript)
🔇 Additional comments (2)
apiserver/plane/db/models/issue.py (2)
274-279: Static-analysis “too few public methods” warning is safe to ignore
TextChoicessubclasses intentionally hold constants only; the pylint R0903 hit is a known false positive for this pattern.
289-294: No downstream changes required after default updateThe
default=IssueRelationChoices.BLOCKED_BYremains the same string value ("blocked_by"), so existing rows and any literal string comparisons continue to work without modification. No code or test updates are needed—this is purely a readability improvement if you later choose to reference the enum instead of the literal.
Description
Type of Change
Screenshots and Media (if applicable)
Test Scenarios
References
Summary by CodeRabbit