-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
chore(preprod): amplitude events for emerge pages (EME-638) #103801
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
1dd9a40
amplitude events for emerge pages
mtopo27 52cdf45
clean amplitude events
mtopo27 bd10d89
clean unneeded props
mtopo27 fcd4c1d
more cleaning
mtopo27 c5c55f9
clean
mtopo27 ab2d436
fix param
mtopo27 7798ea5
remove preprod helper
mtopo27 76db6b4
comments
mtopo27 071dca5
more clean
mtopo27 c28d548
add in project type via project store
mtopo27 5bc2b6a
clean
mtopo27 85b0bff
missing param
mtopo27 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
static/app/utils/analytics/preprodBuildAnalyticsEvents.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| import type {Organization} from 'sentry/types/organization'; | ||
|
|
||
| type BasePreprodBuildEvent = { | ||
| organization: Organization; | ||
| build_id?: string; | ||
| platform?: string | null; | ||
| project_slug?: string; | ||
| project_type?: string | null; | ||
| }; | ||
|
|
||
| export type PreprodBuildEventParameters = { | ||
| 'preprod.builds.compare.go_to_build_details': BasePreprodBuildEvent & { | ||
| slot?: 'head' | 'base'; | ||
| }; | ||
| 'preprod.builds.compare.select_base_build': BasePreprodBuildEvent; | ||
| 'preprod.builds.compare.trigger_comparison': BasePreprodBuildEvent; | ||
| 'preprod.builds.details.compare_build_clicked': BasePreprodBuildEvent; | ||
| 'preprod.builds.details.delete_build': BasePreprodBuildEvent; | ||
| 'preprod.builds.details.expand_insight': BasePreprodBuildEvent & { | ||
| insight_key: string; | ||
| }; | ||
| 'preprod.builds.details.open_insight_details_modal': BasePreprodBuildEvent & { | ||
| insight_key: string; | ||
| }; | ||
| 'preprod.builds.details.open_insights_sidebar': BasePreprodBuildEvent & { | ||
| source: 'metric_card' | 'insight_table'; | ||
| }; | ||
| 'preprod.builds.release.build_row_clicked': BasePreprodBuildEvent; | ||
| }; | ||
|
|
||
| type PreprodBuildAnalyticsKey = keyof PreprodBuildEventParameters; | ||
|
|
||
| export const preprodBuildEventMap: Record<PreprodBuildAnalyticsKey, string | null> = { | ||
| 'preprod.builds.release.build_row_clicked': 'Preprod Builds: Release Build Row Clicked', | ||
| 'preprod.builds.details.open_insights_sidebar': | ||
| 'Preprod Build Details: Insights Sidebar Opened', | ||
| 'preprod.builds.details.expand_insight': 'Preprod Build Details: Insight Expanded', | ||
| 'preprod.builds.details.open_insight_details_modal': | ||
| 'Preprod Build Details: Open Insight Details Modal', | ||
| 'preprod.builds.details.delete_build': 'Preprod Build Details: Delete Build', | ||
| 'preprod.builds.details.compare_build_clicked': | ||
| 'Preprod Build Details: Compare Clicked', | ||
| 'preprod.builds.compare.go_to_build_details': | ||
| 'Preprod Build Comparison: Go to Build Details', | ||
| 'preprod.builds.compare.select_base_build': 'Preprod Build Comparison: Base Selected', | ||
| 'preprod.builds.compare.trigger_comparison': | ||
| 'Preprod Build Comparison: Compare Triggered', | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,7 @@ import { | |
| } from 'sentry/icons'; | ||
| import {t} from 'sentry/locale'; | ||
| import ProjectsStore from 'sentry/stores/projectsStore'; | ||
| import {trackAnalytics} from 'sentry/utils/analytics'; | ||
| import type {UseApiQueryResult} from 'sentry/utils/queryClient'; | ||
| import type RequestError from 'sentry/utils/requestError/requestError'; | ||
| import {useIsSentryEmployee} from 'sentry/utils/useIsSentryEmployee'; | ||
|
|
@@ -61,12 +62,13 @@ interface BuildDetailsHeaderContentProps { | |
| artifactId: string; | ||
| buildDetailsQuery: UseApiQueryResult<BuildDetailsApiResponse, RequestError>; | ||
| projectId: string; | ||
| projectType: string | null; | ||
| } | ||
|
|
||
| export function BuildDetailsHeaderContent(props: BuildDetailsHeaderContentProps) { | ||
| const organization = useOrganization(); | ||
| const isSentryEmployee = useIsSentryEmployee(); | ||
| const {buildDetailsQuery, projectId, artifactId} = props; | ||
| const {buildDetailsQuery, projectId, artifactId, projectType} = props; | ||
| const { | ||
| isDeletingArtifact, | ||
| handleDeleteArtifact, | ||
|
|
@@ -128,6 +130,27 @@ export function BuildDetailsHeaderContent(props: BuildDetailsHeaderContentProps) | |
|
|
||
| const version = `v${buildDetailsData.app_info.version ?? 'Unknown'} (${buildDetailsData.app_info.build_number ?? 'Unknown'})`; | ||
|
|
||
| const handleCompareClick = () => { | ||
| trackAnalytics('preprod.builds.details.compare_build_clicked', { | ||
| organization, | ||
| platform: buildDetailsData.app_info?.platform ?? null, | ||
| build_id: buildDetailsData.id, | ||
| project_type: projectType, | ||
| project_slug: projectId, | ||
| }); | ||
cursor[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }; | ||
|
|
||
| const handleConfirmDelete = () => { | ||
| handleDeleteArtifact(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did we want analytics here? |
||
| trackAnalytics('preprod.builds.details.delete_build', { | ||
| organization, | ||
| platform: buildDetailsData.app_info?.platform ?? null, | ||
| build_id: buildDetailsData.id, | ||
| project_slug: projectId, | ||
| project_type: projectType, | ||
| }); | ||
| }; | ||
|
|
||
| return ( | ||
| <React.Fragment> | ||
| <Layout.HeaderContent> | ||
|
|
@@ -152,6 +175,7 @@ export function BuildDetailsHeaderContent(props: BuildDetailsHeaderContentProps) | |
| /> | ||
| <Link | ||
| to={`/organizations/${organization.slug}/preprod/${projectId}/compare/${buildDetailsData.id}/`} | ||
| onClick={handleCompareClick} | ||
| > | ||
| <Button size="sm" priority="default" icon={<IconTelescope />}> | ||
| {t('Compare Build')} | ||
|
|
@@ -162,7 +186,7 @@ export function BuildDetailsHeaderContent(props: BuildDetailsHeaderContentProps) | |
| 'Are you sure you want to delete this build? This action cannot be undone and will permanently remove all associated files and data.' | ||
| )} | ||
| confirmInput={artifactId} | ||
| onConfirm={handleDeleteArtifact} | ||
| onConfirm={handleConfirmDelete} | ||
| > | ||
| {({open: openDeleteModal}) => { | ||
| const menuItems: MenuItemProps[] = [ | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.