Skip to content

Conversation

@scttcper
Copy link
Member

@scttcper scttcper commented Nov 7, 2025

adds a template dropdown and moves customize section into a collapsible component

overall feel of the form after these changes

image

template options

image

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 7, 2025
@codecov
Copy link

codecov bot commented Nov 7, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
12410 1 12409 10
View the top 1 failed test(s) by shortest run time
BalanceChangeAction re-enables form after error
Stack Traces | 1.13s run time
Error: expect(element).toHaveValue(10)

Expected the element to have value:
  10
Received:
  null

Ignored nodes: comments, script, style
...
    at toHaveValue (.../gsAdmin/components/changeBalanceAction.spec.tsx:184:45)
    at runWithExpensiveErrorDiagnosticsDisabled (.../sentry/node_modules/.pnpm/@[email protected]/node_modules/@.../dom/dist/config.js:47:12)
    at checkCallback (.../sentry/node_modules/.pnpm/@[email protected]/node_modules/@.../dom/dist/wait-for.js:124:77)
    at checkRealTimersCallback (.../sentry/node_modules/.pnpm/@[email protected]/node_modules/@.../dom/dist/wait-for.js:118:16)
    at Timeout.task [as _onTimeout] (.../sentry/node_modules/.pnpm/[email protected]..../jsdom/browser/Window.js:579:19)
    at listOnTimeout (node:internal/timers:588:17)
    at processTimers (node:internal/timers:523:7)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@scttcper scttcper marked this pull request as ready for review November 7, 2025 23:00
@scttcper scttcper requested a review from a team as a code owner November 7, 2025 23:00
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.

Bug: Default Value Mismatch Breaks UI

The defaultValue is set to "automatic" but the valid values for resolutionStrategy are 'default' and 'custom'. This will cause the radio field to have an invalid default value that doesn't match any of the available options.

static/app/views/detectors/components/forms/metric/resolveSection.tsx#L133-L134

choices={resolutionStrategyChoices}
defaultValue="automatic"

Fix in Cursor Fix in Web


// Only set query if template has one and user hasn't customized the filter
if (meta.query !== undefined && !currentQuery) {
formContext.form?.setValue(METRIC_DETECTOR_FORM_FIELDS.query, meta.query);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: Template Query Logic Prevents Updates

When switching between templates that both have queries, the query won't update because !currentQuery evaluates to false. After selecting a template with a query, switching to another template with a different query won't apply the new query value since currentQuery is now truthy from the first template.

Fix in Cursor Fix in Web

@semgrep-code-getsentry
Copy link

Semgrep found 1 ssc-aecabbe1-e60d-9dc0-a5bd-95001ace2360 finding:

Risk: Affected versions of Django are vulnerable to Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). SQL injection in Django's ORM column aliases: when using QuerySet.annotate(), QuerySet.alias(), QuerySet.aggregate(), or QuerySet.extra() with dictionary expansion (**kwargs), the dictionary keys are used unescaped as SQL column aliases. On MySQL and MariaDB backends, an attacker who can influence those keys (for example, by passing a crafted dict of annotations) can inject arbitrary SQL into the generated query.

Manual Review Advice: A vulnerability from this advisory is reachable if you are using Django with MySQL or MariaDB

Fix: Upgrade this library to at least version 5.2.7 at sentry/uv.lock:305.

Reference(s): GHSA-hpr9-3m2g-3j9p, CVE-2025-59681

@scttcper scttcper merged commit 32f8d80 into master Nov 11, 2025
60 of 64 checks passed
@scttcper scttcper deleted the scttcper/metric-template-dropdown branch November 11, 2025 00:22
Jesse-Box pushed a commit that referenced this pull request Nov 12, 2025
adds a template dropdown and moves customize section into a collapsible
component
andrewshie-sentry pushed a commit that referenced this pull request Nov 13, 2025
adds a template dropdown and moves customize section into a collapsible
component
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants