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: Remove/Convert a couple files to TS, shared utils Part 2 #3481

Merged
merged 4 commits into from
Nov 12, 2024

Conversation

ajay-sentry
Copy link
Contributor

Description

This PR either removes or converts the following files to TS:

  • ./shared/utils/legacyCharts.js REMOVED
  • ./shared/utils/ownerHelpers.js - FYI removed from barrel file
  • ./shared/utils/camelizeKeys.js
  • ./shared/utils/exceptions.js REMOVED

Relates to #2746

Nothing crazy otherwise

Screenshots

Link to Sample Entry

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

Copy link

codecov bot commented Nov 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.09%. Comparing base (ef89bf1) to head (14ce16c).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3481      +/-   ##
==========================================
- Coverage   99.09%   99.09%   -0.01%     
==========================================
  Files         808      806       -2     
  Lines       14402    14354      -48     
  Branches     4100     4082      -18     
==========================================
- Hits        14272    14224      -48     
  Misses        123      123              
  Partials        7        7              
Files with missing lines Coverage Δ
...tabs/Admin/ManageAdminCard/AddAdmins/AddAdmins.jsx 100.00% <ø> (ø)
...bs/Admin/ManageAdminCard/AdminTable/AdminTable.tsx 100.00% <ø> (ø)
...bersPage/MembersList/MembersTable/MembersTable.tsx 100.00% <ø> (ø)
src/services/account/useUpgradePlan.ts 100.00% <100.00%> (ø)
src/shared/utils/camelizeKeys.ts 100.00% <100.00%> (ø)
src/shared/utils/ownerHelpers.ts 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 100.00% <ø> (ø)
Pages 98.81% <ø> (ø)
Services 99.36% <100.00%> (ø)
Shared 99.73% <100.00%> (-0.01%) ⬇️
UI 99.21% <ø> (ø)

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 ef89bf1...14ce16c. Read the comment docs.

@codecov-qa
Copy link

codecov-qa bot commented Nov 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.09%. Comparing base (ef89bf1) to head (14ce16c).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3481      +/-   ##
==========================================
- Coverage   99.09%   99.09%   -0.01%     
==========================================
  Files         808      806       -2     
  Lines       14402    14354      -48     
  Branches     4093     4082      -11     
==========================================
- Hits        14272    14224      -48     
  Misses        123      123              
  Partials        7        7              
Files with missing lines Coverage Δ
...tabs/Admin/ManageAdminCard/AddAdmins/AddAdmins.jsx 100.00% <ø> (ø)
...bs/Admin/ManageAdminCard/AdminTable/AdminTable.tsx 100.00% <ø> (ø)
...bersPage/MembersList/MembersTable/MembersTable.tsx 100.00% <ø> (ø)
src/services/account/useUpgradePlan.ts 100.00% <100.00%> (ø)
src/shared/utils/camelizeKeys.ts 100.00% <100.00%> (ø)
src/shared/utils/ownerHelpers.ts 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 100.00% <ø> (ø)
Pages 98.81% <ø> (ø)
Services 99.36% <100.00%> (ø)
Shared 99.73% <100.00%> (-0.01%) ⬇️
UI 99.21% <ø> (ø)

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 ef89bf1...14ce16c. Read the comment docs.

Copy link

codecov-public-qa bot commented Nov 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.09%. Comparing base (ef89bf1) to head (14ce16c).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3481      +/-   ##
==========================================
- Coverage   99.09%   99.09%   -0.01%     
==========================================
  Files         808      806       -2     
  Lines       14402    14354      -48     
  Branches     4100     4075      -25     
==========================================
- Hits        14272    14224      -48     
  Misses        123      123              
  Partials        7        7              
Files with missing lines Coverage Δ
...tabs/Admin/ManageAdminCard/AddAdmins/AddAdmins.jsx 100.00% <ø> (ø)
...bs/Admin/ManageAdminCard/AdminTable/AdminTable.tsx 100.00% <ø> (ø)
...bersPage/MembersList/MembersTable/MembersTable.tsx 100.00% <ø> (ø)
src/services/account/useUpgradePlan.ts 100.00% <100.00%> (ø)
src/shared/utils/camelizeKeys.ts 100.00% <100.00%> (ø)
src/shared/utils/ownerHelpers.ts 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 100.00% <ø> (ø)
Pages 98.81% <ø> (ø)
Services 99.36% <100.00%> (ø)
Shared 99.73% <100.00%> (-0.01%) ⬇️
UI 99.21% <ø> (ø)

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 ef89bf1...14ce16c. Read the comment docs.

@@ -4,7 +4,7 @@ import { graphql, HttpResponse } from 'msw'
import { setupServer } from 'msw/node'
import { MemoryRouter, Route } from 'react-router-dom'

import { Trend } from 'shared/utils/legacyCharts'
import { Trend } from 'shared/utils/timeseriesCharts'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seemed to be a lingering reference of legacyCharts utils

@@ -17,7 +17,9 @@ describe('camelizeKeys', () => {

it('else passes through', () => {
expect(camelizeKeys([1, 2, 3])).toStrictEqual([1, 2, 3])
// @ts-expect-error
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Kept these since it looked like we were testing for these cases?¿

@@ -1,6 +1,8 @@
import camelCase from 'lodash/camelCase'

export function camelizeKeys(obj = {}) {
export function camelizeKeys(
obj: Record<string, any> = {}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Slightly stricter/more relevant typing than any, hoping this doesn't come back to bite but Ill keep an eye on it

@@ -1,4 +1,8 @@
export function getOwnerImg(provider, owner) {
export function getOwnerImg(provider: string, owner: string | null) {
if (!owner) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looking at the other references we would rather return the default than return an incorrect github page so I felt like this was worth adding

Copy link

codecov bot commented Nov 9, 2024

Bundle Report

Changes will increase total bundle size by 526 bytes (0.0%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
gazebo-production-system 5.56MB 415 bytes (0.01%) ⬆️
gazebo-production-system-esm 5.61MB 111 bytes (0.0%) ⬆️

@codecov-staging
Copy link

codecov-staging bot commented Nov 9, 2024

Bundle Report

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

Detailed changes
Bundle name Size Change
gazebo-staging-system-esm* 5.59MB 25.0kB (-0.45%) ⬇️
gazebo-staging-system 5.56MB 415 bytes (0.01%) ⬆️

ℹ️ *Bundle size includes cached data from a previous commit

@codecov-notifications
Copy link

codecov-notifications bot commented Nov 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3481      +/-   ##
==========================================
- Coverage   99.09%   99.09%   -0.01%     
==========================================
  Files         808      806       -2     
  Lines       14402    14354      -48     
  Branches     4100     4075      -25     
==========================================
- Hits        14272    14224      -48     
  Misses        123      123              
  Partials        7        7              
Files with missing lines Coverage Δ
...tabs/Admin/ManageAdminCard/AddAdmins/AddAdmins.jsx 100.00% <ø> (ø)
...bs/Admin/ManageAdminCard/AdminTable/AdminTable.tsx 100.00% <ø> (ø)
...bersPage/MembersList/MembersTable/MembersTable.tsx 100.00% <ø> (ø)
src/services/account/useUpgradePlan.ts 100.00% <100.00%> (ø)
src/shared/utils/camelizeKeys.ts 100.00% <100.00%> (ø)
src/shared/utils/ownerHelpers.ts 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 100.00% <ø> (ø)
Pages 98.81% <ø> (ø)
Services 99.36% <100.00%> (ø)
Shared 99.73% <100.00%> (-0.01%) ⬇️
UI 99.21% <ø> (ø)

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 ef89bf1...14ce16c. Read the comment docs.

@codecov-releaser
Copy link
Contributor

codecov-releaser commented Nov 9, 2024

✅ Deploy preview for gazebo ready!

Previews expire after 1 month automatically.

Storybook

Commit Created Cloud Enterprise
32edfd4 Sat, 09 Nov 2024 00:48:49 GMT Expired Expired
14ce16c Tue, 12 Nov 2024 22:15:10 GMT Cloud Enterprise

// redirect to stripe checkout if there is a checkout session id
return redirectToStripe(data.checkoutSessionId)
return redirectToStripe(data?.checkoutSessionId)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: we wouldn't need the optional chaining here if we check existence at line 36

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point, will fix

@@ -1,3 +1 @@
export * from './ownerHelpers'
export * from './provider'
Copy link
Contributor

Choose a reason for hiding this comment

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

If it's not too much work, I feel like we can just get rid of this file completely at this point.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can do, I'll remove it in #3461 when I'm done cooking that one (its been a mega pain)

@ajay-sentry ajay-sentry added this pull request to the merge queue Nov 12, 2024
Merged via the queue into main with commit 0953a88 Nov 12, 2024
62 checks passed
@ajay-sentry ajay-sentry deleted the Ajay/2746-part-2 branch November 12, 2024 22:26
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.

3 participants