Skip to content

feat(cymbal): apply severity rules on issue creation - #86270

Merged
trunk-io[bot] merged 5 commits into
masterfrom
hp/error-tracking-severity-rules-03-linking
Aug 24, 2026
Merged

trunk-io[bot] merged 5 commits into
masterfrom
hp/error-tracking-severity-rules-03-linking

Conversation

@hpouillot

@hpouillot hpouillot commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Configured severity rules must affect only the event that wins new issue creation. Existing, reopened, and manually triaged issues must remain unchanged.

Changes

  • Evaluates rules only after winning fingerprint creation inside the issue transaction.
  • Lets the first matching rule override built-in inference; no match preserves inference.
  • Updates the persisted and in-memory issue before assignment and state publication.
  • Carries final severity into fingerprint state and issue-created notification snapshots.
  • Never reevaluates rules for existing or reopened issues.

Before

flowchart LR
    A[Exception event] --> B[Link or create issue]
    B --> C[Infer severity]
    C --> D[Persist issue]
    style A fill:#1D4AFF,color:#fff
    style D fill:#F9BD2B,color:#000
Loading

After

flowchart LR
    A[Exception event] --> B{Wins issue creation?}
    B -- No --> C[Keep existing severity]
    B -- Yes --> D[Infer fallback severity]
    D --> E[Evaluate ordered rules]
    E --> F[Persist final severity]
    F --> G[Publish state and notification]
    style A fill:#1D4AFF,color:#fff
    style C fill:#F9BD2B,color:#000
    style G fill:#F9BD2B,color:#000
Loading

PR stack

Merge in this order:

  1. feat(error-tracking): add severity rules API #86267
  2. feat(cymbal): evaluate error tracking severity rules #86268
  3. feat(cymbal): apply severity rules on issue creation #86270 — this PR
  4. feat(error-tracking): add severity rules settings #86271

Depends on: #86268
Followed by: #86271

This PR is based on hp/error-tracking-severity-rules-02-evaluator; review only changes relative to that branch. After its parent is squash-merged, replay only this PR's unique commit onto the rewritten parent and force-push with lease before retargeting.

How did you test this code?

  • cargo fmt --check
  • cargo test -p cymbal --test event severity_rule_
  • cargo check -p cymbal

The event tests cover rule override, inference fallback, and preservation of later manual severity changes. The state/notification payload test passed during full-tree validation; its post-rebase rerun was blocked by an unavailable local SQLx setup database.

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Automatic notifications

  • Publish to changelog?

Docs update

None in this runtime integration layer.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Implemented with pi coding agent. Repo guidance and the OpenSpec apply, Rust testing, and stacked PR skills shaped the implementation and split. Applying the rule after fingerprint ownership avoids races and prevents retroactive severity changes.

@github-actions

github-actions Bot commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

🤖 CI report

⚠️ Trunk lane — backend Python lane

This PR is assigned to the backend Python lane. It runs backend Python tests and may merge in parallel with PRs in other lanes.

⚠️ Backend coverage — 97.0% of changed backend lines covered — 1 uncovered

🧪 Backend test coverage

Patch coverage — changed backend lines (products + core): ███████████████████░ 97.0% (34 / 35)

File Patch Uncovered changed lines
products/error_tracking/backend/presentation/views/severity_rules.py 50.0% 136

🤖 Agents: add a test covering the lines above, or note why under "How did you test this code?". Machine-readable gap list: the patch-coverage artifact on this run (gh run download 32718824274 -n patch-coverage), or the coverage-data block at the end of this comment.

Per-product line coverage (touched products)
Product Coverage Lines
demo ███████████░░░░░░░░░ 56.9% 1,516 / 2,666
tasks ██████████████░░░░░░ 70.9% 44,003 / 62,103
signals █████████████████░░░ 83.3% 29,345 / 35,216
actions █████████████████░░░ 86.6% 717 / 828
data_modeling █████████████████░░░ 86.9% 9,644 / 11,092
notebooks █████████████████░░░ 87.2% 8,553 / 9,812
cdp █████████████████░░░ 87.4% 4,522 / 5,174
cohorts █████████████████░░░ 87.5% 6,550 / 7,486
product_tours ██████████████████░░ 87.9% 1,303 / 1,482
data_warehouse ██████████████████░░ 89.1% 12,631 / 14,177
dashboards ██████████████████░░ 89.2% 6,392 / 7,165
exports ██████████████████░░ 89.3% 7,701 / 8,626
engineering_analytics ██████████████████░░ 89.5% 6,828 / 7,632
alerts ██████████████████░░ 90.4% 4,707 / 5,209
mcp_analytics ██████████████████░░ 90.5% 4,001 / 4,421
streamlit_apps ██████████████████░░ 90.7% 2,630 / 2,901
managed_warehouse ██████████████████░░ 90.7% 8,555 / 9,427
conversations ██████████████████░░ 90.8% 20,468 / 22,531
error_tracking ██████████████████░░ 91.3% 11,991 / 13,127
stamphog ██████████████████░░ 91.6% 5,399 / 5,892
canvas ██████████████████░░ 92.5% 4,469 / 4,833
early_access_features ███████████████████░ 92.5% 1,323 / 1,430
slack_app ███████████████████░ 92.5% 12,113 / 13,090
context_layer ███████████████████░ 92.7% 2,285 / 2,464
web_analytics ███████████████████░ 92.8% 17,033 / 18,360
surveys ███████████████████░ 93.3% 5,943 / 6,373
marketing_analytics ███████████████████░ 93.4% 16,881 / 18,081
reminders ███████████████████░ 93.4% 468 / 501
posthog_ai ███████████████████░ 93.5% 1,371 / 1,467
approvals ███████████████████░ 93.5% 3,491 / 3,734
ai_observability ███████████████████░ 93.5% 17,411 / 18,618
product_analytics ███████████████████░ 93.7% 7,331 / 7,827
billing_alerts ███████████████████░ 93.9% 2,047 / 2,181
workflows ███████████████████░ 94.2% 9,590 / 10,184
endpoints ███████████████████░ 94.3% 8,814 / 9,349
review_hog ███████████████████░ 94.3% 9,969 / 10,570
annotations ███████████████████░ 95.1% 734 / 772
skills ███████████████████░ 95.2% 4,698 / 4,935
customer_analytics ███████████████████░ 95.4% 15,213 / 15,940
experiments ███████████████████░ 95.5% 29,169 / 30,539
logs ███████████████████░ 95.7% 13,002 / 13,581
replay_vision ███████████████████░ 95.8% 22,750 / 23,750
feature_flags ███████████████████░ 96.1% 19,113 / 19,895
revenue_analytics ███████████████████░ 96.3% 1,841 / 1,911
user_interviews ███████████████████░ 96.5% 2,639 / 2,735
data_quality ███████████████████░ 96.5% 2,692 / 2,789
warehouse_sources ████████████████████ 97.6% 425,719 / 436,109
data_catalog ████████████████████ 98.2% 3,181 / 3,240
pulse ████████████████████ 98.4% 2,017 / 2,049

Report-only. Patch coverage = changed backend lines covered vs origin/master. Sorted lowest first.
Known gaps: lines covered only by Temporal tests show as uncovered; core line numbers may drift if master changed the same file.

@hpouillot
hpouillot force-pushed the hp/error-tracking-severity-rules-02-evaluator branch from 06cfaae to 6ac019e Compare August 20, 2026 10:22
@hpouillot
hpouillot force-pushed the hp/error-tracking-severity-rules-03-linking branch from ae6a732 to 58b1eb1 Compare August 20, 2026 10:22
@hpouillot
hpouillot force-pushed the hp/error-tracking-severity-rules-02-evaluator branch from 6ac019e to 18c7e3a Compare August 20, 2026 10:30
@hpouillot
hpouillot force-pushed the hp/error-tracking-severity-rules-03-linking branch from 58b1eb1 to 8387b53 Compare August 20, 2026 10:30
@hpouillot
hpouillot force-pushed the hp/error-tracking-severity-rules-02-evaluator branch from 18c7e3a to c381c72 Compare August 20, 2026 10:57
@hpouillot
hpouillot force-pushed the hp/error-tracking-severity-rules-03-linking branch from 8387b53 to 1983f2c Compare August 20, 2026 10:57
@trunk-io

trunk-io Bot commented Aug 20, 2026 •

Copy link
Copy Markdown

Static Badge   Static Badge   Static Badge

View Full Report ↗︎ ⋅ Docs

@hpouillot
hpouillot force-pushed the hp/error-tracking-severity-rules-02-evaluator branch from c381c72 to 8b099dd Compare August 20, 2026 14:06
@hpouillot
hpouillot force-pushed the hp/error-tracking-severity-rules-03-linking branch from 1983f2c to a2c9391 Compare August 20, 2026 14:06
@hpouillot
hpouillot marked this pull request as ready for review August 24, 2026 09:15
@greptile-apps

greptile-apps Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "feat(cymbal): apply severity rules on is..." | Re-trigger Greptile

@veria-ai

veria-ai Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

PR overview

All previously flagged issues have been addressed. No open security concerns remain on this pull request.

Security review

No open security issues remain on this pull request.

Fixed/addressed: 1 · PR risk: 0/10

Base automatically changed from hp/error-tracking-severity-rules-02-evaluator to master August 24, 2026 09:30
@trunk-io

trunk-io Bot commented Aug 24, 2026 •

Copy link
Copy Markdown

😎 Merged successfully - details.

Limit severity rules and bytecode at the API boundary and cap the rules and HogVM steps evaluated for each new issue. This prevents unbounded work from large per-project rule sets while preserving ordered first-match behavior.

Generated-By: PostHog Desktop
Task-Id: 275f3b86-1ef7-43be-821a-e05e2db0a86d
@trunk-io
trunk-io Bot merged commit 48fe15c into master Aug 24, 2026
270 checks passed
@trunk-io
trunk-io Bot deleted the hp/error-tracking-severity-rules-03-linking branch August 24, 2026 12:19
@deployment-status-posthog

deployment-status-posthog Bot commented Aug 24, 2026 •

Copy link
Copy Markdown

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-08-24 13:19 UTC Run
prod-us ✅ Deployed 2026-08-24 16:10 UTC Run
prod-eu ✅ Deployed 2026-08-24 23:15 UTC Run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-inkeep-docs Use this label to skip an Inkeep docs PR in posthog.com

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants