Skip to content

feat(notifications): improve notification template handling making it…#273

Open
julius-malcovsky wants to merge 9 commits intomainfrom
feature/notifications-improvements
Open

feat(notifications): improve notification template handling making it…#273
julius-malcovsky wants to merge 9 commits intomainfrom
feature/notifications-improvements

Conversation

@julius-malcovsky
Copy link
Contributor

… generic to support api and events

Copilot AI review requested due to automatic review settings March 12, 2026 19:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR makes approval notifications more generic so templates can work across both API subscriptions and event subscriptions by introducing normalized resource placeholders and collapsing target kinds into a shared “subscription” kind for purpose selection.

Changes:

  • Add resource_name / resource_type properties derived from requester basePath or eventType.
  • Normalize notification purpose target kind so ApiSubscription and EventSubscription both map to subscription.
  • Extend requester extraction tests to cover the new resource placeholders (including an event subscription case).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
approval/internal/handler/util/notification.go Adds generic resource placeholders, introduces target-kind normalization for purposes, updates default properties initialization.
approval/internal/handler/util/notification_test.go Expands extractRequester tests to assert resource_name / resource_type for API and event subscription inputs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@julius-malcovsky julius-malcovsky self-assigned this Mar 18, 2026
…stead of targetKind

Co-authored-by: Björn Kottner <BjoernKarma@users.noreply.github.com>
Co-authored-by: Ismael Garba <iagarba@users.noreply.github.com>
Co-authored-by: Stefan Siber <stefan-ctrl@users.noreply.github.com>
Co-authored-by: Ron Gummich <ron96g@users.noreply.github.com>
lukas016
lukas016 previously approved these changes Mar 19, 2026
Copy link
Collaborator

@lukas016 lukas016 left a comment

Choose a reason for hiding this comment

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

LGTM

@ron96g
Copy link
Member

ron96g commented Mar 19, 2026

approval/README.md (lines 196-231) needs updating to reflect the changes in this PR:

  • The purpose format is still documented as -- but should now be -- (e.g., approval--subscribe--updated--decider)
  • The note on line 202 still references approval--apisubscription as an example
  • The properties table lists target_basepath which should be updated to resource_name and resource_type

Co-authored-by: Björn Kottner <BjoernKarma@users.noreply.github.com>
Co-authored-by: Ismael Garba <iagarba@users.noreply.github.com>
Co-authored-by: Stefan Siber <stefan-ctrl@users.noreply.github.com>
Co-authored-by: Ron Gummich <ron96g@users.noreply.github.com>
@ron96g ron96g self-requested a review March 20, 2026 08:20
Copy link
Member

@ron96g ron96g left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for updating the readme

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.

4 participants