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

feat: Add rejectNetworkError to API calls (part four) #3768

Merged

Conversation

nicholas-codecov
Copy link
Contributor

@nicholas-codecov nicholas-codecov commented Feb 24, 2025

Description

This PR is part four in a series going through Gazebo updating our API calls to utilize rejectNetworkError in functions where we call the API.

Ticket: codecov/engineering-team#3329

Notable Changes

  • Update API calls to use rejectNetworkError (see commits)
  • Update tests

Copy link

codecov bot commented Feb 24, 2025

Bundle Report

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

Detailed changes
Bundle name Size Change
gazebo-production-system 6.13MB 113 bytes (0.0%) ⬆️
gazebo-production-esm 6.21MB 95 bytes (0.0%) ⬆️

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 -139 bytes 709.73kB -0.02%
assets/index-legacy.*.js 130 bytes 12.67kB 1.04%
assets/index-legacy.*.js 368 bytes 113.78kB 0.32%
assets/index-legacy.*.js -252 bytes 98.31kB -0.26%
assets/useRepoConfig-legacy.*.js 6 bytes 1.89kB 0.32%

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

  • ./src/services/uploadTokenRequired/useUploadTokenRequired.tsx → Total Size: 1.01kB

  • ./src/services/repo/useRepoFlagsSelect.tsx → Total Size: 7.86kB

  • ./src/services/repo/useRepoOverview.tsx → Total Size: 3.1kB

  • ./src/services/useIsTeamPlan/useIsTeamPlan.ts → Total Size: 893 bytes

  • ./src/services/repo/useRepoSettingsTeam.tsx → Total Size: 2.16kB

  • ./src/services/repo/useRepoSettings.tsx → Total Size: 2.8kB

  • ./src/services/user/useInternalUser.ts → Total Size: 1.14kB

  • ./src/services/repo/useRepoCoverage.tsx → Total Size: 3.07kB

  • ./src/services/repo/useRepoRateLimitStatus.tsx → Total Size: 2.01kB

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

  • ./src/services/repo/useRepoComponentsSelect.tsx → Total Size: 3.02kB

  • ./src/services/repo/useRepoFlags.tsx → Total Size: 4.55kB

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

  • ./src/services/repo/useRepoConfig.tsx → Total Size: 2.58kB
view changes for bundle: gazebo-production-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index.*.js -154 bytes 630.14kB -0.02%
assets/index.*.js 368 bytes 126.36kB 0.29%
assets/index.*.js 129 bytes 13.63kB 0.96%
assets/index.*.js -253 bytes 103.86kB -0.24%
assets/useRepoConfig.*.js 5 bytes 2.01kB 0.25%

Files in assets/index.*.js:

  • ./src/services/repo/useRepoOverview.tsx → Total Size: 3.1kB

  • ./src/services/repo/useRepoFlagsSelect.tsx → Total Size: 7.86kB

  • ./src/services/repo/useRepoSettingsTeam.tsx → Total Size: 2.16kB

  • ./src/services/uploadTokenRequired/useUploadTokenRequired.tsx → Total Size: 994 bytes

  • ./src/services/repo/useRepoRateLimitStatus.tsx → Total Size: 2.01kB

  • ./src/services/repo/useRepoSettings.tsx → Total Size: 2.8kB

  • ./src/services/repo/useRepoCoverage.tsx → Total Size: 3.07kB

  • ./src/services/user/useInternalUser.ts → Total Size: 1.13kB

  • ./src/services/useIsTeamPlan/useIsTeamPlan.ts → Total Size: 878 bytes

Files in assets/index.*.js:

  • ./src/services/repo/useRepoFlags.tsx → Total Size: 4.55kB

  • ./src/services/repo/useRepoComponentsSelect.tsx → Total Size: 3.02kB

Files in assets/useRepoConfig.*.js:

  • ./src/services/repo/useRepoConfig.tsx → Total Size: 2.55kB

@codecov-staging
Copy link

codecov-staging bot commented Feb 24, 2025

Bundle Report

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

Detailed changes
Bundle name Size Change
gazebo-staging-system 6.13MB 113 bytes (0.0%) ⬆️
gazebo-staging-esm 6.21MB 95 bytes (0.0%) ⬆️

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 -139 bytes 709.73kB -0.02%
assets/index-legacy.*.js -252 bytes 98.31kB -0.26%
assets/index-legacy.*.js 130 bytes 12.67kB 1.04%
assets/index-legacy.*.js 368 bytes 113.78kB 0.32%
assets/useRepoConfig-legacy.*.js 6 bytes 1.89kB 0.32%

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

  • ./src/services/useIsTeamPlan/useIsTeamPlan.ts → Total Size: 893 bytes

  • ./src/services/repo/useRepoSettings.tsx → Total Size: 2.8kB

  • ./src/services/repo/useRepoCoverage.tsx → Total Size: 3.07kB

  • ./src/services/user/useInternalUser.ts → Total Size: 1.14kB

  • ./src/services/repo/useRepoOverview.tsx → Total Size: 3.1kB

  • ./src/services/uploadTokenRequired/useUploadTokenRequired.tsx → Total Size: 1.01kB

  • ./src/services/repo/useRepoSettingsTeam.tsx → Total Size: 2.16kB

  • ./src/services/repo/useRepoFlagsSelect.tsx → Total Size: 7.86kB

  • ./src/services/repo/useRepoRateLimitStatus.tsx → Total Size: 2.01kB

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

  • ./src/services/repo/useRepoFlags.tsx → Total Size: 4.55kB

  • ./src/services/repo/useRepoComponentsSelect.tsx → Total Size: 3.02kB

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

  • ./src/services/repo/useRepoConfig.tsx → Total Size: 2.58kB
view changes for bundle: gazebo-staging-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index.*.js -253 bytes 103.86kB -0.24%
assets/index.*.js 129 bytes 13.63kB 0.96%
assets/index.*.js -154 bytes 630.14kB -0.02%
assets/index.*.js 368 bytes 126.36kB 0.29%
assets/useRepoConfig.*.js 5 bytes 2.01kB 0.25%

Files in assets/index.*.js:

  • ./src/services/repo/useRepoFlags.tsx → Total Size: 4.55kB

  • ./src/services/repo/useRepoComponentsSelect.tsx → Total Size: 3.02kB

Files in assets/index.*.js:

  • ./src/services/repo/useRepoOverview.tsx → Total Size: 3.1kB

  • ./src/services/repo/useRepoSettings.tsx → Total Size: 2.8kB

  • ./src/services/repo/useRepoCoverage.tsx → Total Size: 3.07kB

  • ./src/services/uploadTokenRequired/useUploadTokenRequired.tsx → Total Size: 994 bytes

  • ./src/services/useIsTeamPlan/useIsTeamPlan.ts → Total Size: 878 bytes

  • ./src/services/repo/useRepoRateLimitStatus.tsx → Total Size: 2.01kB

  • ./src/services/repo/useRepoFlagsSelect.tsx → Total Size: 7.86kB

  • ./src/services/user/useInternalUser.ts → Total Size: 1.13kB

  • ./src/services/repo/useRepoSettingsTeam.tsx → Total Size: 2.16kB

Files in assets/useRepoConfig.*.js:

  • ./src/services/repo/useRepoConfig.tsx → Total Size: 2.55kB

@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.69%. Comparing base (51d4fd5) to head (9860d95).
Report is 2 commits behind head on main.

✅ All tests successful. No failed tests found.

@@            Coverage Diff             @@
##             main    #3768      +/-   ##
==========================================
+ Coverage   98.68%   98.69%   +0.01%     
==========================================
  Files         825      825              
  Lines       14832    14826       -6     
  Branches     4250     4242       -8     
==========================================
- Hits        14637    14633       -4     
+ Misses        188      186       -2     
  Partials        7        7              
Files with missing lines Coverage Δ
src/services/repo/useRepoComponentsSelect.tsx 100.00% <100.00%> (ø)
src/services/repo/useRepoConfig.tsx 100.00% <100.00%> (ø)
src/services/repo/useRepoCoverage.tsx 100.00% <100.00%> (ø)
src/services/repo/useRepoFlags.tsx 100.00% <100.00%> (ø)
src/services/repo/useRepoFlagsSelect.tsx 100.00% <100.00%> (ø)
src/services/repo/useRepoOverview.tsx 100.00% <100.00%> (+3.33%) ⬆️
src/services/repo/useRepoRateLimitStatus.tsx 100.00% <100.00%> (ø)
src/services/repo/useRepoSettings.tsx 100.00% <100.00%> (ø)
src/services/repo/useRepoSettingsTeam.tsx 100.00% <100.00%> (ø)
...ces/uploadTokenRequired/useUploadTokenRequired.tsx 100.00% <100.00%> (ø)
... and 2 more

... and 13 files with indirect coverage changes

Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.69% <ø> (ø)
Pages 98.26% <ø> (ø)
Services 99.34% <100.00%> (+0.06%) ⬆️
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 51d4fd5...9860d95. Read the comment docs.

@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    #3768      +/-   ##
==========================================
+ Coverage   98.68%   98.69%   +0.01%     
==========================================
  Files         825      825              
  Lines       14832    14826       -6     
  Branches     4250     4242       -8     
==========================================
- Hits        14637    14633       -4     
+ Misses        188      186       -2     
  Partials        7        7              
Files with missing lines Coverage Δ
src/services/repo/useRepoComponentsSelect.tsx 100.00% <100.00%> (ø)
src/services/repo/useRepoConfig.tsx 100.00% <100.00%> (ø)
src/services/repo/useRepoCoverage.tsx 100.00% <100.00%> (ø)
src/services/repo/useRepoFlags.tsx 100.00% <100.00%> (ø)
src/services/repo/useRepoFlagsSelect.tsx 100.00% <100.00%> (ø)
src/services/repo/useRepoOverview.tsx 100.00% <100.00%> (+3.33%) ⬆️
src/services/repo/useRepoRateLimitStatus.tsx 100.00% <100.00%> (ø)
src/services/repo/useRepoSettings.tsx 100.00% <100.00%> (ø)
src/services/repo/useRepoSettingsTeam.tsx 100.00% <100.00%> (ø)
...ces/uploadTokenRequired/useUploadTokenRequired.tsx 100.00% <100.00%> (ø)
... and 2 more

... and 13 files with indirect coverage changes

Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.69% <ø> (ø)
Pages 98.26% <ø> (ø)
Services 99.34% <100.00%> (+0.06%) ⬆️
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 51d4fd5...9860d95. 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.69%. Comparing base (51d4fd5) to head (9860d95).
Report is 2 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3768      +/-   ##
==========================================
+ Coverage   98.68%   98.69%   +0.01%     
==========================================
  Files         825      825              
  Lines       14832    14826       -6     
  Branches     4250     4250              
==========================================
- Hits        14637    14633       -4     
+ Misses        188      186       -2     
  Partials        7        7              
Files with missing lines Coverage Δ
src/services/repo/useRepoComponentsSelect.tsx 100.00% <100.00%> (ø)
src/services/repo/useRepoConfig.tsx 100.00% <100.00%> (ø)
src/services/repo/useRepoCoverage.tsx 100.00% <100.00%> (ø)
src/services/repo/useRepoFlags.tsx 100.00% <100.00%> (ø)
src/services/repo/useRepoFlagsSelect.tsx 100.00% <100.00%> (ø)
src/services/repo/useRepoOverview.tsx 100.00% <100.00%> (+3.33%) ⬆️
src/services/repo/useRepoRateLimitStatus.tsx 100.00% <100.00%> (ø)
src/services/repo/useRepoSettings.tsx 100.00% <100.00%> (ø)
src/services/repo/useRepoSettingsTeam.tsx 100.00% <100.00%> (ø)
...ces/uploadTokenRequired/useUploadTokenRequired.tsx 100.00% <100.00%> (ø)
... and 2 more

... and 13 files with indirect coverage changes

Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.69% <ø> (ø)
Pages 98.26% <ø> (ø)
Services 99.34% <100.00%> (+0.06%) ⬆️
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 51d4fd5...9860d95. 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.69%. Comparing base (51d4fd5) to head (db41e3c).

✅ All tests successful. No failed tests found.

@@            Coverage Diff             @@
##             main    #3768      +/-   ##
==========================================
+ Coverage   98.68%   98.69%   +0.01%     
==========================================
  Files         825      825              
  Lines       14832    14827       -5     
  Branches     4242     4242              
==========================================
- Hits        14637    14634       -3     
+ Misses        188      186       -2     
  Partials        7        7              
Files with missing lines Coverage Δ
src/services/repo/useRepoComponentsSelect.tsx 100.00% <100.00%> (ø)
src/services/repo/useRepoConfig.tsx 100.00% <100.00%> (ø)
src/services/repo/useRepoCoverage.tsx 100.00% <100.00%> (ø)
src/services/repo/useRepoFlags.tsx 100.00% <100.00%> (ø)
src/services/repo/useRepoFlagsSelect.tsx 100.00% <100.00%> (ø)
src/services/repo/useRepoOverview.tsx 100.00% <100.00%> (+3.33%) ⬆️
src/services/repo/useRepoRateLimitStatus.tsx 100.00% <100.00%> (ø)
src/services/repo/useRepoSettings.tsx 100.00% <100.00%> (ø)
src/services/repo/useRepoSettingsTeam.tsx 100.00% <100.00%> (ø)
...ces/uploadTokenRequired/useUploadTokenRequired.tsx 100.00% <100.00%> (ø)
... and 2 more
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.69% <ø> (ø)
Pages 98.26% <ø> (ø)
Services 99.34% <100.00%> (+0.06%) ⬆️
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 51d4fd5...db41e3c. 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
d3ff313 Mon, 24 Feb 2025 19:25:09 GMT Expired Expired
db41e3c Tue, 25 Feb 2025 11:51:29 GMT Expired Expired
9860d95 Tue, 25 Feb 2025 13:24:15 GMT Cloud Enterprise

return rejectNetworkError({
errorName: 'Parsing Error',
errorDetails: {
callingFn: 'fetchRepoSettingsDetails',
Copy link
Contributor

Choose a reason for hiding this comment

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

General comment -> What do we think about making this a const so we don't accidentally misspell it for one of these rejectNetworkError calls?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just playing around with this a bit, instead I think we can actually use the function definition, and the name property from it. That way it's typesafe as we're accessing properties off of the function declaration and no magic strings. Sadly there's no way to infer this from the calling function.

Copy link
Contributor Author

@nicholas-codecov nicholas-codecov Feb 25, 2025

Choose a reason for hiding this comment

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

Actually nvm, that won't work. Minification will change the function names and in turn the name property on the function. This would probably also prevent us from trying to magically infer the name as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea we can do that, however I'll do that in a follow up PR and adjust the previous changes that I have already made, and continue with this going forward.

@nicholas-codecov nicholas-codecov added this pull request to the merge queue Feb 25, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 25, 2025
@nicholas-codecov nicholas-codecov added this pull request to the merge queue Feb 25, 2025
Merged via the queue into main with commit 88989bb Feb 25, 2025
62 checks passed
@nicholas-codecov nicholas-codecov deleted the gh-eng-3329-add-reject-network-error-to-calls-part-four branch February 25, 2025 13:51
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