-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[WEB-2935] fix: search issues endpoint #6291
Conversation
WalkthroughThe pull request introduces modifications to the issue relation handling in two files: Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Tip CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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.
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)
apiserver/plane/app/views/search/issue.py (1)
54-54
: Line length exceeds style guideline.
To adhere to style guidelines (88 chars limit), shorten this line.- related_issue_ids = [item for sublist in related_issue_ids for item in sublist] +related_issue_ids = [ + item + for sublist in related_issue_ids + for item in sublist +]🧰 Tools
🪛 Ruff (0.8.2)
54-54: Line too long (91 > 88)
(E501)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
apiserver/plane/app/views/issue/relation.py
(1 hunks)apiserver/plane/app/views/search/issue.py
(2 hunks)
🧰 Additional context used
🪛 Ruff (0.8.2)
apiserver/plane/app/views/search/issue.py
54-54: Line too long (91 > 88)
(E501)
🔇 Additional comments (6)
apiserver/plane/app/views/search/issue.py (3)
10-10
: Importing IssueRelation
is appropriate.
Thanks for adding IssueRelation
to better handle issue relationships within search functionality.
48-55
: Filter logic to retrieve related issue IDs is correct.
This snippet correctly ensures that both directions of the relationship (Q(issue=issue)
or Q(related_issue=issue)
) are considered. Flattening the tuples with a list comprehension is also a neat approach.
🧰 Tools
🪛 Ruff (0.8.2)
54-54: Line too long (91 > 88)
(E501)
59-59
: Good approach to exclude already-related issues.
This condition avoids re-introducing an existing relationship, aligning with the PR’s objective to allow re-adding issues once relationships are removed.
apiserver/plane/app/views/issue/relation.py (3)
273-280
: Query logic is straightforward, but confirm the need to delete one or multiple matches.
After filtering for matching issue relations, consider whether you want to remove all found relations or just the first.
Please confirm:
- If only the first matching relation should be deleted, this is correct.
- Otherwise, remove
.first()
and call.delete()
on the entire queryset.
282-282
: Serializing the existing relation prior to deletion is a good practice.
Storing the JSON-encoded representation of the relation ensures an audit trail for potential rollbacks or analyses later.
284-284
: Deleting the relation aligns with simplified logic.
You’ve removed type-based handling, opting for a single, unified approach. Ensure that the usage of .first()
above still meets your functional requirements.
Description
This pull request resolves the issue with searching for relations. Once a relation is removed, the user can add the same issue again.
Type of Change
Summary by CodeRabbit
Bug Fixes
Refactor