Skip to content

fix(alerts): Return 400 when trigger IDs don't belong to the alert rule being updated#115573

Merged
kcons merged 1 commit into
masterfrom
kcons/triggerhappy
May 14, 2026
Merged

fix(alerts): Return 400 when trigger IDs don't belong to the alert rule being updated#115573
kcons merged 1 commit into
masterfrom
kcons/triggerhappy

Conversation

@kcons
Copy link
Copy Markdown
Member

@kcons kcons commented May 14, 2026

It's deprecated code, but it'll be around for months yet, so better to fail more helpfully if we can.

Fixes SENTRY-5NJ6

@kcons kcons requested a review from ceorourke May 14, 2026 17:26
@kcons kcons requested a review from a team as a code owner May 14, 2026 17:26
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label May 14, 2026
missing_ids = [tid for tid in trigger_ids if tid not in existing_trigger_ids]
if missing_ids:
raise serializers.ValidationError(
f"Trigger IDs do not belong to this alert rule: {missing_ids}"
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.

super nit: this error message would scare me quite a lot if i were a user; wonder if it could be something like Alert Trigger IDs are not valid: {missing_ids} -- the whole not belonging makes it feel like there could be a security problem or something.

@kcons kcons merged commit 63647db into master May 14, 2026
63 checks passed
@kcons kcons deleted the kcons/triggerhappy branch May 14, 2026 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants