Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
c40438f
[ENG-7812] Notification Refactor Phase 2 - Project PR (#11498)
cslzchen Jan 1, 2026
a1b1d41
Update changelog and bump version
cslzchen Jan 1, 2026
256210a
Merge branch 'release/26.1.0'
cslzchen Jan 1, 2026
f4c6c76
Merge tag '26.1.0' into develop
cslzchen Jan 1, 2026
7f351e2
Add logout query parameter to confirmation email URL
Ostap-Zherebetskyi Jan 2, 2026
c73c219
Fix password reset URL in ResetPassword view
Ostap-Zherebetskyi Jan 2, 2026
79b71e9
Merge pull request #11519 from Ostap-Zherebetskyi/hotfix/confirmation…
cslzchen Jan 2, 2026
8c206ec
Merge pull request #11521 from Ostap-Zherebetskyi/hotfix/password_res…
cslzchen Jan 2, 2026
173aa61
Remove unused settings from defaults.py
Ostap-Zherebetskyi Jan 2, 2026
b793331
Merge pull request #11522 from Ostap-Zherebetskyi/hotfix/remove_unuse…
cslzchen Jan 2, 2026
f256ca2
Add default notification subscriptions on user confirmation
Ostap-Zherebetskyi Jan 2, 2026
2f7e5b8
Merge pull request #11523 from Ostap-Zherebetskyi/hotfix/default_subs…
cslzchen Jan 2, 2026
e1667a2
Update changelog and bump version
cslzchen Jan 2, 2026
e220c87
Merge branch 'hotfix/26.1.1'
cslzchen Jan 2, 2026
837a600
Merge tag '26.1.1' into develop
cslzchen Jan 2, 2026
64e1583
Fix notification subjects for schema response
cslzchen Jan 5, 2026
c605016
add notification for adding moderators/admins in AddAdminOrModerator …
Ostap-Zherebetskyi Jan 5, 2026
2deba1e
fix unit tests
Ostap-Zherebetskyi Jan 5, 2026
ce60caf
Merge pull request #11526 from Ostap-Zherebetskyi/hotfix/moderator_ad…
cslzchen Jan 5, 2026
2eb73c8
Merge pull request #11525 from cslzchen/hotfix/fix-notification-subjects
cslzchen Jan 5, 2026
4a82216
Update defaults for triggered emails and add comments
cslzchen Jan 5, 2026
f6e8367
Fix local-ci.py for tests in GitHub Actions
cslzchen Jan 5, 2026
17bdb8c
withdraw_template_v2
Ostap-Zherebetskyi Jan 5, 2026
2e3dc4c
Merge pull request #11527 from cslzchen/hotfix/triggered-emails-defaults
cslzchen Jan 5, 2026
dbdb866
Merge pull request #11529 from Ostap-Zherebetskyi/hotfix/withdraw_tem…
cslzchen Jan 5, 2026
37358cd
Update changelog and bump version
cslzchen Jan 5, 2026
4abae69
Merge branch 'hotfix/26.1.2'
cslzchen Jan 5, 2026
9e14e1d
Merge tag '26.1.2' into develop
cslzchen Jan 5, 2026
ed326ea
Increase migration timeout and batch size for NR
cslzchen Jan 6, 2026
2bfb682
Update chagnelog and bump version
cslzchen Jan 6, 2026
a9ead7b
Merge branch 'hotfix/26.1.3'
cslzchen Jan 6, 2026
f10b969
Merge tag '26.1.3' into develop
cslzchen Jan 6, 2026
62632af
update email context for PROVIDER_NEW_PENDING_WITHDRAW_REQUESTS
Ostap-Zherebetskyi Jan 6, 2026
05a7eed
Add populate_subscriptions script to manage notification subscriptions
Ostap-Zherebetskyi Jan 6, 2026
137f248
Merge pull request #11532 from Ostap-Zherebetskyi/hotfix/withdraw_tem…
cslzchen Jan 6, 2026
06c8340
fix review comments
Ostap-Zherebetskyi Jan 6, 2026
392535e
Merge pull request #11533 from Ostap-Zherebetskyi/hotfix/populate_sub…
cslzchen Jan 6, 2026
fed6271
Update PR template
cslzchen Jan 6, 2026
c89b087
Tweak PR template
cslzchen Jan 6, 2026
0587d66
Update changelog and bump version
cslzchen Jan 6, 2026
6e204bb
Merge branch 'hotfix/26.1.4'
cslzchen Jan 6, 2026
530b7f4
Merge tag '26.1.4' into develop
cslzchen Jan 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
28 changes: 28 additions & 0 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,3 +201,31 @@ jobs:
- name: Upload report
if: (github.event_name != 'pull_request') && (success() || failure()) # run this step even if previous step failed
uses: ./.github/actions/gen-report

scripts:
runs-on: ubuntu-22.04
permissions:
checks: write
needs: build-cache
services:
postgres:
image: postgres

env:
POSTGRES_PASSWORD: ${{ env.OSF_DB_PASSWORD }}
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/start-build
- name: Run tests
run: poetry run python3 -m invoke test-ci-scripts -n 1 --junit
- name: Upload report
if: (github.event_name != 'pull_request') && (success() || failure()) # run this step even if previous step failed
uses: ./.github/actions/gen-report
35 changes: 35 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,41 @@

We follow the CalVer (https://calver.org/) versioning scheme: YY.MINOR.MICRO.

26.1.4 (2026-01-06)
===================

- Follow-up fix for preprint/registration withdrawal request
- Added a script/task to populate default notification subscriptions that were missing before and after NR
- Reworked PR template

26.1.3 (2026-01-05)
===================

- Increase NR migration timeout and batch size

26.1.2 (2026-01-05)
===================

- Notifications Refactor Phase 2 - UAT Hotfix Part 2
* Fix adding moderator email in admin
* Fix preprint/registration withdrawal request email in digest
* Fix subjects for schema response update emails
* Update defauls for triggered emails

26.1.1 (2026-01-02)
===================

- Notifications Refactor Phase 2 - UAT Hotfix Part 1
* Fix reset password url
* Fix logout query for new user confirmation url
* Fix new user default notification subscription
* Clean-up / Sync settings

26.1.0 (2026-01-01)
===================

- Notifications Refactor Phase 2 Project Release

25.18.2 (2025-12-19)
====================

Expand Down
64 changes: 40 additions & 24 deletions PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,55 @@
<!-- Before submit your Pull Request, make sure you picked
the right branch:
[//]: # (
* Before submitting your Pull Request, make sure you've picked the right branch and your code is up-to-date with it.
* For critical hotfixes, select "master" as the target branch.
* For bugfixes, improvements and new features, select "develop" as the target branch.
* If your PR is part of a project/team, select project/team's dedicated feature branch as the target.
* If you have a JIRA ticket, prefix the ticket number [ENG-*****] to the PR title.
)

- For hotfixes, select "master" as the target branch
- For new features, select "develop" as the target branch
- For release feature fixes, select the relevant release branch (release/X.Y.Z) as the target branch -->
## Ticket

[//]: # (Link to a JIRA ticket if available.)

* [ENG-*****]()

## Purpose

<!-- Describe the purpose of your changes -->
[//]: # (Briefly describe the purpose of this PR.)

## Changes

<!-- Briefly describe or list your changes -->
[//]: # (Briefly describe or list your changes.)

## QA Notes
## Side Effects

[//]: # (Any possible side effects?)

<!-- 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?
-->
## QE Notes

## Documentation
[//]: # (
* Any QA testing notes for QE?
* Make verification statements inspired by your code and what your code touches.
* What are the areas of risk?
* Any concerns/considerations/questions that development raised?
* If you have a JIRA ticket, make sure the ticket also contains the QE notes.
)

<!-- Does any internal or external documentation need to be updated?
- If the API was versioned, update the developer.osf.io changelog.
- If changes were made to the API, link the developer.osf.io PR here.
-->
## CE Notes

## Side Effects

<!-- Any possible side effects? -->
[//]: # (
* Any server configuration and deployment notes for CE?
* Is model migration required? Is data migration/backfill/population required?
* If so, is it reversible? Is there a roll-back plan?
* Does server settings needs to be updated?
* If so, have you checked with CE on existing settings for affected servers?
* Are there any deployment dependencies to other services?
* If you have a JIRA ticket, make sure the ticket also contains the CE notes.
)

## Ticket
## Documentation

<!-- Link to Jira ticket, if applicable e.g. https://openscience.atlassian.net/browse/OSF-1234 -->
[//]: # (
* Does any internal or external documentation need to be updated?
* If the API was versioned, update the developer.osf.io changelog.
* If changes were made to the API, link the developer.osf.io PR here.
)
6 changes: 6 additions & 0 deletions README-docker-compose.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,12 @@
```bash
docker compose run --rm web python3 -m scripts.parse_citation_styles
```
- Populate Notification Types
- Needed for notifications.
```bash
docker compose run --rm web python3 manage.py populate_notification_types
```
- _NOTE: The waffle switch `POPULATE_NOTIFICATION_TYPES` needs to be turned on.
- Start ember_osf_web
- Needed for ember app:
- `docker-compose up -d ember_osf_web`
Expand Down
47 changes: 27 additions & 20 deletions addons/base/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
from framework.flask import redirect
from framework.sentry import log_exception
from framework.transactions.handlers import no_auto_transaction
from website import mails
from website import settings
from addons.base import signals as file_signals
from addons.base.utils import format_last_known_metadata, get_mfr_url
Expand All @@ -52,7 +51,7 @@
DraftRegistration,
Guid,
FileVersionUserMetadata,
FileVersion
FileVersion, NotificationType
)
from osf.metrics import PreprintView, PreprintDownload
from osf.utils import permissions
Expand All @@ -64,7 +63,7 @@
from website.util import rubeus

# import so that associated listener is instantiated and gets emails
from website.notifications.events.files import FileEvent # noqa
from notifications.file_event_notifications import FileEvent # noqa

ERROR_MESSAGES = {'FILE_GONE': """
<style>
Expand Down Expand Up @@ -226,8 +225,6 @@ def get_auth(auth, **kwargs):
_check_resource_permissions(resource, auth, action)

provider_name = waterbutler_data['provider']
waterbutler_settings = None
waterbutler_credentials = None
file_version = file_node = None
if provider_name == 'osfstorage' or (not flag_is_active(request, features.ENABLE_GV)):
file_version, file_node = _get_osfstorage_file_version_and_node(
Expand Down Expand Up @@ -576,20 +573,32 @@ def create_waterbutler_log(payload, **kwargs):
params=payload
)

if payload.get('email') is True or payload.get('errors'):
mails.send_mail(
user.username,
mails.FILE_OPERATION_FAILED if payload.get('errors')
else mails.FILE_OPERATION_SUCCESS,
action=payload['action'],
source_node=source_node,
destination_node=destination_node,
source_path=payload['source']['materialized'],
source_addon=payload['source']['addon'],
destination_addon=payload['destination']['addon'],
osf_support_email=settings.OSF_SUPPORT_EMAIL
if payload.get('email') or payload.get('errors'):
if payload.get('email'):
notification_type = NotificationType.Type.USER_FILE_OPERATION_SUCCESS.instance
if payload.get('errors'):
notification_type = NotificationType.Type.USER_FILE_OPERATION_FAILED.instance
notification_type.emit(
user=user,
subscribed_object=node,
event_context={
'user_fullname': user.fullname,
'action': payload['action'],
'source_node': source_node._id,
'source_node_title': source_node.title,
'destination_node': destination_node._id,
'destination_node_title': destination_node.title,
'destination_node_parent_node_title': destination_node.parent_node.title if destination_node.parent_node else None,
'source_path': payload['source']['materialized'],
'source_addon': payload['source']['addon'],
'destination_addon': payload['destination']['addon'],
'osf_support_email': settings.OSF_SUPPORT_EMAIL,
'logo': settings.OSF_LOGO,
'OSF_LOGO_LIST': settings.OSF_LOGO_LIST,
'OSF_LOGO': settings.OSF_LOGO,
'domain': settings.DOMAIN,
}
)

if payload.get('errors'):
# Action failed but our function succeeded
# Bail out to avoid file_signals
Expand All @@ -603,10 +612,8 @@ def create_waterbutler_log(payload, **kwargs):
target_node = AbstractNode.load(metadata.get('nid'))
if target_node and payload['action'] != 'download_file':
update_storage_usage_with_size(payload)

with transaction.atomic():
file_signals.file_updated.send(target=node, user=user, event_type=action, payload=payload)

return {'status': 'success'}


Expand Down
64 changes: 33 additions & 31 deletions addons/boa/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@
from addons.boa.boa_error_code import BoaErrorCode
from framework import sentry
from framework.celery_tasks import app as celery_app
from osf.models import OSFUser
from osf.models import OSFUser, NotificationType
from osf.utils.fields import ensure_str, ensure_bytes
from website import settings as osf_settings
from website.mails import send_mail, ADDONS_BOA_JOB_COMPLETE, ADDONS_BOA_JOB_FAILURE

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -184,18 +183,19 @@ async def submit_to_boa_async(host, username, password, user_guid, project_guid,

logger.info('Successfully uploaded query output to OSF.')
logger.debug('Task ends <<<<<<<<')
await sync_to_async(send_mail)(
to_addr=user.username,
mail=ADDONS_BOA_JOB_COMPLETE,
fullname=user.fullname,
query_file_name=query_file_name,
query_file_full_path=file_full_path,
output_file_name=output_file_name,
job_id=boa_job.id,
project_url=project_url,
boa_job_list_url=boa_settings.BOA_JOB_LIST_URL,
boa_support_email=boa_settings.BOA_SUPPORT_EMAIL,
osf_support_email=osf_settings.OSF_SUPPORT_EMAIL,
NotificationType.Type.ADDONS_BOA_JOB_COMPLETE.instance.emit(
user=user,
event_context={
'user_fullname': user.fullname,
'query_file_name': query_file_name,
'query_file_full_path': file_full_path,
'output_file_name': output_file_name,
'job_id': boa_job.id,
'project_url': project_url,
'boa_job_list_url': boa_settings.BOA_JOB_LIST_URL,
'boa_support_email': boa_settings.BOA_SUPPORT_EMAIL,
'osf_support_email': osf_settings.OSF_SUPPORT_EMAIL,
}
)
return BoaErrorCode.NO_ERROR

Expand All @@ -209,22 +209,24 @@ def handle_boa_error(message, code, username, fullname, project_url, query_file_
sentry.log_message(message, skip_session=True)
except Exception:
pass
send_mail(
to_addr=username,
mail=ADDONS_BOA_JOB_FAILURE,
fullname=fullname,
code=code,
message=message,
query_file_name=query_file_name,
file_size=file_size,
max_file_size=boa_settings.MAX_SUBMISSION_SIZE,
query_file_full_path=query_file_full_path,
output_file_name=output_file_name,
job_id=job_id,
max_job_wait_hours=boa_settings.MAX_JOB_WAITING_TIME / 3600,
project_url=project_url,
boa_job_list_url=boa_settings.BOA_JOB_LIST_URL,
boa_support_email=boa_settings.BOA_SUPPORT_EMAIL,
osf_support_email=osf_settings.OSF_SUPPORT_EMAIL,
NotificationType.Type.ADDONS_BOA_JOB_FAILURE.instance.emit(
destination_address=username,
event_context={
'user_fullname': fullname,
'code': code,
'query_file_name': query_file_name,
'file_size': file_size,
'message': message,
'max_file_size': boa_settings.MAX_SUBMISSION_SIZE,
'query_file_full_path': query_file_full_path,
'output_file_name': output_file_name,
'job_id': job_id,
'max_job_wait_hours': boa_settings.MAX_JOB_WAITING_TIME / 3600,
'project_url': project_url,
'boa_job_list_url': boa_settings.BOA_JOB_LIST_URL,
'boa_support_email': boa_settings.BOA_SUPPORT_EMAIL,
'osf_support_email': osf_settings.OSF_SUPPORT_EMAIL,

}
)
return code
Loading