Skip to content

ci: allow testing the Slack alert via a manual test_alert input - #46

Merged
ilya-bogin-keenable merged 1 commit into
mainfrom
ci/slack-alert-manual-test
Jun 16, 2026
Merged

ci: allow testing the Slack alert via a manual test_alert input#46
ilya-bogin-keenable merged 1 commit into
mainfrom
ci/slack-alert-manual-test

Conversation

@ilya-bogin-keenable

Copy link
Copy Markdown
Contributor

Why

The notify job from #44 only fires on the nightly schedule, so a manual workflow_dispatch run correctly skips it — there was no way to verify the alert without waiting for the cron (see run 27609273988, where notify-slack-on-failure was skipped).

Change

Add a boolean test_alert dispatch input. When a manual run is started with test_alert=true and e2e fails, the alert also fires. Nightly behavior is unchanged:

if: ${{ always() && needs.e2e.result != 'success'
        && (github.event_name == 'schedule' || inputs.test_alert) }}

On a schedule event inputs.test_alert is undefined/falsy, so the schedule path is unaffected.

How to test

Run the E2E workflow manually (Actions → E2E → Run workflow) with test_alert = true. While e2e is red (until #45 lands) the alert will fire; once green it won't (as intended).

🤖 Generated with Claude Code

The notify job only fires on the nightly schedule, so there was no way to
verify it short of waiting for cron (a manual workflow_dispatch correctly
skipped it). Add a boolean test_alert dispatch input that, when true, also
fires the alert on a manual failing run — nightly behavior is unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@qodo-code-review

qodo-code-review Bot commented Jun 16, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Informational

1. Misleading Slack message 🐞 Bug ◔ Observability
Description
The notify job can now run on manual workflow_dispatch when inputs.test_alert is true, but the Slack
payload text is still hardcoded to say “Nightly e2e failed”, which will mislabel manual test alerts
and confuse responders.
Code

.github/workflows/e2e.yml[152]

+    if: ${{ always() && needs.e2e.result != 'success' && (github.event_name == 'schedule' || inputs.test_alert) }}
Evidence
The notify job condition explicitly allows manual runs via inputs.test_alert, while the Slack
payload text remains hardcoded to “Nightly e2e failed”, so manual test alerts will be mislabeled as
nightly failures.

.github/workflows/e2e.yml[149-153]
.github/workflows/e2e.yml[165-173]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The Slack notification text is hardcoded as a nightly failure message, but the PR changes the notify job to also fire on manual runs when `inputs.test_alert` is true. This makes manual test alerts appear as nightly failures.

## Issue Context
The notify job is now gated by `github.event_name == 'schedule' || inputs.test_alert`, so it can run for workflow_dispatch runs. The payload currently always says `Nightly e2e failed`.

## Fix Focus Areas
- .github/workflows/e2e.yml[149-173]

## Suggested fix
Update the payload text to be neutral (e.g., "E2E failed") or conditional (e.g., if `github.event_name == 'schedule'` then "Nightly..." else "Manual test alert..."). Optionally include `github.event_name` and/or `inputs.version` in the message for clarity.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

CI: add manual test_alert input to trigger Slack notify on failing E2E runs
⚙️ Configuration changes ✨ Enhancement 🕐 Less than 10 minutes

Grey Divider

Description

• Add test_alert workflow_dispatch input to enable on-demand Slack alert testing.
• Update notify job condition to run on schedule or manual test_alert=true failures.
• Keep nightly schedule behavior unchanged for normal manual runs.
Diagram

graph TD
  A(["GitHub Actions: E2E workflow"]) --> B{"Trigger"} --> C(["workflow_dispatch"]) --> D["Input: test_alert"] --> E(["Job: e2e"])
  B --> F(["schedule (cron)"]) --> E
  E --> G{"e2e result != success?"} --> H(["Job: notify"]) --> I["Slack Incoming Webhook"]
  D -. "only when true" .-> H

  subgraph Legend
    direction LR
    _act(["Workflow/Job"]) ~~~ _dec{"Decision"} ~~~ _ext["External"]
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Separate manual “alert test” workflow
  • ➕ Keeps the main E2E workflow semantics unchanged and simpler
  • ➕ Can explicitly test Slack notification independent of E2E outcome
  • ➖ Adds another workflow to maintain
  • ➖ Harder to ensure parity with the real notify job conditions
2. Use a string input like `notify_mode: always|schedule_only`
  • ➕ More extensible if additional notification behaviors are needed later
  • ➕ Clearer intent if more modes are added
  • ➖ More verbose UX than a boolean for a single testing toggle
  • ➖ Overkill for the current requirement

Recommendation: The chosen boolean test_alert input is the best fit: it minimally extends the existing workflow, preserves the default manual-run behavior (no Slack noise), and enables on-demand validation of the notify path without duplicating workflows.

Files changed (1) +14 / -8

Other (1) +14 / -8
e2e.ymlAdd 'test_alert' input and broaden Slack notify job condition +14/-8

Add 'test_alert' input and broaden Slack notify job condition

• Introduces a boolean 'workflow_dispatch' input ('test_alert') to allow testing the Slack notification on manual runs. Updates the notify job 'if' condition to trigger on schedule failures or on manual failures when 'inputs.test_alert' is true, while leaving normal manual runs unchanged.

.github/workflows/e2e.yml

@ilya-bogin-keenable
ilya-bogin-keenable merged commit 4b4a266 into main Jun 16, 2026
12 checks passed
@ilya-bogin-keenable
ilya-bogin-keenable deleted the ci/slack-alert-manual-test branch June 16, 2026 11:37
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