Skip to content

Conversation

@evanpurkhiser
Copy link
Member

Implements a two-step creation flow for cron monitors that allows users to choose between auto-instrumentation with platform-specific guides or manual monitor configuration.

When users select a platform (Python, PHP, Node, etc.) from the empty state, they see instrumentation guides with a "Back to Manual Creation" button. The standard form sections are hidden while viewing guides to reduce cognitive load and guide users through the auto-instrumentation process.

Users can also explicitly choose "Manual Setup" which bypasses platform detection and shows the full configuration form immediately. This is useful when users want direct access to all monitor settings without going through the guided flow.

The implementation uses query parameters (platform, guide, skipGuideDetection) to manage state and allow users to navigate back and forth between guided and manual creation modes.

Adds comprehensive test coverage for form visibility, footer behavior, empty state UI, and platform detection logic.

Fixes NEW-589: Cron monitors should have 3 steps for creation, step 2 suggestions using Upsert flow

@evanpurkhiser evanpurkhiser requested review from a team as code owners December 3, 2025 22:12
@linear
Copy link

linear bot commented Dec 3, 2025

@evanpurkhiser evanpurkhiser requested review from a team, malwilley and scttcper and removed request for a team December 3, 2025 22:12
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Dec 3, 2025
@evanpurkhiser evanpurkhiser force-pushed the evanpurkhiser/feat-crons-add-upsert-guides-to-detector-cron-creation branch from 3c6a1ca to ff34433 Compare December 3, 2025 23:44
@codecov
Copy link

codecov bot commented Dec 3, 2025

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
12796 2 12794 10
View the top 2 failed test(s) by shortest run time
InstrumentationGuide clears guide when clicking "Manually create a Monitor"
Stack Traces | 0.459s run time
TestingLibraryElementError: Unable to find an accessible element with the role "button" and name "Manually create a Monitor"

Here are the accessible roles:

  heading:

  Name "Select Instrumentation Method":
  ...

  Name "Auto-Instrument with PHP":
  ...

  --------------------------------------------------
  presentation:

  Name "":
  ...

  Name "":
  ...

  Name "":
  ...

  Name "":
  ...

  Name "":
  ...

  --------------------------------------------------
  button:

  Name "PHP - Upsert":
  ...

  Name "Manually Create a Monitor":
  ...

  Name "Copy snippet":
  ...

  Name "Copy snippet":
  ...

  --------------------------------------------------
  img:

  Name "":
  ...

  Name "":
  ...

  Name "":
  ...

  Name "":
  ...

  --------------------------------------------------
  link:

  Name "PHP SDK":
  ...

  --------------------------------------------------
  code:

  Name "":
  ...

  Name "":
  ...

  --------------------------------------------------

Ignored nodes: comments, script, style
...
    at Object.getElementError (.../sentry/node_modules/.pnpm/@testing-library+dom@10.4.0/node_modules/@.../dom/dist/config.js:37:19)
    at .../sentry/node_modules/.pnpm/@testing-library+dom@10.4.0/node_modules/@.../dom/dist/query-helpers.js:76:38
    at .../sentry/node_modules/.pnpm/@testing-library+dom@10.4.0/node_modules/@.../dom/dist/query-helpers.js:52:17
    at .../sentry/node_modules/.pnpm/@testing-library+dom@10.4.0/node_modules/@.../dom/dist/query-helpers.js:95:19
    at Object.getByRole (.../forms/cron/instrumentationGuide.spec.tsx:101:33)
InstrumentationGuide shows guide content after selecting a platform
Stack Traces | 0.52s run time
TestingLibraryElementError: Unable to find an accessible element with the role "button" and name "Manually create a Monitor"

Here are the accessible roles:

  heading:

  Name "Select Instrumentation Method":
  ...

  Name "Auto-Instrument with PHP":
  ...

  --------------------------------------------------
  presentation:

  Name "":
  ...

  Name "":
  ...

  Name "":
  ...

  Name "":
  ...

  Name "":
  ...

  --------------------------------------------------
  button:

  Name "PHP - Upsert":
  ...

  Name "Manually Create a Monitor":
  ...

  Name "Copy snippet":
  ...

  Name "Copy snippet":
  ...

  --------------------------------------------------
  img:

  Name "":
  ...

  Name "":
  ...

  Name "":
  ...

  Name "":
  ...

  --------------------------------------------------
  link:

  Name "PHP SDK":
  ...

  --------------------------------------------------
  code:

  Name "":
  ...

  Name "":
  ...

  --------------------------------------------------

Ignored nodes: comments, script, style
...
    at Object.getElementError (.../sentry/node_modules/.pnpm/@testing-library+dom@10.4.0/node_modules/@.../dom/dist/config.js:37:19)
    at .../sentry/node_modules/.pnpm/@testing-library+dom@10.4.0/node_modules/@.../dom/dist/query-helpers.js:76:38
    at .../sentry/node_modules/.pnpm/@testing-library+dom@10.4.0/node_modules/@.../dom/dist/query-helpers.js:52:17
    at .../sentry/node_modules/.pnpm/@testing-library+dom@10.4.0/node_modules/@.../dom/dist/query-helpers.js:95:19
    at Object.getByRole (.../forms/cron/instrumentationGuide.spec.tsx:83:14)

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

Implements a two-step creation flow for cron monitors that allows users
to choose between auto-instrumentation with platform-specific guides or
manual monitor configuration.

When users select a platform (Python, PHP, Node, etc.) from the empty
state, they see instrumentation guides with a "Back to Manual Creation"
button. The standard form sections are hidden while viewing guides to
reduce cognitive load and guide users through the auto-instrumentation
process.

Users can also explicitly choose "Manual Setup" which bypasses platform
detection and shows the full configuration form immediately. This is
useful when users want direct access to all monitor settings without
going through the guided flow.

The implementation uses query parameters (platform, guide,
skipGuideDetection) to manage state and allow users to navigate back and
forth between guided and manual creation modes.

Adds comprehensive test coverage for form visibility, footer behavior,
empty state UI, and platform detection logic.

Fixes [NEW-589: Cron monitors should have 3 steps for creation, step 2 suggestions using Upsert flow](https://linear.app/getsentry/issue/NEW-589/cron-monitors-should-have-3-steps-for-creation-step-2-suggestions)
@evanpurkhiser evanpurkhiser force-pushed the evanpurkhiser/feat-crons-add-upsert-guides-to-detector-cron-creation branch from ff34433 to 997f912 Compare December 3, 2025 23:52
Comment on lines +146 to +154
return {
pathname: baseUrl,
query: {
detectorType: 'monitor_check_in_failure',
project: defaultProject?.id ?? '',
platform,
guide,
},
};
Copy link

Choose a reason for hiding this comment

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

Bug: LinkButton to objects use query property, which React Router v6 ignores, causing URL parameters to be dropped.
Severity: CRITICAL | Confidence: High

🔍 Detailed Analysis

Query parameters such as platform, guide, detectorType, and project are dropped during navigation when using LinkButton. This occurs because the to prop is provided as a LocationDescriptor object containing a query property. React Router v6's Link component, which LinkButton ultimately uses, silently ignores the query property and expects search instead. This prevents the useCronsUpsertGuideState hook from reading the necessary parameters, breaking the guided creation flow.

💡 Suggested Fix

Modify the LocationDescriptor objects passed to the LinkButton's to prop. Replace the query property with search and format its value as a URL-encoded string.

🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: static/app/views/detectors/list/cron.tsx#L146-L154

Potential issue: Query parameters such as `platform`, `guide`, `detectorType`, and
`project` are dropped during navigation when using `LinkButton`. This occurs because the
`to` prop is provided as a `LocationDescriptor` object containing a `query` property.
React Router v6's `Link` component, which `LinkButton` ultimately uses, silently ignores
the `query` property and expects `search` instead. This prevents the
`useCronsUpsertGuideState` hook from reading the necessary parameters, breaking the
guided creation flow.

Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 5343904

Copy link
Member Author

Choose a reason for hiding this comment

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

It’s not seeing our shim

@evanpurkhiser evanpurkhiser merged commit b227173 into master Dec 4, 2025
48 checks passed
@evanpurkhiser evanpurkhiser deleted the evanpurkhiser/feat-crons-add-upsert-guides-to-detector-cron-creation branch December 4, 2025 03:44
mtopo27 pushed a commit that referenced this pull request Dec 8, 2025
Implements a two-step creation flow for cron monitors that allows users
to choose between auto-instrumentation with platform-specific guides or
manual monitor configuration.

When users select a platform (Python, PHP, Node, etc.) from the empty
state, they see instrumentation guides with a "Back to Manual Creation"
button. The standard form sections are hidden while viewing guides to
reduce cognitive load and guide users through the auto-instrumentation
process.

Users can also explicitly choose "Manual Setup" which bypasses platform
detection and shows the full configuration form immediately. This is
useful when users want direct access to all monitor settings without
going through the guided flow.

The implementation uses query parameters (platform, guide,
skipGuideDetection) to manage state and allow users to navigate back and
forth between guided and manual creation modes.

Adds comprehensive test coverage for form visibility, footer behavior,
empty state UI, and platform detection logic.

Fixes [NEW-589: Cron monitors should have 3 steps for creation, step 2
suggestions using Upsert
flow](https://linear.app/getsentry/issue/NEW-589/cron-monitors-should-have-3-steps-for-creation-step-2-suggestions)
@github-actions github-actions bot locked and limited conversation to collaborators Dec 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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