Skip to content

INTEROP-8979: Add per-rule Slack notifications on issue creation#275

Closed
amp-rh wants to merge 1 commit into
RedHatQE:mainfrom
amp-rh:interop-8979/slack-notification
Closed

INTEROP-8979: Add per-rule Slack notifications on issue creation#275
amp-rh wants to merge 1 commit into
RedHatQE:mainfrom
amp-rh:interop-8979/slack-notification

Conversation

@amp-rh
Copy link
Copy Markdown
Collaborator

@amp-rh amp-rh commented Apr 7, 2026

Summary

  • Add optional slack_channel field to firewatch config rules (both failure_rules and success_rules). When set, firewatch sends a Slack notification after creating a new Jira issue, updating a duplicate, or filing a success story.
  • Supports !default to read from $FIREWATCH_DEFAULT_SLACK_CHANNEL, matching the pattern used by all other rule fields.
  • Notifications can be delivered via Slack bot token (--slack-bot-token) or incoming webhook URL (--slack-webhook-url).
  • Empty or absent slack_channel on 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

File Change
src/objects/rule.py Add _get_slack_channel with !default / env var support
src/objects/slack_base.py Add post_webhook static method for webhook-based posting
src/objects/configuration.py Accept slack_bot_token and slack_webhook_url params
src/report/report.py Send Slack after issue creation, duplicate comment, success story
src/commands/report.py Add --slack-bot-token and --slack-webhook-url CLI options

Related

Test plan

  • All 222 unit tests pass (including 5 new tests for slack_channel rule parsing)
  • Review _notify_slack in Report for correct webhook vs bot-token fallback
  • Verify Slack message format with a real webhook URL
  • Test with config that has no slack_channel (existing behavior unchanged)
  • Test with slack_channel: "!default" and FIREWATCH_DEFAULT_SLACK_CHANNEL env var

Made with Cursor

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
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Apr 7, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@amp-rh
Copy link
Copy Markdown
Collaborator Author

amp-rh commented Apr 10, 2026

Superseded by #274, which includes this feature plus token expiry alerts (INTEROP-8976) and doc fixes from the staging walkthrough.

@amp-rh amp-rh closed this Apr 10, 2026
@amp-rh amp-rh deleted the interop-8979/slack-notification branch April 13, 2026 17:16
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.

1 participant