Skip to content
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

Slack Plugin Config should be stored in Custom Settings #593

Open
Damecek opened this issue Dec 14, 2023 · 4 comments
Open

Slack Plugin Config should be stored in Custom Settings #593

Damecek opened this issue Dec 14, 2023 · 4 comments
Assignees
Labels
enhancement New feature or request log management Items related to the custom objects & Logger Console app notifications Slack plugin

Comments

@Damecek
Copy link
Sponsor

Damecek commented Dec 14, 2023

Package Edition of Nebula Logger

Unlocked Package

Package Version of Nebula Logger

1.5.2

New Bug Summary

Hi,

currently the Configuration of the Slack Plugin is stored in the Custom Metadata Type called Logger Parameter. This brings complications in following cases:

  • Package upgrade will overwrite current setting with the default one coming from package
  • cloning sandbox from target sandbox will also clone the configuration of the plugin. this is issue especially for the SlackEndpoint metadata as this could let to multiple sandboxes publishing messages to a single Slack Channel

My suggested solution is to store those information in Custom Settings, which are not deployable. Another benefit of this would be that we could publish messages to multiple Slack Channels from single Salesforce environment. Could be useful for example to log System Admin Profile to different channel than the rest of profiles.

@Damecek Damecek added the bug Something isn't working label Dec 14, 2023
@jongpie
Copy link
Owner

jongpie commented Jan 20, 2024

Hi @Damecek! I've been having similar ideas over the last few months, and I think I'm going to...

  • Make the Slack integration part of Nebula Logger's core package (and the Slack plugin will be deprecated)
  • Use 1 or 2 custom objects to store configurations for notifications. I think that custom settings will be too limiting.

I've started a prototype of using custom objects, and it'll give me a lot more control & flexibility over how Slack notifications can be setup (including sandboxes with cloned data). I'm hoping to make more progress on this over the next few months.

@jongpie jongpie added enhancement New feature or request log management Items related to the custom objects & Logger Console app notifications and removed bug Something isn't working labels Jan 20, 2024
@Damecek
Copy link
Sponsor Author

Damecek commented Jan 20, 2024

What limitations are you talking about? The benefit of custom settings is the hierarchy where different users or profiles can send messages to a different Slack channels. Also, using custom settings will be easier to integrate the slack setup to the current custom setup component.

@jongpie
Copy link
Owner

jongpie commented Jan 20, 2024

There are a couple of issues with using custom settings

  • Cloned sandboxes will have a cloned copy of the custom settings data, so multiple sandboxes publishing messages to a single Slack channel would still be an issue. With custom objects, the data will still be cloned, but I can use some additional fields on the custom objects to track the original org ID where the record was created (and then not send notifications if the current org ID is different).
  • Tying the notifications directly to the hierarchy is limiting. In my current job, we use Nebula Logger for monitoring multiple apps that we own. And often, we'd like to receive notifications for some of our apps/Apex classes, but not others - the profile or user is not relevant to which notifications we want to receive. Using profiles/users (via custom hierarchy settings) doesn't provide this flexibility.
  • In more complex orgs, there is often a need to send notifications to multiple Slack channels. Some orgs are supported by multiple Salesforce teams, so sending Slack notifications to only a single channel is not ideal for some admins & developers.
  • Long term, I want to support other types of notifications besides just Slack. Not everyone use Slack, so I want to move towards a more robust data model that will (eventually) support the ability to setup other integrations, like email notifications, Teams messages, webhooks, etc. This would be too complicated to try to do within the custom settings object.

By decoupling notification configuration from logging configuration, it'll provide a lot more flexibility.

@Damecek
Copy link
Sponsor Author

Damecek commented Jan 20, 2024

Thanks for explaining, it looks like you have everything though through. Definitely looking forward to this upgrade. 🚀

@jongpie jongpie self-assigned this Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request log management Items related to the custom objects & Logger Console app notifications Slack plugin
Projects
None yet
Development

No branches or pull requests

2 participants