[#2173] Added per-channel branch filtering for notifications.#2429
[#2173] Added per-channel branch filtering for notifications.#2429AlexSkrypnyk merged 3 commits intomainfrom
Conversation
WalkthroughThis change implements per-channel branch filtering for notifications by replacing a global Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.vortex/docs/content/development/variables.mdx (1)
317-338:⚠️ Potential issue | 🟠 MajorRe-add
VORTEX_NOTIFY_BRANCHto the variables table (still required at runtime).
VORTEX_NOTIFY_BRANCHis still a required input inscripts/vortex/notify.shand is referenced by notification vars (e.g., Line 329, Line 337). Its removal from this page can lead to misconfiguration and hard failures.Suggested doc patch
| <a id="vortex_notify_channels"></a>`VORTEX_NOTIFY_CHANNELS` | The channels of the notifications.<br/><br/>A combination of comma-separated values: email,slack,newrelic,github,jira,webhook | `email` | `.env`, `scripts/vortex/notify.sh` | +| <a id="vortex_notify_branch"></a>`VORTEX_NOTIFY_BRANCH` | Notification git branch name used as the source branch for channel branch filtering and channel-specific defaults. | `UNDEFINED` | `scripts/vortex/notify.sh` | | <a id="vortex_notify_email_branches"></a>`VORTEX_NOTIFY_EMAIL_BRANCHES` | Email notification branch filter.<br/><br/>Comma-separated list of branch names. When set, email notifications are only sent for deployments on the listed branches. When empty, no filtering is applied. | `UNDEFINED` | `scripts/vortex/notify-email.sh` |🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.vortex/docs/content/development/variables.mdx around lines 317 - 338, The docs removed the required environment variable VORTEX_NOTIFY_BRANCH which is still referenced at runtime (e.g., in scripts/vortex/notify.sh and notification var descriptions like VORTEX_NOTIFY_GITHUB_BRANCH/VORTEX_NOTIFY_JIRA_BRANCH); add a new table row for `VORTEX_NOTIFY_BRANCH` with a short description ("Notification git branch name used by notify scripts"), a sensible default placeholder (e.g., `${VORTEX_NOTIFY_BRANCH}` or `UNDEFINED`), and list the relevant scripts (`scripts/vortex/notify.sh`, `scripts/vortex/notify-github.sh`, `scripts/vortex/notify-jira.sh`) in the source column so the variable is documented and discoverable.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In @.vortex/docs/content/development/variables.mdx:
- Around line 317-338: The docs removed the required environment variable
VORTEX_NOTIFY_BRANCH which is still referenced at runtime (e.g., in
scripts/vortex/notify.sh and notification var descriptions like
VORTEX_NOTIFY_GITHUB_BRANCH/VORTEX_NOTIFY_JIRA_BRANCH); add a new table row for
`VORTEX_NOTIFY_BRANCH` with a short description ("Notification git branch name
used by notify scripts"), a sensible default placeholder (e.g.,
`${VORTEX_NOTIFY_BRANCH}` or `UNDEFINED`), and list the relevant scripts
(`scripts/vortex/notify.sh`, `scripts/vortex/notify-github.sh`,
`scripts/vortex/notify-jira.sh`) in the source column so the variable is
documented and discoverable.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: fec6ed8f-3aa0-4a85-936a-75479ab9f817
📒 Files selected for processing (15)
.vortex/docs/content/deployment/notifications.mdx.vortex/docs/content/development/variables.mdx.vortex/tests/bats/unit/notify-email.bats.vortex/tests/bats/unit/notify-github.bats.vortex/tests/bats/unit/notify-jira.bats.vortex/tests/bats/unit/notify-newrelic.bats.vortex/tests/bats/unit/notify-slack.bats.vortex/tests/bats/unit/notify-webhook.bats.vortex/tests/bats/unit/notify.batsscripts/vortex/notify-email.shscripts/vortex/notify-github.shscripts/vortex/notify-jira.shscripts/vortex/notify-newrelic.shscripts/vortex/notify-slack.shscripts/vortex/notify-webhook.sh
|
Code coverage (threshold: 90%) Per-class coverage |
This comment has been minimized.
This comment has been minimized.
2 similar comments
This comment has been minimized.
This comment has been minimized.
|
Code coverage (threshold: 90%) Per-class coverage |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2429 +/- ##
==========================================
- Coverage 79.62% 79.24% -0.38%
==========================================
Files 127 120 -7
Lines 6801 6672 -129
Branches 44 0 -44
==========================================
- Hits 5415 5287 -128
+ Misses 1386 1385 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Closes #2173
Summary
Added per-channel branch filtering to all six notification channels (email, github, jira, newrelic, slack, webhook). Each channel now supports a
VORTEX_NOTIFY_<CHANNEL>_BRANCHESvariable that, when set, restricts notifications to deployments on the listed branches (comma-separated, exact match). When empty or unset, no filtering is applied. New Relic defaults tomain,master; all other channels default to no filter (pass through).Changes
Notification scripts (
scripts/vortex/)Each of the six channel scripts received the same branch-filtering block:
notify-email.sh— readsVORTEX_NOTIFY_EMAIL_BRANCHESnotify-github.sh— readsVORTEX_NOTIFY_GITHUB_BRANCHESnotify-jira.sh— readsVORTEX_NOTIFY_JIRA_BRANCHESnotify-newrelic.sh— readsVORTEX_NOTIFY_NEWRELIC_BRANCHES(default:main,master)notify-slack.sh— readsVORTEX_NOTIFY_SLACK_BRANCHESnotify-webhook.sh— readsVORTEX_NOTIFY_WEBHOOK_BRANCHESTests (
.vortex/tests/bats/unit/)notify.bats(router test) updated to usemainas the branch value for the New Relic default filter test.Documentation (
.vortex/docs/)notifications.mdx— added a new "Branch filtering" section explaining the feature and documenting theVORTEX_NOTIFY_<CHANNEL>_BRANCHESvariable for each channel's reference table.variables.mdx— added the six new variables to the auto-generated variable reference table; removed the now-redundantVORTEX_NOTIFY_BRANCHrow.Before / After
Before — notification dispatch had no per-channel branch guard:
After — each channel script checks its branch filter before sending:
Summary by CodeRabbit
New Features
Documentation
Tests