Skip to content

feat: Default to All branches when default branch has no commits - Round 2 - #2449

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

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

Conversation

@nicholas-codecov

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-public-qa

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

Copy link
Copy Markdown

Codecov Report

Merging #2449 (fb7d6d5) into main (2dc6e67) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2449   +/-   ##
=======================================
  Coverage   98.09%   98.09%           
=======================================
  Files         766      767    +1     
  Lines        9753     9786   +33     
  Branches     2419     2430   +11     
=======================================
+ Hits         9567     9600   +33     
  Misses        184      184           
  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.96% <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 2dc6e67...fb7d6d5. Read the comment docs.

@codecov-qa

codecov-qa Bot commented Dec 11, 2023 •

Copy link
Copy Markdown

Codecov Report

Merging #2449 (fb7d6d5) into main (2dc6e67) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2449   +/-   ##
=======================================
  Coverage   98.09%   98.09%           
=======================================
  Files         766      767    +1     
  Lines        9753     9786   +33     
  Branches     2465     2479   +14     
=======================================
+ Hits         9567     9600   +33     
  Misses        184      184           
  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.96% <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 2dc6e67...fb7d6d5. Read the comment docs.

@codecov

codecov Bot commented Dec 11, 2023 •

Copy link
Copy Markdown

Codecov Report

Merging #2449 (fb7d6d5) into main (2dc6e67) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #2449     +/-   ##
=======================================
+ Coverage   98.09   98.10   +0.01     
=======================================
  Files        766     767      +1     
  Lines       9753    9786     +33     
  Branches    2465    2479     +14     
=======================================
+ Hits        9567    9600     +33     
  Misses       184     184             
  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.96% <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 2dc6e67...fb7d6d5. Read the comment docs.

@netlify

netlify Bot commented Dec 11, 2023 •

Copy link
Copy Markdown

✅ Deploy Preview for gazebo-staging ready!

Name Link
🔨 Latest commit fb7d6d5
🔍 Latest deploy log https://app.netlify.com/sites/gazebo-staging/deploys/65788d268a742b0008a07f52
😎 Deploy Preview https://deploy-preview-2449--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 merged commit 2751fa4 into main Dec 12, 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 12, 2023 17:10
rohitvinnakota-codecov pushed a commit that referenced this pull request Dec 12, 2023
…und 2 (#2449)

Default to `All branches` on commits page when default branch has no commits, attempt number 2.

GH codecov/engineering-team#870
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