Skip to content

feat(formulas): Add dashboard filter for formulas - #132236

Open
wmak wants to merge 1 commit into
masterfrom
wmak/feat/dashboard-formula-filter
Open

wmak wants to merge 1 commit into
masterfrom
wmak/feat/dashboard-formula-filter

Conversation

@wmak

@wmak wmak commented Nov 23, 2026

Copy link
Copy Markdown
Member
  • This adds a formula filter to dashboards so we can list dashboards still using a formula before a delete
  • EXP-1447

- This adds a formula filter to dashboards so we can list dashboards
  still using a formula before a delete
@wmak
wmak requested review from a team as code owners November 23, 2026 20:12
@linear-code

linear-code Bot commented Nov 23, 2026

Copy link
Copy Markdown

EXP-1447

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 23, 2026

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using default effort 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.

Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 88cd5e8. Configure here.

if not formula.startswith(FORMULA_PREFIX):
raise ParseError(f"Formulas start with {FORMULA_PREFIX}")
escaped = re.escape(formula)
return rf'(^|[^\\]"|[[:space:]])(-)?{escaped}\([^")]*\)(:|"|$|[[:space:]])'

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.

Formula usage regex misses negated, grouped, equation uses

Medium Severity

The regex in saved_formula_regex only matches a formula call that comes right after the start of the text, a quote or whitespace, with an optional -. Dashboard widget queries use the formula in other ways too: negated conditions (!formula.x(...):>1), parenthesized groups ((formula.x(...):>1 OR ...)) and equation aggregates (equation|formula.x(...) * 2). None of these match, so those dashboards are left out of the pre-delete usage list.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 88cd5e8. Configure here.

This branch has not been deployed

No deployments
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