Community Health: monthly community health report system - #4336
Community Health: monthly community health report system#4336functionzz wants to merge 14 commits into
Conversation
Codecov Report❌ Patch coverage is 🚀 New features to boost your workflow:
|
96979a9 to
e6cf8c9
Compare
mathjazz
left a comment
There was a problem hiding this comment.
Nice work!
Some high-level questions:
- Why is the /insights page shown to and the notification sent to
is_staffusers , but the emails can be opted in byis_superuserusers? - Why don't we automatically opt in all
is_staffusers also for receiving emails and drop the settings? This is an altert system afterall. Or at least opt them in by default, if we really want to keep the ability to opt out. - Have we tested the notification in the translate view, which has its own notification implementation?
- The docstring says rows are "ranked by the size of that change", but the biggest gains come first and the worst regressions land at the bottom of the table. In an alert system, the regressions are the actionable half. Sort by
abs(percentage)to match the docstring? - The new command needs to be documented on
documentation/docs/dev/deployment.md. We should mention it silently depends on cron ordering - it reads the current month's snapshot — whichcollect_chs_snapshotscreates on that same day. - We should also document the reporting feature for the Admins. Note that there's still #4338 (comment).
|
|
||
| {% if description and (description.startswith("Unreviewed suggestions") or notification.verb == "has reviewed suggestions" or notification.verb == "ignore") %} | ||
| <span class="description">{{ description|safe }}</span> | ||
| <div class="description">{{ description|safe }}</div> |
There was a problem hiding this comment.
What's the purpose of this change?
There was a problem hiding this comment.
If we keep it as a span, if the description contains html elements, they will all be converted to text, which is not what we want.
There was a problem hiding this comment.
The main point is now we have a system notification that automatically sends but also contains more complex html + css, which was not supported with the current code. All our previous system notifications were just one-liner spans.
There was a problem hiding this comment.
What's the purpose of these changes?
There was a problem hiding this comment.
Because I changed description to a div, I also want it to inherit css styling as well.
| assert mail.outbox[0].to == [user_a.contact_email] | ||
|
|
||
|
|
||
| @pytest.mark.django_db |
There was a problem hiding this comment.
We should also add a test for the case when none of the locales passes a threshold.
I don't think all superusers are PMs interested in this information, so they should have a way to opt out. I have the feeling the majority falls into this category, hence the opt-in suggestion to Jamie. |
I actually think it should be only reserved to is_staff users - I made the change before you reviewed, but it seems I didn't completely change options. I need to change both user pool to be from is_staff.
Just like the other email systems in Pontoon, I think we should keep the option to opt in given both the notification & email output very similar things.
Not yet, will do that now.
Sure.
Sure, I'll make the changes in this PR. |
5b5bde8 to
b9a755c
Compare
This PR creates a community health alert system for PMs, and allows PMs see month-over-month changes to CHS at a glance. It is compiled monthly.
Fixes #4329.