If we just want to display comments from developers differently, we could do it with one extra query:
1. After assembling all the bug comments, we have a set of all the message authors.
2. For each bug task, get the context and grab the person IDs that would cover developers (owners and drivers would cover it, I think).
3. Query the TeamParticipation table for rows where person is in the list of people from (1) and team is in the list of people from (2).
4. Take the set of TeamParticipation.person values from the above query. If the author of a comment is in this set, then it can be marked as coming from a developer.
Using raw SQL, this could probably be included in the main query used to get all the bug comments, but that is probably a bit difficult to do with our ORM. However, the extra query shouldn't add much overhead.
If we just want to display comments from developers differently, we could do it with one extra query:
1. After assembling all the bug comments, we have a set of all the message authors. on.person values from the above query. If the author of a comment is in this set, then it can be marked as coming from a developer.
2. For each bug task, get the context and grab the person IDs that would cover developers (owners and drivers would cover it, I think).
3. Query the TeamParticipation table for rows where person is in the list of people from (1) and team is in the list of people from (2).
4. Take the set of TeamParticipati
Using raw SQL, this could probably be included in the main query used to get all the bug comments, but that is probably a bit difficult to do with our ORM. However, the extra query shouldn't add much overhead.