-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
feat(crons): Add upsert guides to detector cron creation #104353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(crons): Add upsert guides to detector cron creation #104353
Conversation
3c6a1ca to
ff34433
Compare
❌ 2 Tests Failed:
View the top 2 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
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)
ff34433 to
997f912
Compare
| return { | ||
| pathname: baseUrl, | ||
| query: { | ||
| detectorType: 'monitor_check_in_failure', | ||
| project: defaultProject?.id ?? '', | ||
| platform, | ||
| guide, | ||
| }, | ||
| }; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
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)
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