Skip to content

fix(load): skip committee-approval emails and set approval_label - #618

Open
zubeydecivelek wants to merge 1 commit into
CERNDocumentServer:masterfrom
zubeydecivelek:fix-approval-request-load
Open

zubeydecivelek wants to merge 1 commit into
CERNDocumentServer:masterfrom
zubeydecivelek:fix-approval-request-load

Conversation

@zubeydecivelek

@zubeydecivelek zubeydecivelek commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Comment on lines +216 to +229
@staticmethod
def _drop_notification_ops(uow, from_index):
"""Remove notification ops registered at/after ``from_index``.

``CommitteeApprovalRequest``'s create action is a create-and-submit that
emails the referee group. Migrated (already-approved) requests must not
notify anyone.
"""
uow._operations[from_index:] = [
op
for op in uow._operations[from_index:]
if not isinstance(op, NotificationOp)
]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

instead of this we can change in cds-rdm. We can skip the submit notification when identity is system. Real UI submissions (community managers) still send email.
@zzacharo

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can you disable notifications in general from the migrator kit pod instead of adding the code?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would say that, unless we have some notification that make sense during migration, but I dont think so :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we don't have any, I specifically disabled the notifications on the migration pod because we don't want to send any emails

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I checked how it's done for Community submission. It uses a plain CreateAction on create, so migration can create the request and then set submitted/accepted without running submit/accept (where emails are sent). Committee approval is implemented differently so same service.create() validates, grants referees, and queues the notify email. So migration needs an extra step...

It can separated in cds-rdm also. Or do you prefer having a config variable for migrator to disable it?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cant' we just hook on this and write configure the email backend to not send email notifications from the migration pod?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I might be wrong but as I understand NOTIFICATIONS_BACKENDS is applied where the Celery task runs, not where it is queued and we use the same mq so it doesnt matter it comes from migration pod

@zzacharo zzacharo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the fix for the approval label seems fine!

@zubeydecivelek
zubeydecivelek force-pushed the fix-approval-request-load branch from 6a7eb36 to e140544 Compare October 5, 2026 14:34
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.

fix(notifications): missing approval label in committee approval notification

3 participants