Refactor Slack Alerting and support it in new integration framework #979
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes proposed ✍️
What
🤖 Generated by Copilot at aff9074
This pull request adds a new local package
@crowd/alerting
to the backend and the integration run worker services. This package provides a function to send Slack alerts for different types of integration events, such as errors, warnings, successes, and data checks. The pull request also refactors the existing Slack alerting logic in the backend and the integration run worker services to use the new package. Additionally, the pull request adds some user context information, such as the tenant plan and name, to the Slack alerts. Finally, the pull request adds some configuration files and scripts for the new package, such as ESLint, Prettier, TypeScript, and a build script.
🤖 Generated by Copilot at aff9074
Why
How
🤖 Generated by Copilot at aff9074
@crowd/alerting
package to theservices/libs/alerting
folder, containing a function and types for sending Slack alerts for different types of integration events (F11-F17)@crowd/alerting
package to thebackend/package.json
andservices/apps/integration_run_worker/package.json
files, using local file paths (link, link)@crowd/alerting
package and its dependencies to thebackend/package-lock.json
andservices/apps/integration_run_worker/package-lock.json
files, using symbolic links and file prefixes (link, link, link, link, link, link, link, link, link, link, link)alerting
library to theservices/scripts/build_libs.sh
file, to build the TypeScript library (link)sendSlackAlert
andSlackAlertTypes
functions from the@crowd/alerting
package in the files that handle integration runs and data checks, and remove the unused imports from the oldslackAlerts
file (link, link, link, link, link)SLACK_ALERTING_CONFIG
constant to thebackend/src/conf
andservices/apps/integration_run_worker/src/conf
folders, containing the Slack alerting URL from theCROWD_SLACK_ALERTING_URL
environment variable (link, link)slackAlerting
configuration to theservices/apps/integration_run_worker/config/custom-environment-variables.json
file, mapping theurl
property to theCROWD_SLACK_ALERTING_URL
environment variable (link)sendSlackAlert
function in the files that handle integration runs and data checks, passing an object with the Slack alerting URL, the alert type, the integration information, the user context, the logger, the framework version, and the data checker settings (link, link, link)services/apps/integration_run_worker/src/repo
folder, containing the tenant plan, the trial flag, and the tenant name, to provide the user context for the Slack alerts (link, link)Checklist ✅
Feature
,Improvement
, orBug
.