INTEROP-8979: Add per-rule Slack notifications on issue creation#275
Closed
amp-rh wants to merge 1 commit into
Closed
INTEROP-8979: Add per-rule Slack notifications on issue creation#275amp-rh wants to merge 1 commit into
amp-rh wants to merge 1 commit into
Conversation
Add optional slack_channel field to firewatch config rules. When set, firewatch sends a Slack notification after creating a new Jira issue, updating a duplicate, or filing a success story. Absent or empty value skips notification. Supports !default to read from env var. Changes: - Rule: add _get_slack_channel with !default/$FIREWATCH_DEFAULT_SLACK_CHANNEL - SlackClient: add post_webhook static method for webhook-based posting - Configuration: accept slack_bot_token and slack_webhook_url params - Report: send Slack after issue creation, duplicate comment, success - CLI: add --slack-bot-token and --slack-webhook-url to report command Relates: https://issues.redhat.com/browse/INTEROP-8979 Made-with: Cursor
|
Skipping CI for Draft Pull Request. |
Collaborator
Author
|
Superseded by #274, which includes this feature plus token expiry alerts (INTEROP-8976) and doc fixes from the staging walkthrough. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
slack_channelfield to firewatch config rules (bothfailure_rulesandsuccess_rules). When set, firewatch sends a Slack notification after creating a new Jira issue, updating a duplicate, or filing a success story.!defaultto read from$FIREWATCH_DEFAULT_SLACK_CHANNEL, matching the pattern used by all other rule fields.--slack-bot-token) or incoming webhook URL (--slack-webhook-url).slack_channelon a rule skips notification entirely; no behavioral change for existing configs.Config example
{ "failure_rules": [ { "step": "install", "failure_type": "pod_failure", "classification": "Infrastructure", "jira_project": "LPINTEROP", "slack_channel": "#ocp-ci-firewatch-tool" } ] }Files changed
src/objects/rule.py_get_slack_channelwith!default/ env var supportsrc/objects/slack_base.pypost_webhookstatic method for webhook-based postingsrc/objects/configuration.pyslack_bot_tokenandslack_webhook_urlparamssrc/report/report.pysrc/commands/report.py--slack-bot-tokenand--slack-webhook-urlCLI optionsRelated
Test plan
slack_channelrule parsing)_notify_slackin Report for correct webhook vs bot-token fallbackslack_channel(existing behavior unchanged)slack_channel: "!default"andFIREWATCH_DEFAULT_SLACK_CHANNELenv varMade with Cursor