Skip to content
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

chore: Replace old onboarding metrics with Amplitude events #3769

Merged
merged 4 commits into from
Feb 25, 2025

Conversation

spalmurray-codecov
Copy link
Contributor

This PR removes the old onboarding metrics implementation replacing with Amplitude where applicable.

Closes codecov/engineering-team#3125

loginProvider?: ReturnType<typeof loginProviderToName> // for login buttons only
ciProvider?: 'GitHub Actions' | 'CircleCI' | 'Codecov CLI' // E.g., product onboarding pages
testingFramework?: Framework // E.g., product onboarding pages
copied?:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

could see an argument for using a string type here rather than string literal union. Lmk thoughts if you have any

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we put these in an enum and infer the type from there? similar to loginProvider

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pulled it out to its own type. Same result, but don't think we need the extra enum features

Copy link

codecov bot commented Feb 24, 2025

Bundle Report

Changes will decrease total bundle size by 2.73kB (-0.02%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
gazebo-production-system 6.13MB -1.37kB (-0.02%) ⬇️
gazebo-production-esm 6.2MB -1.36kB (-0.02%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: gazebo-production-system

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index-legacy.*.js 46 bytes 709.73kB 0.01%
assets/index-legacy.*.js -205 bytes 33.09kB -0.62%
assets/index-legacy.*.js -252 bytes 98.31kB -0.26%
assets/index-legacy.*.js 274 bytes 31.48kB 0.88%
assets/useRepoConfig-legacy.*.js 6 bytes 1.89kB 0.32%
assets/useStoreCodecovEventMetric-legacy.*.js (Deleted) -1.24kB 0 bytes -100.0% 🗑️

Files in assets/index-legacy.*.js:

  • ./src/pages/RepoPage/BundlesTab/BundleOnboarding/BundleOnboarding.tsx → Total Size: 7.68kB

Files in assets/index-legacy.*.js:

  • ./src/pages/RepoPage/CoverageOnboarding/GitHubActions/TokenStep.tsx → Total Size: 7.99kB

  • ./src/pages/RepoPage/CoverageOnboarding/OtherCI/OtherCI.tsx → Total Size: 4.96kB

  • ./src/pages/RepoPage/CoverageOnboarding/GitHubActions/WorkflowYMLStep.tsx → Total Size: 3.4kB

  • ./src/pages/RepoPage/CoverageOnboarding/GitHubActions/GitHubActions.tsx → Total Size: 2.82kB

  • ./src/pages/RepoPage/CoverageOnboarding/OutputCoverageStep/OutputCoverageStep.tsx → Total Size: 2.96kB

  • ./src/pages/RepoPage/CoverageOnboarding/CircleCI/CircleCI.tsx → Total Size: 6.62kB

  • ./src/pages/RepoPage/CoverageOnboarding/NewRepoTab.tsx → Total Size: 5.05kB

view changes for bundle: gazebo-production-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index.*.js -200 bytes 33.51kB -0.59%
assets/index.*.js 243 bytes 32.08kB 0.76%
assets/index.*.js 36 bytes 630.14kB 0.01%
assets/index.*.js -253 bytes 103.86kB -0.24%
assets/useRepoConfig.*.js 5 bytes 2.01kB 0.25%
assets/useStoreCodecovEventMetric.*.js (Deleted) -1.19kB 0 bytes -100.0% 🗑️

Files in assets/index.*.js:

  • ./src/pages/RepoPage/BundlesTab/BundleOnboarding/BundleOnboarding.tsx → Total Size: 7.66kB

Files in assets/index.*.js:

  • ./src/pages/RepoPage/CoverageOnboarding/CircleCI/CircleCI.tsx → Total Size: 6.62kB

  • ./src/pages/RepoPage/CoverageOnboarding/GitHubActions/TokenStep.tsx → Total Size: 7.99kB

  • ./src/pages/RepoPage/CoverageOnboarding/GitHubActions/GitHubActions.tsx → Total Size: 2.82kB

  • ./src/pages/RepoPage/CoverageOnboarding/OutputCoverageStep/OutputCoverageStep.tsx → Total Size: 2.96kB

  • ./src/pages/RepoPage/CoverageOnboarding/OtherCI/OtherCI.tsx → Total Size: 4.96kB

  • ./src/pages/RepoPage/CoverageOnboarding/NewRepoTab.tsx → Total Size: 5.05kB

  • ./src/pages/RepoPage/CoverageOnboarding/GitHubActions/WorkflowYMLStep.tsx → Total Size: 3.4kB

@codecov-staging
Copy link

codecov-staging bot commented Feb 24, 2025

Bundle Report

Changes will decrease total bundle size by 2.73kB (-0.02%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
gazebo-staging-system 6.13MB -1.37kB (-0.02%) ⬇️
gazebo-staging-esm 6.2MB -1.36kB (-0.02%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: gazebo-staging-system

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index-legacy.*.js -252 bytes 98.31kB -0.26%
assets/index-legacy.*.js 46 bytes 709.73kB 0.01%
assets/index-legacy.*.js 274 bytes 31.48kB 0.88%
assets/index-legacy.*.js -205 bytes 33.09kB -0.62%
assets/useRepoConfig-legacy.*.js 6 bytes 1.89kB 0.32%
assets/useStoreCodecovEventMetric-legacy.*.js (Deleted) -1.24kB 0 bytes -100.0% 🗑️

Files in assets/index-legacy.*.js:

  • ./src/pages/RepoPage/CoverageOnboarding/NewRepoTab.tsx → Total Size: 5.05kB

  • ./src/pages/RepoPage/CoverageOnboarding/OtherCI/OtherCI.tsx → Total Size: 4.96kB

  • ./src/pages/RepoPage/CoverageOnboarding/CircleCI/CircleCI.tsx → Total Size: 6.62kB

  • ./src/pages/RepoPage/CoverageOnboarding/OutputCoverageStep/OutputCoverageStep.tsx → Total Size: 2.96kB

  • ./src/pages/RepoPage/CoverageOnboarding/GitHubActions/WorkflowYMLStep.tsx → Total Size: 3.4kB

  • ./src/pages/RepoPage/CoverageOnboarding/GitHubActions/TokenStep.tsx → Total Size: 7.99kB

  • ./src/pages/RepoPage/CoverageOnboarding/GitHubActions/GitHubActions.tsx → Total Size: 2.82kB

Files in assets/index-legacy.*.js:

  • ./src/pages/RepoPage/BundlesTab/BundleOnboarding/BundleOnboarding.tsx → Total Size: 7.68kB
view changes for bundle: gazebo-staging-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index.*.js 36 bytes 630.14kB 0.01%
assets/index.*.js 243 bytes 32.08kB 0.76%
assets/index.*.js -253 bytes 103.86kB -0.24%
assets/index.*.js -200 bytes 33.51kB -0.59%
assets/useRepoConfig.*.js 5 bytes 2.01kB 0.25%
assets/useStoreCodecovEventMetric.*.js (Deleted) -1.19kB 0 bytes -100.0% 🗑️

Files in assets/index.*.js:

  • ./src/pages/RepoPage/CoverageOnboarding/CircleCI/CircleCI.tsx → Total Size: 6.62kB

  • ./src/pages/RepoPage/CoverageOnboarding/GitHubActions/WorkflowYMLStep.tsx → Total Size: 3.4kB

  • ./src/pages/RepoPage/CoverageOnboarding/GitHubActions/GitHubActions.tsx → Total Size: 2.82kB

  • ./src/pages/RepoPage/CoverageOnboarding/OtherCI/OtherCI.tsx → Total Size: 4.96kB

  • ./src/pages/RepoPage/CoverageOnboarding/OutputCoverageStep/OutputCoverageStep.tsx → Total Size: 2.96kB

  • ./src/pages/RepoPage/CoverageOnboarding/GitHubActions/TokenStep.tsx → Total Size: 7.99kB

  • ./src/pages/RepoPage/CoverageOnboarding/NewRepoTab.tsx → Total Size: 5.05kB

Files in assets/index.*.js:

  • ./src/pages/RepoPage/BundlesTab/BundleOnboarding/BundleOnboarding.tsx → Total Size: 7.66kB

@codecov-qa
Copy link

codecov-qa bot commented Feb 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.72%. Comparing base (15f9577) to head (410e2fd).
Report is 2 commits behind head on main.

✅ All tests successful. No failed tests found.

@@            Coverage Diff             @@
##             main    #3769      +/-   ##
==========================================
+ Coverage   98.68%   98.72%   +0.03%     
==========================================
  Files         825      824       -1     
  Lines       14831    14782      -49     
  Branches     4242     4239       -3     
==========================================
- Hits        14636    14593      -43     
+ Misses        188      182       -6     
  Partials        7        7              
Files with missing lines Coverage Δ
...e/BundlesTab/BundleOnboarding/BundleOnboarding.tsx 94.87% <ø> (-0.37%) ⬇️
.../RepoPage/CoverageOnboarding/CircleCI/CircleCI.tsx 100.00% <100.00%> (+7.69%) ⬆️
...CoverageOnboarding/GitHubActions/GitHubActions.tsx 95.65% <ø> (ø)
...age/CoverageOnboarding/GitHubActions/TokenStep.tsx 95.65% <100.00%> (-0.10%) ⬇️
...verageOnboarding/GitHubActions/WorkflowYMLStep.tsx 88.88% <100.00%> (+8.88%) ⬆️
...c/pages/RepoPage/CoverageOnboarding/NewRepoTab.tsx 96.87% <ø> (-0.27%) ⬇️
...es/RepoPage/CoverageOnboarding/OtherCI/OtherCI.tsx 100.00% <ø> (ø)
...boarding/OutputCoverageStep/OutputCoverageStep.tsx 100.00% <100.00%> (ø)
src/services/events/types.ts 100.00% <ø> (ø)

... and 12 files with indirect coverage changes

Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.69% <ø> (ø)
Pages 98.29% <100.00%> (+0.03%) ⬆️
Services 99.36% <ø> (+0.08%) ⬆️
Shared 99.11% <ø> (ø)
UI 99.07% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 15f9577...410e2fd. Read the comment docs.

Copy link

codecov bot commented Feb 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.72%. Comparing base (15f9577) to head (410e2fd).
Report is 2 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3769      +/-   ##
==========================================
+ Coverage   98.68%   98.72%   +0.03%     
==========================================
  Files         825      824       -1     
  Lines       14831    14782      -49     
  Branches     4250     4239      -11     
==========================================
- Hits        14636    14593      -43     
+ Misses        188      182       -6     
  Partials        7        7              
Files with missing lines Coverage Δ
...e/BundlesTab/BundleOnboarding/BundleOnboarding.tsx 94.87% <ø> (-0.37%) ⬇️
.../RepoPage/CoverageOnboarding/CircleCI/CircleCI.tsx 100.00% <100.00%> (+7.69%) ⬆️
...CoverageOnboarding/GitHubActions/GitHubActions.tsx 95.65% <ø> (ø)
...age/CoverageOnboarding/GitHubActions/TokenStep.tsx 95.65% <100.00%> (-0.10%) ⬇️
...verageOnboarding/GitHubActions/WorkflowYMLStep.tsx 88.88% <100.00%> (+8.88%) ⬆️
...c/pages/RepoPage/CoverageOnboarding/NewRepoTab.tsx 96.87% <ø> (-0.27%) ⬇️
...es/RepoPage/CoverageOnboarding/OtherCI/OtherCI.tsx 100.00% <ø> (ø)
...boarding/OutputCoverageStep/OutputCoverageStep.tsx 100.00% <100.00%> (ø)
src/services/events/types.ts 100.00% <ø> (ø)

... and 12 files with indirect coverage changes

Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.69% <ø> (ø)
Pages 98.29% <100.00%> (+0.03%) ⬆️
Services 99.36% <ø> (+0.08%) ⬆️
Shared 99.11% <ø> (ø)
UI 99.07% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 15f9577...410e2fd. Read the comment docs.

Copy link

codecov-public-qa bot commented Feb 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.72%. Comparing base (15f9577) to head (410e2fd).
Report is 2 commits behind head on main.

✅ All tests successful. No failed tests found.

@@            Coverage Diff             @@
##             main    #3769      +/-   ##
==========================================
+ Coverage   98.68%   98.72%   +0.03%     
==========================================
  Files         825      824       -1     
  Lines       14831    14782      -49     
  Branches     4242     4239       -3     
==========================================
- Hits        14636    14593      -43     
+ Misses        188      182       -6     
  Partials        7        7              
Files with missing lines Coverage Δ
...e/BundlesTab/BundleOnboarding/BundleOnboarding.tsx 94.87% <ø> (-0.37%) ⬇️
.../RepoPage/CoverageOnboarding/CircleCI/CircleCI.tsx 100.00% <100.00%> (+7.69%) ⬆️
...CoverageOnboarding/GitHubActions/GitHubActions.tsx 95.65% <ø> (ø)
...age/CoverageOnboarding/GitHubActions/TokenStep.tsx 95.65% <100.00%> (-0.10%) ⬇️
...verageOnboarding/GitHubActions/WorkflowYMLStep.tsx 88.88% <100.00%> (+8.88%) ⬆️
...c/pages/RepoPage/CoverageOnboarding/NewRepoTab.tsx 96.87% <ø> (-0.27%) ⬇️
...es/RepoPage/CoverageOnboarding/OtherCI/OtherCI.tsx 100.00% <ø> (ø)
...boarding/OutputCoverageStep/OutputCoverageStep.tsx 100.00% <100.00%> (ø)
src/services/events/types.ts 100.00% <ø> (ø)

... and 12 files with indirect coverage changes

Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.69% <ø> (ø)
Pages 98.29% <100.00%> (+0.03%) ⬆️
Services 99.36% <ø> (+0.08%) ⬆️
Shared 99.11% <ø> (ø)
UI 99.07% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 15f9577...410e2fd. Read the comment docs.

@codecov-releaser
Copy link
Contributor

codecov-releaser commented Feb 24, 2025

✅ Deploy preview for gazebo ready!

Previews expire after 1 month automatically.

Storybook

Commit Created Cloud Enterprise
6c71101 Mon, 24 Feb 2025 20:24:29 GMT Expired Expired
b0df190 Mon, 24 Feb 2025 20:39:33 GMT Expired Expired
db5123e Tue, 25 Feb 2025 13:52:05 GMT Expired Expired
410e2fd Tue, 25 Feb 2025 14:08:04 GMT Cloud Enterprise

@codecov-notifications
Copy link

codecov-notifications bot commented Feb 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

@@            Coverage Diff             @@
##             main    #3769      +/-   ##
==========================================
+ Coverage   98.68%   98.72%   +0.03%     
==========================================
  Files         825      824       -1     
  Lines       14831    14782      -49     
  Branches     4242     4239       -3     
==========================================
- Hits        14636    14593      -43     
+ Misses        188      182       -6     
  Partials        7        7              
Files with missing lines Coverage Δ
...e/BundlesTab/BundleOnboarding/BundleOnboarding.tsx 94.87% <ø> (-0.37%) ⬇️
.../RepoPage/CoverageOnboarding/CircleCI/CircleCI.tsx 100.00% <100.00%> (+7.69%) ⬆️
...CoverageOnboarding/GitHubActions/GitHubActions.tsx 95.65% <ø> (ø)
...age/CoverageOnboarding/GitHubActions/TokenStep.tsx 95.65% <100.00%> (-0.10%) ⬇️
...verageOnboarding/GitHubActions/WorkflowYMLStep.tsx 88.88% <100.00%> (+8.88%) ⬆️
...c/pages/RepoPage/CoverageOnboarding/NewRepoTab.tsx 96.87% <ø> (-0.27%) ⬇️
...es/RepoPage/CoverageOnboarding/OtherCI/OtherCI.tsx 100.00% <ø> (ø)
...boarding/OutputCoverageStep/OutputCoverageStep.tsx 100.00% <100.00%> (ø)
src/services/events/types.ts 100.00% <ø> (ø)

... and 12 files with indirect coverage changes

Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.69% <ø> (ø)
Pages 98.29% <100.00%> (+0.03%) ⬆️
Services 99.36% <ø> (+0.08%) ⬆️
Shared 99.11% <ø> (ø)
UI 99.07% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 15f9577...410e2fd. Read the comment docs.

@spalmurray-codecov spalmurray-codecov marked this pull request as ready for review February 24, 2025 21:09
await waitFor(() =>
expect(mockMetricMutationVariables).toHaveBeenCalledTimes(1)
)
await waitFor(() => expect(eventTracker().track).toHaveBeenCalledTimes(4))
Copy link
Contributor

Choose a reason for hiding this comment

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

how come this is 4 and not 5 when there's 5 copy commands? :O

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's correct as one of the copy buttons doesn't emit an event! This one:

Screenshot 2025-02-25 at 08 39 07


const promises: Promise<void>[] = []
copyCommands.forEach((copy) => promises.push(user.click(copy)))
await Promise.all(promises)

// One of the code-snippets does not have a metric associated with it
expect(mockMetricMutationVariables).toHaveBeenCalledTimes(4)
expect(eventTracker().track).toHaveBeenCalledTimes(5)
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar here with the off by one

@spalmurray-codecov spalmurray-codecov force-pushed the spalmurray/clean-up-old-onboarding-metrics branch from b0df190 to db5123e Compare February 25, 2025 13:46
@@ -92,5 +96,23 @@ type ButtonName =
| 'Continue'
| 'Login'
| 'Sync'
| 'Copy'

type ButtonLocation =
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added this type because I accidentally used both Coverage onboarding and Coverage Onboarding. I expected these strings to be more or less unique to each call, but that seems to not be the case. If we're reusing locations, we ought to have type safety to avoid mistakes like mine.

@spalmurray-codecov spalmurray-codecov added this pull request to the merge queue Feb 25, 2025
Merged via the queue into main with commit 40c29d5 Feb 25, 2025
62 checks passed
@spalmurray-codecov spalmurray-codecov deleted the spalmurray/clean-up-old-onboarding-metrics branch February 25, 2025 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Gazebo] Remove old onboarding metrics code
4 participants