feat(workflow): Adding project slugs to Rule and AlertRule serializer#20075
feat(workflow): Adding project slugs to Rule and AlertRule serializer#20075iProgramStuff wants to merge 3 commits intomasterfrom
Conversation
| for alert_rule_id, project_slug in AlertRuleExcludedProjects.objects.filter( | ||
| alert_rule__in=item_list | ||
| ).values_list("alert_rule_id", "project__slug"): | ||
| exclusions = result[alert_rules[alert_rule_id]].setdefault("excludedProjects", []) | ||
| exclusions.append(project_slug) |
There was a problem hiding this comment.
Do we need the excluded projects here? I'd leave them in the detailed serializer otherwise.
There was a problem hiding this comment.
Hmm, doesn't it seem appropriate? We could use the info to know which projects to display in the list (probably more useful once we have multi project alerts?).
Could put it back into the detailed serializer, but bringing it in here also makes the details serializer redundant (I was able to remove it)
There was a problem hiding this comment.
We have a general problem where we start putting more and more things into a serializer, and at some point our endpoints end up slow due to extra serialization + db queries. Unless we actually need this data now I'd say it should remain in the detailed serializer.
There was a problem hiding this comment.
Gotcha. Will put it back into the detailed serializer until we have an explicit need.
Adding project slugs to the api response so the frontend can display them in the rule listing.