-
Notifications
You must be signed in to change notification settings - Fork 64
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
Add the ability to emit platform wide notifications #4637
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4637 +/- ##
==========================================
+ Coverage 78.74% 78.78% +0.03%
==========================================
Files 311 311
Lines 14669 14748 +79
Branches 3354 3372 +18
==========================================
+ Hits 11551 11619 +68
- Misses 3118 3129 +11
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
The only task left is inserting data into the notifications table. I’ve added a basic implementation that loops through and inserts notifications into the database based on the roles query. However, this approach could become problematic if there are many users or results, as it might cause a table lock on the notifications table and lead to other issues. Should we stick with this for now? |
I had a quick look at this part this morning. Had a couple thoughts, but need to poke at it a bit more once other unrelated tasks are complete. Will review tomorrow. |
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.
Going to ship as-is. There are improvements to be made on the scaling of adding notifications to large proportions of users in the database; but for the low-scale usage of the feature we can ship now and improve later.
Decided to hold back; want to validate the scaling issue first. Also, want to add the ability to target team tier as well as role. Will pick up and complete in next few days. |
@knolleary let me know once this is ready please, as want to send out a notification for the 2.10 Release. |
Have pushed a small refactoring:
As I write this comment, realise I haven't dbl checked the UI tests for the api change I made... will see how that goes before marking this good to merge. |
Should we get another set of eyes on the back-end changes? I'm not sure I can/should approve the changes |
@cstns I'll give it a fresh look over in the morning, but then we can move forward. |
Not working on postgres due to implicit casting between boolean/integer types in the query. Need to fix and add some tests. |
Postgres fixed. Also, for the mock call, changed to use Finally, added some unit tests for the api side. |
Should I merge the PR after I give it another quick check? |
Description
Added an admin API that can send platform wide notifications to users that fall into the provided roles.
Added a User model query that retrieves users based on provided roles.
Related Issue(s)
closes #4554
Checklist
flowforge.yml
?FlowFuse/helm
to update ConfigMap TemplateFlowFuse/CloudProject
to update values for Staging/ProductionLabels
area:migration
label