Add slack channel context aggregator #31
Merged
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.
This pull request introduces a new Slack channel aggregator to the
ContextAggregator
system, along with associated utilities. The most important changes include the addition of theslackChannelAggregator
, updates to theContextAggregator
to incorporate this new aggregator, and the creation of utility functions for handling Slack messages.Slack Channel Aggregator:
src/aggregator/slack-channel-aggregator.ts
: Added theslackChannelAggregator
to fetch and summarize Slack channel messages relevant to alerts.src/aggregator/ContextAggregator.ts
: Updated theContextKey
enum andCheckContextAggregator
class to include theslackChannelAggregator
. [1] [2] [3]Slack Message Utilities:
src/slackbot/channel-summary.ts
: Implemented thegenerateChannelSummary
function to generate summaries of Slack channel messages based on a given prompt.src/slackbot/utils.ts
: Added utility functions for fetching historical Slack messages, converting Slack timestamps, and extracting text from Slack message elements. [1] [2]Tests and Configuration:
src/slackbot/ops-channel.spec.ts
: Added tests for fetching historical messages and generating channel summaries.src/slackbot/web-client.ts
: Configured the Slack WebClient for API interactions.Minor Fixes:
src/routes/checklywebhook.ts
: Corrected the logic for handling duplicate alerts and improved formatting consistency. [1] [2] [3]