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

fix: Seperate org name from error banner on 404 page #3525

Conversation

nicholas-codecov
Copy link
Contributor

@nicholas-codecov nicholas-codecov commented Nov 25, 2024

Description

This PR updates a couple things in the BaseLayout, Header, Navigator, and GlobalTopBanners to maintain previously resolved issues, and codecov/engineering-team#2830.

Closes codecov/engineering-team#2830

Notable Changes

  • Create new hook to determine information for the Navigator component
  • Update logic in the Navigator to handle new cases
    • Repo Page
      • User has access to repo -> render breadcrumb
      • User and Owner exist but private repo -> render context switcher (so they can escape)
      • None of the above -> render nothing (there is the guest header as their escape hatch)
    • Any page when the user is not logged in and owner does exist
      • Render the context switcher
    • User not logged in and org doesn't exist -> don't render anything (guest header is the escape hatch)
  • Wrap each banner in GlobalTopBanners to have their own SilentNetworkErrorWrapper
  • Fetch data, and pass down from BaseLayout
  • Create/Update tests
    • Had to rework the wrapper in the Navigator tests as paths were being rendered even if they didn't match

Screenshots

Updated private repo page

Screenshot 2024-11-25 at 09 32 34

@codecov-staging
Copy link

codecov-staging bot commented Nov 25, 2024

Bundle Report

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

Detailed changes
Bundle name Size Change
gazebo-staging-system-esm 5.71MB 10.14kB (-0.18%) ⬇️
gazebo-staging-system 5.66MB 10.86kB (-0.19%) ⬇️

Copy link

codecov bot commented Nov 25, 2024

Bundle Report

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

Detailed changes
Bundle name Size Change
gazebo-production-system 5.66MB 10.86kB (-0.19%) ⬇️
gazebo-production-system-esm 5.71MB 10.14kB (-0.18%) ⬇️

@codecov-qa
Copy link

codecov-qa bot commented Nov 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.90%. Comparing base (67b950a) to head (76a076e).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3525      +/-   ##
==========================================
- Coverage   98.92%   98.90%   -0.02%     
==========================================
  Files         806      807       +1     
  Lines       14447    14476      +29     
  Branches     4098     4109      +11     
==========================================
+ Hits        14291    14318      +27     
- Misses        149      151       +2     
  Partials        7        7              
Files with missing lines Coverage Δ
src/layouts/BaseLayout/BaseLayout.tsx 100.00% <100.00%> (ø)
...layouts/BaseLayout/hooks/NavigatorDataQueryOpts.ts 100.00% <100.00%> (ø)
src/layouts/Header/Header.tsx 100.00% <100.00%> (ø)
.../layouts/Header/components/Navigator/Navigator.tsx 97.22% <100.00%> (-2.78%) ⬇️
src/shared/GlobalTopBanners/GlobalTopBanners.tsx 100.00% <ø> (ø)
src/ui/ContextSwitcher/ContextSwitcher.jsx 97.95% <100.00%> (-2.05%) ⬇️
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <100.00%> (-0.29%) ⬇️
Pages 98.59% <ø> (ø)
Services 99.33% <ø> (ø)
Shared 99.33% <ø> (ø)
UI 99.14% <100.00%> (-0.08%) ⬇️

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 67b950a...76a076e. Read the comment docs.

Copy link

codecov bot commented Nov 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.90%. Comparing base (67b950a) to head (76a076e).
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    #3525      +/-   ##
==========================================
- Coverage   98.92%   98.90%   -0.02%     
==========================================
  Files         806      807       +1     
  Lines       14447    14476      +29     
  Branches     4098     4109      +11     
==========================================
+ Hits        14291    14318      +27     
- Misses        149      151       +2     
  Partials        7        7              
Files with missing lines Coverage Δ
src/layouts/BaseLayout/BaseLayout.tsx 100.00% <100.00%> (ø)
...layouts/BaseLayout/hooks/NavigatorDataQueryOpts.ts 100.00% <100.00%> (ø)
src/layouts/Header/Header.tsx 100.00% <100.00%> (ø)
.../layouts/Header/components/Navigator/Navigator.tsx 97.22% <100.00%> (-2.78%) ⬇️
src/shared/GlobalTopBanners/GlobalTopBanners.tsx 100.00% <ø> (ø)
src/ui/ContextSwitcher/ContextSwitcher.jsx 97.95% <100.00%> (-2.05%) ⬇️
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <100.00%> (-0.29%) ⬇️
Pages 98.59% <ø> (ø)
Services 99.33% <ø> (ø)
Shared 99.33% <ø> (ø)
UI 99.14% <100.00%> (-0.08%) ⬇️

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 67b950a...76a076e. Read the comment docs.

@codecov-releaser
Copy link
Contributor

codecov-releaser commented Nov 25, 2024

✅ Deploy preview for gazebo ready!

Previews expire after 1 month automatically.

Storybook

Commit Created Cloud Enterprise
e326a30 Mon, 25 Nov 2024 13:22:58 GMT Expired Expired
9b21dfc Mon, 25 Nov 2024 13:29:05 GMT Expired Expired
581a69e Mon, 25 Nov 2024 13:45:33 GMT Expired Expired
514500e Mon, 25 Nov 2024 15:02:31 GMT Expired Expired
3702525 Mon, 25 Nov 2024 16:10:57 GMT Expired Expired
074001d Wed, 27 Nov 2024 17:08:23 GMT Expired Expired
5bb65c4 Thu, 28 Nov 2024 11:45:06 GMT Expired Expired
4a29705 Mon, 02 Dec 2024 16:21:15 GMT Expired Expired
76a076e Mon, 02 Dec 2024 16:51:51 GMT Cloud Enterprise

Comment on lines +17 to +43
<SilentNetworkErrorWrapper>
<OktaBanners />
</SilentNetworkErrorWrapper>

<SilentNetworkErrorWrapper>
<RequestInstallBanner />
</SilentNetworkErrorWrapper>

<SilentNetworkErrorWrapper>
<TrialBanner />
</SilentNetworkErrorWrapper>

<SilentNetworkErrorWrapper>
<TeamPlanFeedbackBanner />
</SilentNetworkErrorWrapper>

<SilentNetworkErrorWrapper>
<ProPlanFeedbackBanner />
</SilentNetworkErrorWrapper>

<SilentNetworkErrorWrapper>
<BundleFeedbackBanner />
</SilentNetworkErrorWrapper>

<SilentNetworkErrorWrapper>
<TokenlessBanner />
</SilentNetworkErrorWrapper>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Switching this up, so that we're able to show some banners and not others, for instance if we're on a repo that the user needs to auth with Okta with, before this would just hide all the banners.

Comment on lines +70 to +87
// If the owner doesn't exist, don't show anything
if (!currentUser && ownerData) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the user is viewing an owner that doesn't exist, it just rendered the Avatar icon with a question mark, so just removing that entirely, but leaving in the user controls on the right hand side.

@codecov-notifications
Copy link

codecov-notifications bot commented Nov 25, 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    #3525      +/-   ##
==========================================
- Coverage   98.92%   98.90%   -0.02%     
==========================================
  Files         806      807       +1     
  Lines       14447    14476      +29     
  Branches     4105     4109       +4     
==========================================
+ Hits        14291    14318      +27     
- Misses        149      151       +2     
  Partials        7        7              
Files with missing lines Coverage Δ
src/layouts/BaseLayout/BaseLayout.tsx 100.00% <100.00%> (ø)
...layouts/BaseLayout/hooks/NavigatorDataQueryOpts.ts 100.00% <100.00%> (ø)
src/layouts/Header/Header.tsx 100.00% <100.00%> (ø)
.../layouts/Header/components/Navigator/Navigator.tsx 97.22% <100.00%> (-2.78%) ⬇️
src/shared/GlobalTopBanners/GlobalTopBanners.tsx 100.00% <ø> (ø)
src/ui/ContextSwitcher/ContextSwitcher.jsx 97.95% <100.00%> (-2.05%) ⬇️
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <100.00%> (-0.29%) ⬇️
Pages 98.59% <ø> (ø)
Services 99.33% <ø> (ø)
Shared 99.33% <ø> (ø)
UI 99.14% <100.00%> (-0.08%) ⬇️

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 67b950a...76a076e. Read the comment docs.

Copy link
Contributor

@spalmurray-codecov spalmurray-codecov left a comment

Choose a reason for hiding this comment

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

looks good. Seems like a lot of stuff is not covered according to my browser extension though

@nicholas-codecov nicholas-codecov force-pushed the gh-eng-2830-seperate-org-name-from-error-banner-on-404-page branch from 0d38341 to 074001d Compare November 27, 2024 16:53
@nicholas-codecov nicholas-codecov added this pull request to the merge queue Dec 2, 2024
Merged via the queue into main with commit 44255e7 Dec 2, 2024
58 of 62 checks passed
@nicholas-codecov nicholas-codecov deleted the gh-eng-2830-seperate-org-name-from-error-banner-on-404-page branch December 2, 2024 17:28
Copy link

sentry-io bot commented Dec 2, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ TypeError: NetworkError when attempting to fetch resource. /:provider/:owner/:repo/pull/:pullId View Issue
  • ‼️ TypeError: Importing a module script failed. /:provider/:owner/:repo View Issue
  • ‼️ TypeError: Failed to fetch /:provider/:owner/:repo View Issue
  • ‼️ TypeError: Load failed /:provider/:owner/:repo View Issue
  • ‼️ TypeError: Failed to fetch /github/codecov/worker/blob/main/services%2Fnot... View Issue

Did you find this useful? React with a 👍 or 👎

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.

[UX] Seperate org name from error banner on 404 page.
3 participants