Skip to content

feat: add watchers, additional assignees, and per-rule Slack labels to firewatch rules#277

Open
amp-rh wants to merge 1 commit into
RedHatQE:mainfrom
amp-rh:cursor/bd49d833
Open

feat: add watchers, additional assignees, and per-rule Slack labels to firewatch rules#277
amp-rh wants to merge 1 commit into
RedHatQE:mainfrom
amp-rh:cursor/bd49d833

Conversation

@amp-rh
Copy link
Copy Markdown
Collaborator

@amp-rh amp-rh commented May 4, 2026

Summary

Extends firewatch rules so CI failures produce richer Jira issues and Automation-friendly Slack routing without adding Slack tokens or webhooks to the firewatch workload.

  • jira_watchers: list of emails; watchers are added after issue create (best effort; unresolvable users log a warning and are skipped).
  • jira_additional_assignees: list of emails; sets the Red Hat Jira Additional Assignees field (customfield_10465) after create (best effort).
  • slack_channel / slack_user: optional strings; firewatch adds Jira labels slack-channel:<name> (# stripped) and slack-user:<sanitized-email> (@-at-) so Jira Automation rules (for example Send web request to a Slack Workflow) can route notifications per rule.

!default for email lists: when jira_watchers or jira_additional_assignees contains !default, values are merged from FIREWATCH_DEFAULT_JIRA_WATCHERS / FIREWATCH_DEFAULT_JIRA_ADDITIONAL_ASSIGNEES (JSON arrays). Firewatch exits with an error if !default is used but the corresponding env var is missing or empty after parsing (stricter than optional defaults on some other fields).

Rule reference: docs/configuration_guide.md.

openshift-ci smoke replay (local)

Tests and tooling

  • E2E: synthetic job names and stubbed downloads to avoid collisions; cleanup helper for created issues; optional live assertions for labels and watcher/additional-assignee fields when JIRA_EMAIL is set.
  • Unit tests updated for report output parity and rule behavior.
  • Pre-commit: types-requests for mypy; e2e may load repo-root .env via python-dotenv.
  • VS Code: default pytest args targeting tests/.

New rule fields

Field Type Jira behavior
jira_watchers list of emails Watcher API after create
jira_additional_assignees list of emails Additional Assignees (customfield_10465)
slack_channel string Label slack-channel:<channel>
slack_user string Label slack-user:<sanitized-email>

Test plan

  • Unit tests for rule getters, Jira helpers, report wiring, and slack labels on issues
  • E2E (live Jira): passing-label regression and rule-field smoke with stubbed Prow layout
  • pre-commit run --all-files
  • Reviewer sign-off

Resolves INTEROP-8865, INTEROP-8979

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 4, 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 amp-rh changed the title feat: add jira_watchers and jira_additional_assignees to firewatch rules feat: add watchers, additional assignees, and per-rule Slack labels to firewatch rules May 4, 2026
@amp-rh amp-rh force-pushed the cursor/bd49d833 branch from e0d0ec7 to aeec563 Compare May 6, 2026 19:10
Add rule fields for Jira watchers, additional assignees, slack channel, and slack user routing, wire them through report issue creation and labels, and document Slack Workflow Builder integration. Include smoke scripts and expanded unit/e2e coverage, including slack-user label normalization to username-only test values.
@amp-rh amp-rh force-pushed the cursor/bd49d833 branch from da23194 to 86e3efb Compare May 7, 2026 12:39
@amp-rh amp-rh marked this pull request as ready for review May 12, 2026 12:54
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