Skip to content

[ENG-8064] Add New Notifications Data Model (Refactor Notifications Phase 2) #11151

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

Open
wants to merge 124 commits into
base: refactor-notifications
Choose a base branch
from

Conversation

Johnetordoff
Copy link
Contributor

@Johnetordoff Johnetordoff commented May 20, 2025

Purpose

This is Phase 2 of the Notifications Refactor it creates a new notification system and migrates the existing data into that model.

Changes

  • A slight change to handle_boa_error to pass the already decanted user object.
  • adds new data model for Notification, NotificationTypes and Subscriptions
  • creates a notifications.yaml for data dependency notificationtypes
  • add migrations
  • updates notifications to use NotificationTypes
  • updates Admin app to control email templates
  • updates metrics reporter to count notifications sent etc.
  • updates tests to all use capture_notifications mocking util
  • Removes queued_mail
  • Removes EmailDigest
  • Removes detect_duplicates for duplicate subscriptions

QA Notes

Please make verification statements inspired by your code and what your code touches.

  • Verify
  • Verify

What are the areas of risk?

Any concerns/considerations/questions that development raised?

Documentation

Side Effects

Ticket

https://openscience.atlassian.net/browse/ENG-8064

@Johnetordoff Johnetordoff force-pushed the add-new-notifications-data-model branch 3 times, most recently from ecc8e88 to 3a8b414 Compare May 21, 2025 14:28
@Johnetordoff Johnetordoff force-pushed the add-new-notifications-data-model branch from 3a8b414 to 57b0bd1 Compare May 21, 2025 14:42
…cience/osf.io into add-new-notifications-data-model

* 'feature/pbs-25-10' of https://github.com/CenterForOpenScience/osf.io:
  fix issue where not having any external identities caused a 500
…cience/osf.io into add-new-notifications-data-model

* 'feature/pbs-25-10' of https://github.com/CenterForOpenScience/osf.io:
  fix issue where trying another already confirmed email threw an uncaught exception (CenterForOpenScience#11161)
  [ENG-8148] Add ArtifactOutcome in annotations to linked nodes  (CenterForOpenScience#11158)
…OpenScience/osf.io into add-new-notifications-data-model

* 'refactor-notifications' of https://github.com/CenterForOpenScience/osf.io:
  flake8
  fixed tests
  remove quickfiles
  update mails mock
  Update send_mail mocks
  Clean up tests
  Clean up tests
  Clean up imports
  Remove Meetings, Comments and OSF Groups Notifications
  remove osf groups
  remove osf groups
  remove osf groups
  remove osf groups
  remove osf groups

# Conflicts:
#	tests/test_notifications.py
…OpenScience/osf.io into add-new-notifications-data-model

* 'refactor-notifications' of https://github.com/CenterForOpenScience/osf.io:
  ignore Django maintenance state outside block
@Johnetordoff Johnetordoff force-pushed the add-new-notifications-data-model branch from 2b8ba0d to c449599 Compare June 9, 2025 13:40
…OpenScience/osf.io into add-new-notifications-data-model

* 'refactor-notifications' of https://github.com/CenterForOpenScience/osf.io:
  fixed bug with contributors
  remove superfluildous `groups` from serializer
  fix new and noteworth nodes bug going to Sentry
@Johnetordoff Johnetordoff changed the base branch from feature/pbs-25-10 to refactor-notifications June 13, 2025 14:40
…cience/osf.io into add-new-notifications-data-model

* 'feature/pbs-25-10' of https://github.com/CenterForOpenScience/osf.io:
  fixed None issue when iterate (CenterForOpenScience#11192)
  [ENG-8048] Remove caching to avoid incorrect results for ascendants (CenterForOpenScience#11169)
  [ENG-7870] Crossref DOIs not minting with _v1, OSF is displaying DOI versions with _v1 (CenterForOpenScience#11154)
  Update changelog and package.json
  [ENG-8145] [ENG-8147] Manual DOI and GUID for Preprints & Registrations - BE (CenterForOpenScience#11174)
…cience/osf.io into add-new-notifications-data-model

* 'feature/pbs-25-10' of https://github.com/CenterForOpenScience/osf.io:
  Revert "[ENG-8048] Remove caching to avoid incorrect results for ascendants (…"
  Revert "fixed None issue when iterate (CenterForOpenScience#11192)"
@Johnetordoff Johnetordoff force-pushed the add-new-notifications-data-model branch 2 times, most recently from dfe88a2 to ad18e9d Compare July 3, 2025 13:48
@Johnetordoff Johnetordoff force-pushed the add-new-notifications-data-model branch from ad18e9d to 300524c Compare July 3, 2025 14:20
 into add-new-notifications-data-model

* 'develop' of https://github.com/CenterForOpenScience/osf.io:
  Bump version no. Add CHANGELOG
  move CROSSREF_UNAVAILABLE_DELAY to settings.py
  handle and 5xx status code from crossref
  handle 500 error from crossref
  Update changelog and package.json
@Johnetordoff Johnetordoff marked this pull request as ready for review July 8, 2025 20:05
@Johnetordoff Johnetordoff force-pushed the add-new-notifications-data-model branch 4 times, most recently from 8fb240f to 124655c Compare July 30, 2025 23:44
@Johnetordoff Johnetordoff force-pushed the add-new-notifications-data-model branch 5 times, most recently from 0ef60ab to e6ebf4b Compare July 31, 2025 02:13
@Johnetordoff Johnetordoff force-pushed the add-new-notifications-data-model branch from e6ebf4b to 774ede0 Compare July 31, 2025 02:58
@Johnetordoff Johnetordoff force-pushed the add-new-notifications-data-model branch from 774ede0 to f281e99 Compare July 31, 2025 03:02
@Johnetordoff Johnetordoff force-pushed the add-new-notifications-data-model branch from 1122a3e to a90a234 Compare July 31, 2025 04:16
)
return BoaErrorCode.NO_ERROR


def handle_boa_error(message, code, username, fullname, project_url, query_file_full_path,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A slight change to handle_boa_error to pass the already decanted user object. Need user object for subscription

@@ -101,13 +101,10 @@ def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
node = self.get_object()

detailed_duplicates = detect_duplicate_notifications(node_id=node.id)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't have duplicate subscriptions, so no reason to detect,

@@ -1206,7 +1206,7 @@ def get_unregistered_contributor(self, obj):
return unclaimed_records.get('name', None)


class NodeContributorsCreateSerializer(NodeContributorsSerializer):
class ResourceContributorsCreateSerializer(NodeContributorsSerializer):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactor for better name

@Johnetordoff Johnetordoff force-pushed the add-new-notifications-data-model branch from 857b129 to 7ccc8fb Compare July 31, 2025 14:19
@Johnetordoff Johnetordoff changed the title [ENG-8064] Add New Notifications Data Model [ENG-8064] Add New Notifications Data Model (Refactor Notifications Phase 2) Jul 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants