Skip to content

Conversation

garrrikkotua
Copy link
Contributor

@garrrikkotua garrrikkotua commented Jun 13, 2023

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

To send alerts to Slack with ease
We added a package @crowd/alerting please
It takes an object as input
With user context and data to put
And makes HTTP requests with axios and he

Why

How

🤖 Generated by Copilot at aff9074

  • Add a new @crowd/alerting package to the services/libs/alerting folder, containing a function and types for sending Slack alerts for different types of integration events (F11-F17)
  • Add a dependency on the @crowd/alerting package to the backend/package.json and services/apps/integration_run_worker/package.json files, using local file paths (link, link)
  • Add entries for the @crowd/alerting package and its dependencies to the backend/package-lock.json and services/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)
  • Add a new entry for the alerting library to the services/scripts/build_libs.sh file, to build the TypeScript library (link)
  • Import the sendSlackAlert and SlackAlertTypes functions from the @crowd/alerting package in the files that handle integration runs and data checks, and remove the unused imports from the old slackAlerts file (link, link, link, link, link)
  • Add a new SLACK_ALERTING_CONFIG constant to the backend/src/conf and services/apps/integration_run_worker/src/conf folders, containing the Slack alerting URL from the CROWD_SLACK_ALERTING_URL environment variable (link, link)
  • Add a new entry for the slackAlerting configuration to the services/apps/integration_run_worker/config/custom-environment-variables.json file, mapping the url property to the CROWD_SLACK_ALERTING_URL environment variable (link)
  • Update the calls to the 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)
  • Add three new columns to the SQL query and three new properties to the interface for the integration run data in the 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 ✅

  • Label appropriately with Feature, Improvement, or Bug.
  • Add screehshots to the PR description for relevant FE changes
  • New backend functionality has been unit-tested.
  • API documentation has been updated (if necessary) (see docs on API documentation).
  • Quality standards are met.

@garrrikkotua garrrikkotua changed the title wip Refactor Slack Alerting and support it in new integration frameworkl Jun 13, 2023
@garrrikkotua garrrikkotua changed the title Refactor Slack Alerting and support it in new integration frameworkl Refactor Slack Alerting and support it in new integration framework Jun 13, 2023
@garrrikkotua garrrikkotua merged commit de9abb2 into main Jun 13, 2023
@garrrikkotua garrrikkotua deleted the improvement/slack-alerting branch June 13, 2023 13:04
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