-
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-2691] chore: filtered the deleted labels and modules #5860
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -141,7 +141,10 @@ def get_queryset(self): | |||||||||
ArrayAgg( | ||||||||||
"labels__id", | ||||||||||
distinct=True, | ||||||||||
filter=~Q(labels__id__isnull=True), | ||||||||||
filter=( | ||||||||||
~Q(labels__id__isnull=True) | ||||||||||
& Q(labels__deleted_at__isnull=True) | ||||||||||
), | ||||||||||
), | ||||||||||
Value([], output_field=ArrayField(UUIDField())), | ||||||||||
), | ||||||||||
|
@@ -159,7 +162,8 @@ def get_queryset(self): | |||||||||
"issue_module__module_id", | ||||||||||
distinct=True, | ||||||||||
filter=~Q(issue_module__module_id__isnull=True) | ||||||||||
& Q(issue_module__module__archived_at__isnull=True), | ||||||||||
& Q(issue_module__module__archived_at__isnull=True) | ||||||||||
& Q(issue_module__module__deleted_at__isnull=True), | ||||||||||
), | ||||||||||
Value([], output_field=ArrayField(UUIDField())), | ||||||||||
), | ||||||||||
|
@@ -186,7 +190,8 @@ def list(self, request, slug, project_id): | |||||||||
ArrayAgg( | ||||||||||
"issue__labels__id", | ||||||||||
distinct=True, | ||||||||||
filter=~Q(issue__labels__id__isnull=True), | ||||||||||
filter=~Q(issue__labels__id__isnull=True) | ||||||||||
& Q(issue__labels__deleted_at__isnull=True), | ||||||||||
), | ||||||||||
Value([], output_field=ArrayField(UUIDField())), | ||||||||||
) | ||||||||||
|
@@ -298,15 +303,19 @@ def create(self, request, slug, project_id): | |||||||||
ArrayAgg( | ||||||||||
"issue__labels__id", | ||||||||||
distinct=True, | ||||||||||
filter=~Q(issue__labels__id__isnull=True), | ||||||||||
filter=( | ||||||||||
~Q(labels__id__isnull=True) | ||||||||||
& Q(labels__deleted_at__isnull=True) | ||||||||||
), | ||||||||||
), | ||||||||||
Value([], output_field=ArrayField(UUIDField())), | ||||||||||
), | ||||||||||
assignee_ids=Coalesce( | ||||||||||
ArrayAgg( | ||||||||||
"issue__assignees__id", | ||||||||||
distinct=True, | ||||||||||
filter=~Q(issue__assignees__id__isnull=True), | ||||||||||
filter=~Q(assignees__id__isnull=True) | ||||||||||
& Q(assignees__member_project__is_active=True), | ||||||||||
Comment on lines
+317
to
+318
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensure consistent field references in 'assignee_ids' aggregation filter Similar to the previous comment, the filter for Apply this diff to update the filter field references: - filter=~Q(assignees__id__isnull=True)
- & Q(assignees__member_project__is_active=True),
+ filter=~Q(issue__assignees__id__isnull=True)
+ & Q(issue__assignees__member_project__is_active=True), 📝 Committable suggestion
Suggested change
|
||||||||||
), | ||||||||||
Value([], output_field=ArrayField(UUIDField())), | ||||||||||
), | ||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -471,7 +471,10 @@ def retrieve(self, request, slug, project_id, pk=None): | |||||||||||||||||||
ArrayAgg( | ||||||||||||||||||||
"labels__id", | ||||||||||||||||||||
distinct=True, | ||||||||||||||||||||
filter=~Q(labels__id__isnull=True), | ||||||||||||||||||||
filter=( | ||||||||||||||||||||
~Q(labels__id__isnull=True) | ||||||||||||||||||||
& Q(labels__deleted_at__isnull=True) | ||||||||||||||||||||
), | ||||||||||||||||||||
Comment on lines
+474
to
+477
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Archived labels are not excluded in the filter. In the aggregation of Apply this diff to update the filter condition: filter=(
~Q(labels__id__isnull=True)
& Q(labels__deleted_at__isnull=True)
+ & Q(labels__archived_at__isnull=True)
), 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||
), | ||||||||||||||||||||
Value([], output_field=ArrayField(UUIDField())), | ||||||||||||||||||||
), | ||||||||||||||||||||
|
@@ -489,7 +492,8 @@ def retrieve(self, request, slug, project_id, pk=None): | |||||||||||||||||||
"issue_module__module_id", | ||||||||||||||||||||
distinct=True, | ||||||||||||||||||||
filter=~Q(issue_module__module_id__isnull=True) | ||||||||||||||||||||
& Q(issue_module__module__archived_at__isnull=True), | ||||||||||||||||||||
& Q(issue_module__module__archived_at__isnull=True) | ||||||||||||||||||||
& Q(issue_module__module__deleted_at__isnull=True), | ||||||||||||||||||||
), | ||||||||||||||||||||
Value([], output_field=ArrayField(UUIDField())), | ||||||||||||||||||||
), | ||||||||||||||||||||
|
@@ -568,7 +572,10 @@ def partial_update(self, request, slug, project_id, pk=None): | |||||||||||||||||||
ArrayAgg( | ||||||||||||||||||||
"labels__id", | ||||||||||||||||||||
distinct=True, | ||||||||||||||||||||
filter=~Q(labels__id__isnull=True), | ||||||||||||||||||||
filter=( | ||||||||||||||||||||
~Q(labels__id__isnull=True) | ||||||||||||||||||||
& Q(labels__deleted_at__isnull=True) | ||||||||||||||||||||
), | ||||||||||||||||||||
Comment on lines
+575
to
+578
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Archived labels are not excluded in the filter. Similar to the previous occurrence, the filter for Apply this diff: filter=(
~Q(labels__id__isnull=True)
& Q(labels__deleted_at__isnull=True)
+ & Q(labels__archived_at__isnull=True)
), 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||
), | ||||||||||||||||||||
Value([], output_field=ArrayField(UUIDField())), | ||||||||||||||||||||
), | ||||||||||||||||||||
|
@@ -585,7 +592,9 @@ def partial_update(self, request, slug, project_id, pk=None): | |||||||||||||||||||
ArrayAgg( | ||||||||||||||||||||
"issue_module__module_id", | ||||||||||||||||||||
distinct=True, | ||||||||||||||||||||
filter=~Q(issue_module__module_id__isnull=True), | ||||||||||||||||||||
filter=~Q(issue_module__module_id__isnull=True) | ||||||||||||||||||||
& Q(issue_module__module__archived_at__isnull=True) | ||||||||||||||||||||
& Q(issue_module__module__deleted_at__isnull=True), | ||||||||||||||||||||
), | ||||||||||||||||||||
Value([], output_field=ArrayField(UUIDField())), | ||||||||||||||||||||
), | ||||||||||||||||||||
|
@@ -855,7 +864,10 @@ def list(self, request, slug, project_id): | |||||||||||||||||||
ArrayAgg( | ||||||||||||||||||||
"labels__id", | ||||||||||||||||||||
distinct=True, | ||||||||||||||||||||
filter=~Q(labels__id__isnull=True), | ||||||||||||||||||||
filter=( | ||||||||||||||||||||
~Q(labels__id__isnull=True) | ||||||||||||||||||||
& Q(labels__deleted_at__isnull=True) | ||||||||||||||||||||
), | ||||||||||||||||||||
Comment on lines
+867
to
+870
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Archived labels are not excluded in the filter. In the aggregation of Apply this diff: filter=(
~Q(labels__id__isnull=True)
& Q(labels__deleted_at__isnull=True)
+ & Q(labels__archived_at__isnull=True)
), 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||
), | ||||||||||||||||||||
Value([], output_field=ArrayField(UUIDField())), | ||||||||||||||||||||
), | ||||||||||||||||||||
|
@@ -873,7 +885,8 @@ def list(self, request, slug, project_id): | |||||||||||||||||||
"issue_module__module_id", | ||||||||||||||||||||
distinct=True, | ||||||||||||||||||||
filter=~Q(issue_module__module_id__isnull=True) | ||||||||||||||||||||
& Q(issue_module__module__archived_at__isnull=True), | ||||||||||||||||||||
& Q(issue_module__module__archived_at__isnull=True) | ||||||||||||||||||||
& Q(issue_module__module__deleted_at__isnull=True), | ||||||||||||||||||||
), | ||||||||||||||||||||
Value([], output_field=ArrayField(UUIDField())), | ||||||||||||||||||||
), | ||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -234,7 +234,10 @@ def get_queryset(self): | |||||||||||||||||||
ArrayAgg( | ||||||||||||||||||||
"labels__id", | ||||||||||||||||||||
distinct=True, | ||||||||||||||||||||
filter=~Q(labels__id__isnull=True), | ||||||||||||||||||||
filter=( | ||||||||||||||||||||
~Q(labels__id__isnull=True) | ||||||||||||||||||||
& Q(labels__deleted_at__isnull=True) | ||||||||||||||||||||
), | ||||||||||||||||||||
Comment on lines
+237
to
+240
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Suggestion: Also filter out archived labels in Currently, the Apply this change to include the archived filter: filter=(
~Q(labels__id__isnull=True)
& Q(labels__deleted_at__isnull=True)
+ & Q(labels__archived_at__isnull=True)
), 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||
), | ||||||||||||||||||||
Value([], output_field=ArrayField(UUIDField())), | ||||||||||||||||||||
), | ||||||||||||||||||||
|
@@ -252,7 +255,8 @@ def get_queryset(self): | |||||||||||||||||||
"issue_module__module_id", | ||||||||||||||||||||
distinct=True, | ||||||||||||||||||||
filter=~Q(issue_module__module_id__isnull=True) | ||||||||||||||||||||
& Q(issue_module__module__archived_at__isnull=True), | ||||||||||||||||||||
& Q(issue_module__module__archived_at__isnull=True) | ||||||||||||||||||||
& Q(issue_module__module__deleted_at__isnull=True), | ||||||||||||||||||||
), | ||||||||||||||||||||
Value([], output_field=ArrayField(UUIDField())), | ||||||||||||||||||||
), | ||||||||||||||||||||
|
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.
Inconsistent field references in 'label_ids' aggregation filter
There is a potential issue in the
label_ids
aggregation filter: the fields in the filter should match the annotated fields. Currently, the filter useslabels__id
andlabels__deleted_at
, but the aggregation is overissue__labels__id
. This mismatch may lead to incorrect filtering.Apply this diff to correct the filter field references:
📝 Committable suggestion