Skip to content

feat: Default to All branches when default branch has no commits - #2446

Merged
nicholas-codecov merged 4 commits into
mainfrom
gh-eng-870-default-to-all-branches-when-no-coverage-on-default-branch-on-commits-page
Dec 11, 2023
Merged

nicholas-codecov merged 4 commits into
mainfrom
gh-eng-870-default-to-all-branches-when-no-coverage-on-default-branch-on-commits-page

Conversation

@nicholas-codecov

@nicholas-codecov nicholas-codecov commented Dec 8, 2023 •

Copy link
Copy Markdown
Contributor

Description

This PR makes it so that when you visit the commits tab of a repo whose default branch has no commits it will swap over to the All branches option by updating the query params on the initial render, so users can force their way back to the default branch if they wish to investigate further.

Closes codecov/engineering-team#870

Notable Changes

  • Add new useBranchHasCommits hook
  • Update CommitsTab to swap to All branches when default branch has no commits only on initial render.

Screenshots

Screen.Recording.2023-12-08.at.10.35.02.mov

@codecov

codecov Bot commented Dec 8, 2023 •

Copy link
Copy Markdown

Codecov Report

Merging #2446 (6b237c4) into main (ef9d544) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #2446     +/-   ##
=======================================
+ Coverage   98.07   98.08   +0.01     
=======================================
  Files        763     764      +1     
  Lines       9691    9724     +33     
  Branches    2397    2455     +58     
=======================================
+ Hits        9504    9537     +33     
  Misses       185     185             
  Partials       2       2             
Files Coverage Δ
src/pages/RepoPage/CommitsTab/CommitsTab.jsx 100.00% <100.00%> (ø)
src/services/branches/useBranchHasCommits.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 59.37% <ø> (ø)
Layouts 97.30% <ø> (ø)
Pages 98.92% <100.00%> (+<0.01%) ⬆️
Services 99.44% <100.00%> (+<0.01%) ⬆️
Shared 99.81% <ø> (ø)
UI 94.32% <ø> (ø)

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 ef9d544...6b237c4. Read the comment docs.

@codecov-qa

codecov-qa Bot commented Dec 8, 2023 •

Copy link
Copy Markdown

Codecov Report

Merging #2446 (6b237c4) into main (ef9d544) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2446   +/-   ##
=======================================
  Coverage   98.07%   98.07%           
=======================================
  Files         763      764    +1     
  Lines        9691     9724   +33     
  Branches     2397     2436   +39     
=======================================
+ Hits         9504     9537   +33     
  Misses        185      185           
  Partials        2        2           
Files Coverage Δ
src/pages/RepoPage/CommitsTab/CommitsTab.jsx 100.00% <100.00%> (ø)
src/services/branches/useBranchHasCommits.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 59.37% <ø> (ø)
Layouts 97.30% <ø> (ø)
Pages 98.92% <100.00%> (+<0.01%) ⬆️
Services 99.44% <100.00%> (+<0.01%) ⬆️
Shared 99.81% <ø> (ø)
UI 94.32% <ø> (ø)

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 ef9d544...6b237c4. Read the comment docs.

@codecov-public-qa

codecov-public-qa Bot commented Dec 8, 2023 •

Copy link
Copy Markdown

Codecov Report

Merging #2446 (6b237c4) into main (ef9d544) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2446   +/-   ##
=======================================
  Coverage   98.07%   98.07%           
=======================================
  Files         763      764    +1     
  Lines        9691     9724   +33     
  Branches     2441     2450    +9     
=======================================
+ Hits         9504     9537   +33     
  Misses        185      185           
  Partials        2        2           
Files Coverage Δ
src/pages/RepoPage/CommitsTab/CommitsTab.jsx 100.00% <100.00%> (ø)
src/services/branches/useBranchHasCommits.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 59.37% <ø> (ø)
Layouts 97.30% <ø> (ø)
Pages 98.92% <100.00%> (+<0.01%) ⬆️
Services 99.44% <100.00%> (+<0.01%) ⬆️
Shared 99.81% <ø> (ø)
UI 94.32% <ø> (ø)

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 ef9d544...6b237c4. Read the comment docs.

@netlify

netlify Bot commented Dec 8, 2023 •

Copy link
Copy Markdown

✅ Deploy Preview for gazebo-staging ready!

Name Link
🔨 Latest commit 6b237c4
🔍 Latest deploy log https://app.netlify.com/sites/gazebo-staging/deploys/65776393124c1500083bf91e
😎 Deploy Preview https://deploy-preview-2446--gazebo-staging.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@nicholas-codecov
nicholas-codecov force-pushed the gh-eng-870-default-to-all-branches-when-no-coverage-on-default-branch-on-commits-page branch from 1d69c8d to 1a54a56 Compare December 11, 2023 18:22

@codecov codecov Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The git diff provides an overall decent implementation, but there are a few key areas that need improvement or clarification. The main issues include hard-coded string values for data comparison, the use of low-level hooks, potential over-fetching of data, and a lack of clear error handling.

@nicholas-codecov
nicholas-codecov merged commit df16311 into main Dec 11, 2023
@nicholas-codecov
nicholas-codecov deleted the gh-eng-870-default-to-all-branches-when-no-coverage-on-default-branch-on-commits-page branch December 11, 2023 19:38
@nicholas-codecov
nicholas-codecov restored the gh-eng-870-default-to-all-branches-when-no-coverage-on-default-branch-on-commits-page branch December 11, 2023 19:45
nicholas-codecov pushed a commit that referenced this pull request Dec 11, 2023
nicholas-codecov pushed a commit that referenced this pull request Dec 11, 2023
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.

The commits page doesn't default to "All branches" if coverage isn't on the default branch

3 participants