[ENG-11524][ENG-11709] Project ENTER - #11803
Merged
Merged
Conversation
* Add blank notification type and template * Respond to CR --------- Co-authored-by: Longze Chen <cslzchen@gmail.com>
…TER - Part 1 (#11805) * Implement notification campaign models and email handling - Add NotificationCampaign and NotificationCampaignRecipient models. - Introduce notification campaign status management. - Update OSFUser model to track received notification campaigns. - Enhance email templates for notification campaigns. - Create migration for new models and relationships. * Remove notification settings table from blank email template * Code clean-up and fixes --------- Co-authored-by: Longze Chen <cslzchen@gmail.com>
…min Page (#11808) * Add Notification Campaign management features including forms, views, and templates * Add support for restarting failed notification campaigns and update progress metrics * Prevent updating recipient count on campaign restart
…logging (#11814) * Add developer reminder status and update notification campaign recipient status choices * Handle campaign failure status and log execution time window in send_campaign_batch * Add Sentry logging for campaign retries and execution time window * Improve campaign logging --------- Co-authored-by: Longze Chen <cslzchen@gmail.com>
…nd spam status (#11815) * sort recipients by activity priority * simplify filter; send campaign email tasks in 3 phases * add global values to defaults and admin campaign metadata fields
* Add recipients list and preview views for notification campaigns
…nts; rework campaign workflow (#11825) * Refactor notification campaign logic: create recipients in batches, add run_id to models, and improve filtering by activity score * Update notification campaign logic * Update sendgrid bulk * Handle email sending errors in send_campaign_batch: log exceptions and update recipient statuses * Improve error logging --------- Co-authored-by: antkryt <ant.krytskyi@gmail.com>
* unit tests on ordering and filtering * fix recipients ordering
* Add sendgrid_bulk field to NotificationCampaignCreateForm and handle errors in context and filters; update notification campaign views and templates for improved messaging and recipient handling * Add sendgrid_bulk field to NotificationCampaignCreateForm and update notification campaign processing logic * Fix campaign recipient query to filter only by FAILED status when restarting failed campaigns * Refactor notification campaign recipient status handling and improve message display in templates
* Add functionality to restart stuck notification campaigns * Add support for restarting stuck notification campaigns
…enter Fixed conflicts for imports in osf/models/user.py
* Add unit tests for notification campaign flow and admin (part 1)
…#11836) * Add time window field to NotificationCampaignCreateForm and update templates for campaign details and recipients * Add cancel functionality to NotificationCampaign and update UI for campaign management * Refactor process_campaign_retry to handle cancelled campaigns and improve retry logic * Add run_id check to process_campaign_retry to prevent incorrect retries * Fix unit tests
* Update notification campaign permissions in views and tests * fix test_start_rejects_when_another_campaign_is_running
* Update notification campaign flow and admin unit tests
…rt 2 (#11840) * Update command to create more users with different status and options
…ers to use a dynamic query builder + Bug fixes (#11842) * Refactor notification campaign filters to use a dynamic query builder and streamline filter handling in the UI * Refactor campaign recipient filters to use Q objects and dynamic query building * Enhance notification campaign creation UI with improved group structure and styling * Remove copy * Refactor initial state handling in filter mode to improve readability * Add manual filter validation and improve filter display in notification campaigns
* Change notification campaign time window to be in seconds
…11848) * Additional user lookups for notification campaign
…mpaign and batches (#11850) * Add and normalize logs and sentry messages for campaign and batches * Fix type in logs * Add time check and logging for each notification emit in batch
* Sort campaigns list by created time
* Keep developer reminder even if campaign is finished
* Enforce manual filters values cannot be none or empty
…velop-and-redo-migration
…o-migration [ENG-11904][ENG-11910] Merge `develop` + redo migration + DevQA Fixes
cslzchen
marked this pull request as ready for review
August 5, 2026 13:06
…y tasks (#11857) * Add separate queue for notification campaign tasks
cslzchen
commented
Aug 5, 2026
Comment on lines
+201
to
+202
| ESTIMATED_BATCH_RUN_TIME_THRESHOLD = DEFAULT_CAMPAIGN_WINDOW_TIME / (ESTIMATED_EIGHT_HOUR_WINDOW_USERS / DEFAULT_CAMPAIGN_BATCH_SIZE) # By default, 48 seconds per batch of 1000 requests | ||
| ESTIMATED_PER_REQUEST_THRESHOLD = ESTIMATED_BATCH_RUN_TIME_THRESHOLD / DEFAULT_CAMPAIGN_BATCH_SIZE # By default, 0.048 seconds (21 requests / second) |
Collaborator
Author
There was a problem hiding this comment.
This threshold are estimates if we only had one worker working on one batch at the same time and we set them very high so that we can sentry log batch and request timing.
On production, after we verified the SendGrid request speed on production, we can override/loose both so we don't flood production sentry with 2M errors.
ESTIMATED_BATCH_RUN_TIME_THRESHOLD = 180 # 3 min, could lower to 2 min if production SendGrid is faster
ESTIMATED_PER_REQUEST_THRESHOLD = 0.2 # 200ms, could lower to 0.15 if production SendGrid is faster
cslzchen
commented
Aug 5, 2026
brianjgeiger
approved these changes
Aug 5, 2026
cslzchen
commented
Aug 5, 2026
Co-authored-by: Longze Chen <cslzchen@gmail.com>
cslzchen
force-pushed
the
feature/project-enter
branch
from
August 5, 2026 19:28
ac3d839 to
d52032c
Compare
cslzchen
commented
Aug 5, 2026
cslzchen
left a comment
Collaborator
Author
There was a problem hiding this comment.
Additional DevQA passed on the latest feature branch deployment, merging now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket
https://openscience.atlassian.net/browse/ENG-11709
https://openscience.atlassian.net/browse/ENG-11524
Purpose
Project Enter: see project requirements & documents
Changes
See child PRs
QA Notes
See QA testing plan
CE Notes
See release playbook
Documentation
N/A