fix(ui): use name instead of id in workflow execution triggered-by alert CEL filter#6236
Open
ahbeigi wants to merge 1 commit intokeephq:mainfrom
Open
fix(ui): use name instead of id in workflow execution triggered-by alert CEL filter#6236ahbeigi wants to merge 1 commit intokeephq:mainfrom
ahbeigi wants to merge 1 commit intokeephq:mainfrom
Conversation
…ert CEL filter The triggered_by string for Prometheus/alert triggers encodes the alert name as the id value (e.g. 'type:alert name:JanusHighAudioJitter id:JanusHighAudioJitter'). The link was constructed using id=="<value>" as the CEL filter, but the backend maps the id field to the UUID column (lastalert.alert_id) and fails to cast the alert name string to a UUID, returning a 500 Internal Server Error. Fix: filter by name instead of id. The name field maps to a string column, carries the same value for Prometheus alert triggers, and is the correct semantic field to identify an alert by its rule name. Also adds a unit test for extractTriggerDetailsV2 covering the alert trigger parsing and the correct CEL filter construction.
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The triggered_by string for Prometheus/alert triggers encodes the alert name as the id value (e.g.
type:alert name:JanusHighAudioJitter id:JanusHighAudioJitter). The link was constructed usingid=="<value>"as the CEL filter, but the backend maps theidfield to the UUID column (lastalert.alert_id). PostgreSQL rejects the query when it receives a non-UUID string against a UUID-typed column — this exception is not caught by theOperationalErrorguard inquery_last_alerts, so it propagates to FastAPI's default error handler → 500.Fix: filter by
nameinstead ofid. Thenamefield maps to a string column via the wildcardDataType.STRINGconfiguration, carries the same value asidfor Prometheus alert triggers, and is the correct semantic field to identify an alert by its rule name.Also adds a unit test for
extractTriggerDetailsV2covering alert trigger parsing and the correct CEL filter construction, including a regression case documenting the broken form.Closes #6237
📑 Description
workflow-executions-table.tsx:id=="${details.id}"→name=="${details.name}"in the alert badgehrefui-utils.test.ts: new unit tests forextractTriggerDetailsV2✅ Checks
ℹ Additional Information
Before: clicking the "Triggered by" alert badge in Workflow Execution History returns
500 — An internal server error occurred. URL: /alerts/queryfor any workflow triggered by a Prometheus/Alertmanager alert.After: clicking the badge opens the Alerts Feed pre-filtered to
name=="<alert-name>"with no error.No breaking changes. No new dependencies.
Note
Low Risk
Small UI-only change to the alerts feed link plus new unit tests; no auth/data-write behavior changes, with low blast radius limited to filtering semantics.
Overview
Fixes the Workflow Execution History “Triggered by” alert badge link to build the Alerts Feed CEL query as
name=="<alert-name>"instead ofid==..., preventing 500s when the trigger’sidcontains a non-UUID alert name.Adds unit tests for
extractTriggerDetailsV2to cover alert/manual/interval/unknown parsing and a regression assertion documenting why the CEL filter must usedetails.name.Reviewed by Cursor Bugbot for commit d302e3e. Bugbot is set up for automated code reviews on this repo. Configure here.