Skip to content

feat(ACI): Make rule stats and group history endpoints backwards compatible#111159

Merged
ceorourke merged 10 commits intomasterfrom
ceorourke/ISWF-2190-2
Mar 20, 2026
Merged

feat(ACI): Make rule stats and group history endpoints backwards compatible#111159
ceorourke merged 10 commits intomasterfrom
ceorourke/ISWF-2190-2

Conversation

@ceorourke
Copy link
Member

@ceorourke ceorourke commented Mar 19, 2026

Redo of #110282 to make the rule stats and group history endpoints backwards compatible by being flexible enough to handle either a Rule or a Workflow. The previous PR was reverted because I incorrectly assumed Rule objects were using RuleFireHistory, but it is correct to continue to combine those results with WorkflowFireHistory for now.

For both methods the basic logic is as follows:

  • If passed a workflow, try to fetch the rule ID via AlertRuleWorkflow and fetch combined results. If the workflow was single written, fetch WorkflowFireHistory results only.
  • If passed a rule, try to fetch the workflow via AlertRuleWorkflow and fetch combined results. If the rule for some reason doesn't have a workflow, fetch RuleFireHistory results only (this maintains the existing behavior).

@ceorourke ceorourke requested review from a team as code owners March 19, 2026 21:51
@linear-code
Copy link

linear-code bot commented Mar 19, 2026

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Mar 19, 2026
@ceorourke ceorourke requested a review from a team March 19, 2026 21:52
Copy link
Member

@kcons kcons left a comment

Choose a reason for hiding this comment

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

LG, haven't dug too far into the test coverage though.
I don't think it'd be crazy to use a single query that still supports Rules; if we're not passing an ID, it's a no-op, and it's easy enough to adjust the query once we don't want to mention Rules ever again.

Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

@ceorourke ceorourke merged commit a9ad6ad into master Mar 20, 2026
63 checks passed
@ceorourke ceorourke deleted the ceorourke/ISWF-2190-2 branch March 20, 2026 20:32
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