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

ref: Rework RepoBreadcrumbContext so it's available in new header #3004

Merged
merged 4 commits into from
Jul 11, 2024

Conversation

spalmurray-codecov
Copy link
Contributor

@spalmurray-codecov spalmurray-codecov commented Jul 11, 2024

Refactors RepoBreadcrumbContext such that it is initialized above the Header on BaseLayout. The reason for this is because we are now rendering the breadcrumb in the header, we need access to the breadcrumb context up in the header.

Screenshot 2024-07-11 at 09 53 30

</main>
</NetworkErrorBoundary>
</ErrorBoundary>
<RepoBreadcrumbProvider>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need access to the breadcrumb context inside of Header on line 82, so I've moved it up from RepoPage to here.

import { useCrumbs } from 'pages/RepoPage/context'
import Breadcrumb from 'ui/Breadcrumb'

function Navigator() {
Copy link
Contributor Author

@spalmurray-codecov spalmurray-codecov Jul 11, 2024

Choose a reason for hiding this comment

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

This is still a work in progress. Can ignore

@@ -245,6 +246,27 @@ function RepoPage() {
refetchOnWindowFocus: refetchEnabled,
},
})
const { setBaseCrumbs } = useCrumbs()
Copy link
Contributor Author

@spalmurray-codecov spalmurray-codecov Jul 11, 2024

Choose a reason for hiding this comment

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

We don't have the Repo until the RepoPage is visited, so we populate the repo in the context only once we get here with setBaseCrumbs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've converted this to TS and reworked how the context is done. Same general idea as before, except we allow baseCrumbs to be set by the consumer as we don't yet have a repo when this context is loaded.

@spalmurray-codecov spalmurray-codecov marked this pull request as ready for review July 11, 2024 13:59
@codecov-staging
Copy link

codecov-staging bot commented Jul 11, 2024

Bundle Report

Changes will decrease total bundle size by 1.05kB ⬇️

Bundle name Size Change
gazebo-staging-array-push 6.09MB 1.05kB ⬇️

Copy link

codecov bot commented Jul 11, 2024

Bundle Report

Changes will decrease total bundle size by 1.05kB ⬇️

Bundle name Size Change
gazebo-production-array-push 6.09MB 1.05kB ⬇️

@spalmurray-codecov spalmurray-codecov force-pushed the spalmurray/refactor-repo-breadcrumb-context branch from 6fe2e83 to eec9bf8 Compare July 11, 2024 14:05
@codecov-qa
Copy link

codecov-qa bot commented Jul 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.33%. Comparing base (ad5760d) to head (bed1e37).

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3004   +/-   ##
=======================================
  Coverage   98.33%   98.33%           
=======================================
  Files         906      907    +1     
  Lines       13426    13429    +3     
  Branches     3593     3522   -71     
=======================================
+ Hits        13202    13205    +3     
  Misses        219      219           
  Partials        5        5           
Files Coverage Δ
src/layouts/BaseLayout/BaseLayout.jsx 96.42% <100.00%> (ø)
src/layouts/Header/Header.tsx 100.00% <ø> (ø)
.../layouts/Header/components/Navigator/Navigator.tsx 100.00% <100.00%> (ø)
src/pages/RepoPage/CommitsTab/CommitsTab.jsx 100.00% <100.00%> (ø)
...poPage/CoverageTab/OverviewTab/Summary/Summary.jsx 100.00% <100.00%> (ø)
...ab/OverviewTab/SummaryTeamPlan/SummaryTeamPlan.tsx 100.00% <100.00%> (ø)
src/pages/RepoPage/PullsTab/PullsTab.tsx 100.00% <100.00%> (ø)
src/pages/RepoPage/RepoBreadcrumb.jsx 100.00% <100.00%> (ø)
src/pages/RepoPage/RepoPage.tsx 100.00% <100.00%> (ø)
src/pages/RepoPage/context.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 53.84% <ø> (ø)
Layouts 97.60% <100.00%> (+0.03%) ⬆️
Pages 99.12% <100.00%> (-0.01%) ⬇️
Services 99.47% <ø> (ø)
Shared 99.69% <ø> (ø)
UI 94.26% <ø> (ø)

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 ad5760d...bed1e37. Read the comment docs.

Copy link

codecov-public-qa bot commented Jul 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.33%. Comparing base (ad5760d) to head (bed1e37).

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3004   +/-   ##
=======================================
  Coverage   98.33%   98.33%           
=======================================
  Files         906      907    +1     
  Lines       13426    13429    +3     
  Branches     3588     3594    +6     
=======================================
+ Hits        13202    13205    +3     
  Misses        219      219           
  Partials        5        5           
Files Coverage Δ
src/layouts/BaseLayout/BaseLayout.jsx 96.42% <100.00%> (ø)
src/layouts/Header/Header.tsx 100.00% <ø> (ø)
.../layouts/Header/components/Navigator/Navigator.tsx 100.00% <100.00%> (ø)
src/pages/RepoPage/CommitsTab/CommitsTab.jsx 100.00% <100.00%> (ø)
...poPage/CoverageTab/OverviewTab/Summary/Summary.jsx 100.00% <100.00%> (ø)
...ab/OverviewTab/SummaryTeamPlan/SummaryTeamPlan.tsx 100.00% <100.00%> (ø)
src/pages/RepoPage/PullsTab/PullsTab.tsx 100.00% <100.00%> (ø)
src/pages/RepoPage/RepoBreadcrumb.jsx 100.00% <100.00%> (ø)
src/pages/RepoPage/RepoPage.tsx 100.00% <100.00%> (ø)
src/pages/RepoPage/context.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 53.84% <ø> (ø)
Layouts 97.60% <100.00%> (+0.03%) ⬆️
Pages 99.12% <100.00%> (-0.01%) ⬇️
Services 99.47% <ø> (ø)
Shared 99.69% <ø> (ø)
UI 94.26% <ø> (ø)

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 ad5760d...bed1e37. Read the comment docs.

@codecov-notifications
Copy link

codecov-notifications bot commented Jul 11, 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    #3004   +/-   ##
=======================================
  Coverage   98.33%   98.33%           
=======================================
  Files         906      907    +1     
  Lines       13426    13429    +3     
  Branches     3588     3522   -66     
=======================================
+ Hits        13202    13205    +3     
  Misses        219      219           
  Partials        5        5           
Files Coverage Δ
src/layouts/BaseLayout/BaseLayout.jsx 96.42% <100.00%> (ø)
src/layouts/Header/Header.tsx 100.00% <ø> (ø)
.../layouts/Header/components/Navigator/Navigator.tsx 100.00% <100.00%> (ø)
src/pages/RepoPage/CommitsTab/CommitsTab.jsx 100.00% <100.00%> (ø)
...poPage/CoverageTab/OverviewTab/Summary/Summary.jsx 100.00% <100.00%> (ø)
...ab/OverviewTab/SummaryTeamPlan/SummaryTeamPlan.tsx 100.00% <100.00%> (ø)
src/pages/RepoPage/PullsTab/PullsTab.tsx 100.00% <100.00%> (ø)
src/pages/RepoPage/RepoBreadcrumb.jsx 100.00% <100.00%> (ø)
src/pages/RepoPage/RepoPage.tsx 100.00% <100.00%> (ø)
src/pages/RepoPage/context.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 53.84% <ø> (ø)
Layouts 97.60% <100.00%> (+0.03%) ⬆️
Pages 99.12% <100.00%> (-0.01%) ⬇️
Services 99.47% <ø> (ø)
Shared 99.69% <ø> (ø)
UI 94.26% <ø> (ø)

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 ad5760d...bed1e37. Read the comment docs.

Copy link

codecov bot commented Jul 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.33%. Comparing base (ad5760d) to head (bed1e37).

✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##               main      #3004   +/-   ##
===========================================
  Coverage   98.33000   98.33000           
===========================================
  Files           906        907    +1     
  Lines         13426      13429    +3     
  Branches       3588       3589    +1     
===========================================
+ Hits          13202      13205    +3     
  Misses          219        219           
  Partials          5          5           
Files Coverage Δ
src/layouts/BaseLayout/BaseLayout.jsx 96.42% <100.00%> (ø)
src/layouts/Header/Header.tsx 100.00% <ø> (ø)
.../layouts/Header/components/Navigator/Navigator.tsx 100.00% <100.00%> (ø)
src/pages/RepoPage/CommitsTab/CommitsTab.jsx 100.00% <100.00%> (ø)
...poPage/CoverageTab/OverviewTab/Summary/Summary.jsx 100.00% <100.00%> (ø)
...ab/OverviewTab/SummaryTeamPlan/SummaryTeamPlan.tsx 100.00% <100.00%> (ø)
src/pages/RepoPage/PullsTab/PullsTab.tsx 100.00% <100.00%> (ø)
src/pages/RepoPage/RepoBreadcrumb.jsx 100.00% <100.00%> (ø)
src/pages/RepoPage/RepoPage.tsx 100.00% <100.00%> (ø)
src/pages/RepoPage/context.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 53.84% <ø> (ø)
Layouts 97.60% <100.00%> (+0.03%) ⬆️
Pages 99.12% <100.00%> (-0.01%) ⬇️
Services 99.47% <ø> (ø)
Shared 99.69% <ø> (ø)
UI 94.26% <ø> (ø)

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 ad5760d...bed1e37. Read the comment docs.

@codecov-releaser
Copy link
Contributor

codecov-releaser commented Jul 11, 2024

✅ Deploy preview for gazebo ready!

Previews expire after 1 month automatically.

Storybook

Commit Created Cloud Enterprise
eec9bf8 Thu, 11 Jul 2024 14:11:59 GMT Expired Expired
eec9bf8 Thu, 11 Jul 2024 14:15:40 GMT Expired Expired
bed1e37 Thu, 11 Jul 2024 17:37:36 GMT Cloud Enterprise

Copy link
Contributor

@nicholas-codecov nicholas-codecov left a comment

Choose a reason for hiding this comment

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

Two things too peak at, looks all good

@spalmurray-codecov spalmurray-codecov added this pull request to the merge queue Jul 11, 2024
Merged via the queue into main with commit 0a326dc Jul 11, 2024
61 checks passed
@spalmurray-codecov spalmurray-codecov deleted the spalmurray/refactor-repo-breadcrumb-context branch July 11, 2024 17:59
Copy link

sentry-io bot commented Jul 12, 2024

Suspect Issues

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

  • ‼️ SyntaxError: Unexpected token '<', "<!doctype "... is not valid JSON /gh/doordash/asgard/pull/22636/flags View Issue
  • ‼️ SyntaxError: Unexpected token '<', "<!doctype "... is not valid JSON /gh/doordash/web/pull/85284/flags 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.

3 participants