Skip to content

Added two new helpers for notifications actions and channels - #2651

Draft
s3inlc wants to merge 2 commits into
masterfrom
2645-notifications-helpers-for-new-api
Draft

s3inlc wants to merge 2 commits into
masterfrom
2645-notifications-helpers-for-new-api

Conversation

@s3inlc

@s3inlc s3inlc commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Backend part for #2645
Needs changes from hashtopolis/python-hashtopolis#16 merged to pass tests

@s3inlc
s3inlc marked this pull request as draft November 27, 2026 09:33
@s3inlc
s3inlc requested a balanced review from Copilot November 27, 2026 09:33

Copilot AI 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.

🟡 Changes recommended

Notification updates can overwrite concurrent changes or partially persist rejected PATCHes, while missing client methods and skipped cleanup cause CI failures.

4 open issues
What changed in this PR

Adds backend discovery of notification actions and delivery channels for #2645, allowing the frontend to replace hardcoded notification options with server-provided metadata.

Changes:

  • Registers two GET helpers exposing available actions, required permissions, and channels.
  • Adds notification ownership checks, validated updates, and support for creating inactive settings.
  • Updates OpenAPI documentation and adds API and schema tests.
File Description
src/​inc/​utils/​NotificationUtils.php Adds ownership checks and validated notification updates.
src/​inc/​apiv2/​model/​NotificationSettingAPI.php Restricts owner access and connects update handlers.
src/​inc/​apiv2/​helper/​GetNotificationChannelsHelperAPI.php Exposes registered delivery channels.
src/​inc/​apiv2/​helper/​GetNotificationActionsHelperAPI.php Exposes actions and permission metadata.
src/​inc/​apiv2/​common/​ApiRegistry.php Registers both notification helpers.
openapi.json Documents helpers and revised notification settings.
ci/​phpunit/​inc/​apiv2/​openapi/​SpecBuilderHelperApiTest.php Tests helper response schemas.
ci/​apiv2/​test_notification.py Tests notification updates, activation, and access control.
ci/​apiv2/​test_notification_helper.py Tests action and channel discovery.

Review effort: Balanced

Comment thread ci/apiv2/test_notification.py Resolved

class NotificationActionsHelperTest(BaseTest):
def test_returns_actions(self):
actions = Helper().get_notification_actions()
Comment thread src/inc/utils/NotificationUtils.php Resolved
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