Skip to content

Commit

Permalink
fix(onboarding) conditionally show minimum version for profiling noti…
Browse files Browse the repository at this point in the history
…ce for all python packages (#76806)

Conditionally show information about minimal version of SDK needed for
profiling at the beginning of the onboarding. information should be
shown only if the user has opened onboarding docs inside a profile page,
while it should be hidden on issues page.

We are showing that info to the user before they could even realise what
is profiling, and since they have just installed the latest version,
there is no need to mention info about minimum version at this place.

Example how it used to look for one of the python's framworks:

![image](https://github.com/user-attachments/assets/856522f1-4ff2-4283-9b02-dd60d693596a)

Closes #76804

---------

Signed-off-by: Vjeran Grozdanic <[email protected]>
  • Loading branch information
vgrozdanic authored Sep 2, 2024
1 parent 79cef72 commit e8bc002
Show file tree
Hide file tree
Showing 20 changed files with 287 additions and 227 deletions.
8 changes: 8 additions & 0 deletions static/app/components/onboarding/gettingStartedDoc/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ export type SelectedPlatformOptions<
[key in keyof PlatformOptions]: PlatformOptions[key]['items'][number]['value'];
};

export enum DocsPageLocation {
PROFILING_PAGE = 1,
}

export interface DocsParams<
PlatformOptions extends BasePlatformOptions = BasePlatformOptions,
> {
Expand All @@ -48,6 +52,10 @@ export interface DocsParams<
projectId: Project['id'];
projectSlug: Project['slug'];
sourcePackageRegistries: {isLoading: boolean; data?: ReleaseRegistrySdk};
/**
* The page where the docs are being displayed
*/
docsLocation?: DocsPageLocation;
feedbackOptions?: {
email?: boolean;
name?: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ import IdBadge from 'sentry/components/idBadge';
import LoadingError from 'sentry/components/loadingError';
import LoadingIndicator from 'sentry/components/loadingIndicator';
import {Step} from 'sentry/components/onboarding/gettingStartedDoc/step';
import type {DocsParams} from 'sentry/components/onboarding/gettingStartedDoc/types';
import {
DocsPageLocation,
type DocsParams,
} from 'sentry/components/onboarding/gettingStartedDoc/types';
import {useLoadGettingStarted} from 'sentry/components/onboarding/gettingStartedDoc/utils/useLoadGettingStarted';
import {ProductSolution} from 'sentry/components/onboarding/productSelection';
import {TaskSidebar} from 'sentry/components/sidebar/taskSidebar';
Expand Down Expand Up @@ -275,6 +278,10 @@ function ProfilingOnboardingContent(props: ProfilingOnboardingContentProps) {
platformOptions: PROFILING_ONBOARDING_STEPS,
newOrg: false,
feedbackOptions: {},
/**
* Page where the docs will be rendered
*/
docsLocation: DocsPageLocation.PROFILING_PAGE,
};

const steps = [
Expand Down
28 changes: 15 additions & 13 deletions static/app/gettingStartedDocs/python/aiohttp.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import ExternalLink from 'sentry/components/links/externalLink';
import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/step';
import type {
Docs,
DocsParams,
OnboardingConfig,
import {
type Docs,
DocsPageLocation,
type DocsParams,
type OnboardingConfig,
} from 'sentry/components/onboarding/gettingStartedDoc/types';
import {getPythonMetricsOnboarding} from 'sentry/components/onboarding/gettingStartedDoc/utils/metricsOnboarding';
import replayOnboardingJsLoader from 'sentry/gettingStartedDocs/javascript/jsLoader/jsLoader';
Expand Down Expand Up @@ -55,15 +56,16 @@ const onboarding: OnboardingConfig = {
}),
configurations: [
{
description: params.isProfilingSelected
? tct(
'You need a minimum version [codeVersion:1.18.0] of the [codePackage:sentry-python] SDK for the profiling feature.',
{
codeVersion: <code />,
codePackage: <code />,
}
)
: undefined,
description:
params.docsLocation === DocsPageLocation.PROFILING_PAGE
? tct(
'You need a minimum version [codeVersion:1.18.0] of the [codePackage:sentry-python] SDK for the profiling feature.',
{
codeVersion: <code />,
codePackage: <code />,
}
)
: undefined,
language: 'bash',
code: getInstallSnippet(),
},
Expand Down
28 changes: 15 additions & 13 deletions static/app/gettingStartedDocs/python/asgi.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import ExternalLink from 'sentry/components/links/externalLink';
import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/step';
import type {
Docs,
DocsParams,
OnboardingConfig,
import {
type Docs,
DocsPageLocation,
type DocsParams,
type OnboardingConfig,
} from 'sentry/components/onboarding/gettingStartedDoc/types';
import {getPythonMetricsOnboarding} from 'sentry/components/onboarding/gettingStartedDoc/utils/metricsOnboarding';
import {crashReportOnboardingPython} from 'sentry/gettingStartedDocs/python/python';
Expand Down Expand Up @@ -81,15 +82,16 @@ const onboarding: OnboardingConfig = {
}),
configurations: [
{
description: params.isProfilingSelected
? tct(
'You need a minimum version [codeVersion:1.18.0] of the [codePackage:sentry-python] SDK for the profiling feature.',
{
codeVersion: <code />,
codePackage: <code />,
}
)
: undefined,
description:
params.docsLocation === DocsPageLocation.PROFILING_PAGE
? tct(
'You need a minimum version [codeVersion:1.18.0] of the [codePackage:sentry-python] SDK for the profiling feature.',
{
codeVersion: <code />,
codePackage: <code />,
}
)
: undefined,
language: 'bash',
code: getInstallSnippet(),
},
Expand Down
28 changes: 15 additions & 13 deletions static/app/gettingStartedDocs/python/awslambda.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import styled from '@emotion/styled';
import Alert from 'sentry/components/alert';
import ExternalLink from 'sentry/components/links/externalLink';
import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/step';
import type {
Docs,
DocsParams,
OnboardingConfig,
import {
type Docs,
DocsPageLocation,
type DocsParams,
type OnboardingConfig,
} from 'sentry/components/onboarding/gettingStartedDoc/types';
import {getPythonMetricsOnboarding} from 'sentry/components/onboarding/gettingStartedDoc/utils/metricsOnboarding';
import {crashReportOnboardingPython} from 'sentry/gettingStartedDocs/python/python';
Expand Down Expand Up @@ -68,15 +69,16 @@ const onboarding: OnboardingConfig = {
description: tct('Install our Python SDK using [code:pip]:', {code: <code />}),
configurations: [
{
description: params.isProfilingSelected
? tct(
'You need a minimum version [codeVersion:1.18.0] of the [codePackage:sentry-python] SDK for the profiling feature.',
{
codeVersion: <code />,
codePackage: <code />,
}
)
: undefined,
description:
params.docsLocation === DocsPageLocation.PROFILING_PAGE
? tct(
'You need a minimum version [codeVersion:1.18.0] of the [codePackage:sentry-python] SDK for the profiling feature.',
{
codeVersion: <code />,
codePackage: <code />,
}
)
: undefined,
language: 'bash',
code: getInstallSnippet(),
},
Expand Down
28 changes: 15 additions & 13 deletions static/app/gettingStartedDocs/python/bottle.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import ExternalLink from 'sentry/components/links/externalLink';
import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/step';
import type {
Docs,
DocsParams,
OnboardingConfig,
import {
type Docs,
DocsPageLocation,
type DocsParams,
type OnboardingConfig,
} from 'sentry/components/onboarding/gettingStartedDoc/types';
import {getPythonMetricsOnboarding} from 'sentry/components/onboarding/gettingStartedDoc/utils/metricsOnboarding';
import replayOnboardingJsLoader from 'sentry/gettingStartedDocs/javascript/jsLoader/jsLoader';
Expand Down Expand Up @@ -54,15 +55,16 @@ const onboarding: OnboardingConfig = {
),
configurations: [
{
description: params.isProfilingSelected
? tct(
'You need a minimum version [codeVersion:1.18.0] of the [codePackage:sentry-python] SDK for the profiling feature.',
{
codeVersion: <code />,
codePackage: <code />,
}
)
: undefined,
description:
params.docsLocation === DocsPageLocation.PROFILING_PAGE
? tct(
'You need a minimum version [codeVersion:1.18.0] of the [codePackage:sentry-python] SDK for the profiling feature.',
{
codeVersion: <code />,
codePackage: <code />,
}
)
: undefined,
language: 'bash',
code: getInstallSnippet(),
},
Expand Down
28 changes: 15 additions & 13 deletions static/app/gettingStartedDocs/python/celery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import Alert from 'sentry/components/alert';
import {CodeSnippet} from 'sentry/components/codeSnippet';
import ExternalLink from 'sentry/components/links/externalLink';
import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/step';
import type {
Docs,
DocsParams,
OnboardingConfig,
import {
type Docs,
DocsPageLocation,
type DocsParams,
type OnboardingConfig,
} from 'sentry/components/onboarding/gettingStartedDoc/types';
import {getPythonMetricsOnboarding} from 'sentry/components/onboarding/gettingStartedDoc/utils/metricsOnboarding';
import {crashReportOnboardingPython} from 'sentry/gettingStartedDocs/python/python';
Expand Down Expand Up @@ -57,15 +58,16 @@ const onboarding: OnboardingConfig = {
),
configurations: [
{
description: params.isProfilingSelected
? tct(
'You need a minimum version [codeVersion:1.18.0] of the [codePackage:sentry-python] SDK for the profiling feature.',
{
codeVersion: <code />,
codePackage: <code />,
}
)
: undefined,
description:
params.docsLocation === DocsPageLocation.PROFILING_PAGE
? tct(
'You need a minimum version [codeVersion:1.18.0] of the [codePackage:sentry-python] SDK for the profiling feature.',
{
codeVersion: <code />,
codePackage: <code />,
}
)
: undefined,
language: 'bash',
code: getInstallSnippet(),
},
Expand Down
28 changes: 15 additions & 13 deletions static/app/gettingStartedDocs/python/chalice.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/step';
import type {
Docs,
DocsParams,
OnboardingConfig,
import {
type Docs,
DocsPageLocation,
type DocsParams,
type OnboardingConfig,
} from 'sentry/components/onboarding/gettingStartedDoc/types';
import {getPythonMetricsOnboarding} from 'sentry/components/onboarding/gettingStartedDoc/utils/metricsOnboarding';
import {crashReportOnboardingPython} from 'sentry/gettingStartedDocs/python/python';
Expand Down Expand Up @@ -63,15 +64,16 @@ const onboarding: OnboardingConfig = {
),
configurations: [
{
description: params.isProfilingSelected
? tct(
'You need a minimum version [codeVersion:1.18.0] of the [codePackage:sentry-python] SDK for the profiling feature.',
{
codeVersion: <code />,
codePackage: <code />,
}
)
: undefined,
description:
params.docsLocation === DocsPageLocation.PROFILING_PAGE
? tct(
'You need a minimum version [codeVersion:1.18.0] of the [codePackage:sentry-python] SDK for the profiling feature.',
{
codeVersion: <code />,
codePackage: <code />,
}
)
: undefined,
language: 'bash',
code: getInstallSnippet(),
},
Expand Down
21 changes: 16 additions & 5 deletions static/app/gettingStartedDocs/python/django.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import ExternalLink from 'sentry/components/links/externalLink';
import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/step';
import type {
Docs,
DocsParams,
OnboardingConfig,
import {
type Docs,
DocsPageLocation,
type DocsParams,
type OnboardingConfig,
} from 'sentry/components/onboarding/gettingStartedDoc/types';
import {getPythonMetricsOnboarding} from 'sentry/components/onboarding/gettingStartedDoc/utils/metricsOnboarding';
import replayOnboardingJsLoader from 'sentry/gettingStartedDocs/javascript/jsLoader/jsLoader';
Expand Down Expand Up @@ -38,14 +39,24 @@ sentry_sdk.init(
`;

const onboarding: OnboardingConfig = {
install: () => [
install: (params: Params) => [
{
type: StepType.INSTALL,
description: tct('Install [code:sentry-sdk] from PyPI:', {
code: <code />,
}),
configurations: [
{
description:
params.docsLocation === DocsPageLocation.PROFILING_PAGE
? tct(
'You need a minimum version [codeVersion:1.18.0] of the [codePackage:sentry-python] SDK for the profiling feature.',
{
codeVersion: <code />,
codePackage: <code />,
}
)
: undefined,
language: 'bash',
code: getInstallSnippet(),
},
Expand Down
28 changes: 15 additions & 13 deletions static/app/gettingStartedDocs/python/falcon.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import ExternalLink from 'sentry/components/links/externalLink';
import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/step';
import type {
Docs,
DocsParams,
OnboardingConfig,
import {
type Docs,
DocsPageLocation,
type DocsParams,
type OnboardingConfig,
} from 'sentry/components/onboarding/gettingStartedDoc/types';
import {getPythonMetricsOnboarding} from 'sentry/components/onboarding/gettingStartedDoc/utils/metricsOnboarding';
import replayOnboardingJsLoader from 'sentry/gettingStartedDocs/javascript/jsLoader/jsLoader';
Expand Down Expand Up @@ -55,15 +56,16 @@ const onboarding: OnboardingConfig = {
),
configurations: [
{
description: params.isProfilingSelected
? tct(
'You need a minimum version [codeVersion:1.18.0] of the [codePackage:sentry-python] SDK for the profiling feature.',
{
codeVersion: <code />,
codePackage: <code />,
}
)
: undefined,
description:
params.docsLocation === DocsPageLocation.PROFILING_PAGE
? tct(
'You need a minimum version [codeVersion:1.18.0] of the [codePackage:sentry-python] SDK for the profiling feature.',
{
codeVersion: <code />,
codePackage: <code />,
}
)
: undefined,
language: 'bash',
code: getInstallSnippet(),
},
Expand Down
Loading

0 comments on commit e8bc002

Please sign in to comment.