Skip to content

feat: add bifrost.alerting to Helm chart with declarative channels and CEL-based rules#5079

Open
BearTS wants to merge 1 commit into
07-10-feat_new_calendar_alignment_additionsfrom
07-10-chore_add_alerting_to_helm
Open

feat: add bifrost.alerting to Helm chart with declarative channels and CEL-based rules#5079
BearTS wants to merge 1 commit into
07-10-feat_new_calendar_alignment_additionsfrom
07-10-chore_add_alerting_to_helm

Conversation

@BearTS

@BearTS BearTS commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds bifrost.alerting as a new top-level Helm values key, enabling declarative configuration of alert channels and rules that are seeded into the Bifrost config store at startup. This allows operators to define alerting behavior entirely through Helm without manual UI configuration.

Changes

  • Added bifrost.alerting to values.yaml with commented examples covering all supported channel types (Slack, Microsoft Teams, PagerDuty, generic webhook) and CEL-expression-based rules.
  • Added the full JSON schema for bifrost.alerting in values.schema.json, covering history_retention_days, webhook_network (allow_http, allow_private_network), channels[], and rules[] with required field validation and enum constraints.
  • Wired bifrost.alerting into the Helm template (_helpers.tpl) so it renders directly as the top-level alerting key in the generated config.
  • Documented the addition in the helm-v2.1.28 changelog and README.md.

Alert rules use CEL expressions evaluated against governance usage variables (e.g., budget_usage_percent, budget_spent, request_usage) and support scoping to virtual_key, team, or customer. Rules can optionally target a specific budget via target_type/target_id and support per-rule cooldown_seconds and notify_once_per_reset_cycle controls.

Type of change

  • Bug fix
  • Feature
  • Refactor
  • Documentation
  • Chore/CI

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • UI (React)
  • Docs

How to test

Deploy the Helm chart with an alerting block in your values.yaml and verify the rendered config contains the expected alerting top-level key:

helm template bifrost ./helm-charts/bifrost -f your-values.yaml | grep -A 50 '"alerting"'

Example minimal values.yaml snippet to test:

bifrost:
  alerting:
    history_retention_days: 365
    channels:
      - id: "slack-ops"
        name: "Ops Slack"
        type: slack
        enabled: true
        config:
          webhook_url: "env.SLACK_WEBHOOK_URL"
    rules:
      - id: "budget-80pct"
        name: "Budget 80% Alert"
        enabled: true
        scope_type: virtual_key
        scope_id: "vk-1"
        cel_expression: "budget_usage_percent >= 80"
        channel_ids: ["slack-ops"]

Validate schema enforcement by providing an invalid type value or omitting a required field and confirming helm lint rejects it.

Screenshots/Recordings

N/A

Breaking changes

  • Yes
  • No

Related issues

N/A

Security considerations

  • webhook_network.allow_http and allow_private_network default to false, preventing accidental exposure of internal services or plaintext webhook traffic. Operators must explicitly opt in to relax these restrictions.
  • Channel configs support env.* references for secrets (e.g., routing_key, webhook_url), avoiding hardcoded credentials in values.yaml.

Checklist

  • I read docs/contributing/README.md and followed the guidelines
  • I added/updated tests where appropriate
  • I updated documentation where needed
  • I verified builds succeed (Go and UI)
  • I verified the CI pipeline passes locally if applicable

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 42 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 5b84b6f1-f451-402a-a905-752e073163a1

📥 Commits

Reviewing files that changed from the base of the PR and between d11fdf2 and cd85c91.

📒 Files selected for processing (8)
  • docs/changelogs/helm-v2.1.27.mdx
  • docs/changelogs/helm-v2.1.28.mdx
  • docs/docs.json
  • helm-charts/bifrost/README.md
  • helm-charts/bifrost/templates/_helpers.tpl
  • helm-charts/bifrost/values.schema.json
  • helm-charts/bifrost/values.yaml
  • transports/config.schema.json
📝 Walkthrough

Walkthrough

The Helm chart adds declarative alerting values, schema validation for channels and rules, conditional rendering into Bifrost configuration, environment-variable credential support, and changelog documentation.

Changes

Declarative alerting configuration

Layer / File(s) Summary
Alerting values contract
helm-charts/bifrost/values.schema.json, helm-charts/bifrost/values.yaml
Defines retention, webhook network controls, channel types, channel-specific configuration requirements, and governance-scoped CEL rules.
Rendering and channel validation
helm-charts/bifrost/templates/_helpers.tpl, transports/config.schema.json, docs/changelogs/helm-v2.1.28.mdx, helm-charts/bifrost/README.md
Renders bifrost.alerting under alerting, validates literal or environment-variable channel destinations and credentials, and documents the configuration.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: akshaydeo, danpiths

Sequence Diagram(s)

sequenceDiagram
  participant HelmValues
  participant ValuesSchema
  participant HelmHelpers
  participant BifrostConfig
  participant TransportSchema
  HelmValues->>ValuesSchema: Validate alerting channels and rules
  ValuesSchema->>HelmHelpers: Pass validated alerting values
  HelmHelpers->>BifrostConfig: Render the alerting object
  BifrostConfig->>TransportSchema: Validate channel URLs and credentials
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the new bifrost.alerting Helm chart feature with declarative channels and CEL-based rules.
Description check ✅ Passed The PR description matches the template with summary, changes, test steps, type, affected areas, security, and checklist sections filled out.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 07-10-chore_add_alerting_to_helm

Comment @coderabbitai help to get the list of available commands.

BearTS commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

@BearTS BearTS force-pushed the 07-10-chore_add_alerting_to_helm branch from 3508986 to 79d9b67 Compare July 9, 2026 21:52
@BearTS BearTS force-pushed the 07-10-feat_new_calendar_alignment_additions branch from db41911 to 4bf0254 Compare July 9, 2026 21:52
@BearTS BearTS marked this pull request as ready for review July 9, 2026 21:53
@BearTS BearTS requested a review from a team as a code owner July 9, 2026 21:53
@BearTS BearTS changed the title chore: add alerting to helm feat: add bifrost.alerting to Helm chart with declarative channels and CEL-based rules Jul 9, 2026
@greptile-apps

greptile-apps Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 4/5

This should be fixed before merging.

  • Helm can still accept alerting channels that Bifrost rejects at startup.
  • Helm can still accept split alert rule targets that Bifrost rejects at startup.
  • The template passes alerting values through unchanged, so chart validation needs to catch these cases before render.

helm-charts/bifrost/values.schema.json

Important Files Changed

Filename Overview
helm-charts/bifrost/values.schema.json Adds the Helm schema for bifrost.alerting, but the chart-time checks for channel configs and target pairs can still miss invalid values.
helm-charts/bifrost/templates/_helpers.tpl Renders .Values.bifrost.alerting directly into the generated config.
transports/config.schema.json Updates the runtime config schema for alerting channel env references and alias fields.

Reviews (4): Last reviewed commit: "chore: add alerting to helm" | Re-trigger Greptile

Comment thread helm-charts/bifrost/values.schema.json
Comment thread helm-charts/bifrost/values.schema.json
@SahilChoudhary22 SahilChoudhary22 force-pushed the 07-10-chore_add_alerting_to_helm branch from 79d9b67 to bfef6d8 Compare July 9, 2026 22:37
@coderabbitai coderabbitai Bot requested review from akshaydeo and danpiths July 9, 2026 22:38
Comment thread helm-charts/bifrost/values.schema.json
Comment thread helm-charts/bifrost/values.schema.json

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@helm-charts/bifrost/values.schema.json`:
- Around line 3319-3333: Replace the alias-presence anyOf constraints with oneOf
so exactly one credential alias is required, preventing configurations from
specifying both aliases. Apply this consistently to the Slack, Teams, PagerDuty,
and generic webhook schemas in values.schema.json, including the corresponding
alias checks identified by the diff; mirror the same oneOf changes in the
transport schemas.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 99b62279-2e5e-4d56-83ee-46311980a41a

📥 Commits

Reviewing files that changed from the base of the PR and between 4bf0254 and bfef6d8.

📒 Files selected for processing (6)
  • docs/changelogs/helm-v2.1.28.mdx
  • helm-charts/bifrost/README.md
  • helm-charts/bifrost/templates/_helpers.tpl
  • helm-charts/bifrost/values.schema.json
  • helm-charts/bifrost/values.yaml
  • transports/config.schema.json

Comment thread helm-charts/bifrost/values.schema.json
@SahilChoudhary22 SahilChoudhary22 force-pushed the 07-10-chore_add_alerting_to_helm branch from bfef6d8 to d11fdf2 Compare July 9, 2026 22:46
@BearTS BearTS force-pushed the 07-10-chore_add_alerting_to_helm branch from d11fdf2 to cd85c91 Compare July 10, 2026 06:53
},
"required": ["id", "name", "type", "enabled"],
"allOf": [
{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Channel Config Bypasses The channel delivery settings are still required only through conditional schema branches. When a chart user defines a Slack, Teams, PagerDuty, or webhook channel with id, name, type, and enabled but omits config, Helm can accept and render the value directly into alerting. Bifrost then receives a channel without the delivery config required by the runtime config contract, so the deployment can render successfully and fail during startup validation. Please enforce these channel-specific requirements with validation that Helm reliably applies, or with template-time checks.

Rule Used: Do not suggest adding the "not" keyword (or other ... (source)

"target_id": { "type": "string", "description": "ID of the explicit target" }
},
"required": ["id", "name", "enabled", "scope_type", "scope_id", "cel_expression", "channel_ids"],
"allOf": [

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Target Pair Splits The target_type and target_id pair is still enforced only through conditional schema branches. A rule with only target_type: budget or only target_id can still be rendered into config.json, but the runtime alerting rule contract expects those fields to be present together. That can let Helm accept a chart that later fails Bifrost startup validation. Please enforce this pair with Helm-supported validation or a template-time check.

Rule Used: Do not suggest adding the "not" keyword (or other ... (source)

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