Skip to content

Conversation

@nicholas-codecov
Copy link
Contributor

Description

This PR cleans up the current pulls table removing the project coverage, coverage from base columns, and team versions of these tables. This PR also updates the patch and bundle columns to render their status: COMPLETED, ERROR, or PENDING to better inform the user.

codecov/engineering-team#1497

Notable Changes

  • Remove team version of pulls table and usePulls
  • Bump react intersection package
  • Remove project coverage, coverage from base columns
  • Remove Team versions

Screenshots

Before:

Screenshot 2024-06-10 at 07 43 51

After:

Screenshot 2024-06-10 at 07 38 23

@nicholas-codecov nicholas-codecov force-pushed the gh-eng-1497-updates-to-pulls-table branch from 267d97f to f8119d6 Compare June 10, 2024 10:51
@codecov-qa
Copy link

codecov-qa bot commented Jun 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.39%. Comparing base (4976bf6) to head (858eeeb).

Current head 858eeeb differs from pull request most recent head f40908d

Please upload reports for the commit f40908d to get more accurate results.

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2934      +/-   ##
==========================================
+ Coverage   98.37%   98.39%   +0.01%     
==========================================
  Files         885      877       -8     
  Lines       13062    12931     -131     
  Branches     3481     3384      -97     
==========================================
- Hits        12850    12723     -127     
+ Misses        208      204       -4     
  Partials        4        4              
Files Coverage Δ
src/pages/RepoPage/PullsTab/PullsTab.tsx 100.00% <100.00%> (ø)
.../pages/RepoPage/PullsTab/PullsTable/PullsTable.tsx 100.00% <100.00%> (ø)
...pages/RepoPage/PullsTab/PullsTable/Title/Title.tsx 100.00% <ø> (ø)
...oPage/PullsTab/PullsTable/createPullsTableData.tsx 100.00% <100.00%> (ø)
src/services/pulls/usePulls.tsx 100.00% <100.00%> (ø)

... and 11 files with indirect coverage changes

Components Coverage Δ
Assets 53.84% <ø> (ø)
Layouts 97.22% <ø> (ø)
Pages 99.22% <100.00%> (+0.04%) ⬆️
Services 99.45% <100.00%> (-0.01%) ⬇️
Shared 99.68% <ø> (ø)
UI 94.58% <ø> (-0.15%) ⬇️

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 4976bf6...f40908d. Read the comment docs.

@codecov-notifications
Copy link

codecov-notifications bot commented Jun 10, 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    #2934      +/-   ##
==========================================
- Coverage   98.37%   98.35%   -0.03%     
==========================================
  Files         885      880       -5     
  Lines       13062    12972      -90     
  Branches     3481     3454      -27     
==========================================
- Hits        12850    12758      -92     
- Misses        208      210       +2     
  Partials        4        4              
Files Coverage Δ
...CommitsTab/CommitsTable/createCommitsTableData.tsx 93.93% <100.00%> (ø)
.../RepoPage/CommitsTab/CommitsTable/CommitsTable.tsx 100.00% <ø> (ø)
...CommitsTab/CommitsTable/createCommitsTableData.tsx 93.93% <100.00%> (ø)
src/pages/RepoPage/PullsTab/PullsTab.tsx 100.00% <100.00%> (ø)
.../pages/RepoPage/PullsTab/PullsTable/PullsTable.tsx 100.00% <100.00%> (ø)
...pages/RepoPage/PullsTab/PullsTable/Title/Title.tsx 100.00% <ø> (ø)
...oPage/PullsTab/PullsTable/createPullsTableData.tsx 100.00% <100.00%> (ø)
src/services/commits/useCommits.tsx 100.00% <100.00%> (ø)
src/services/pulls/usePulls.tsx 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

Components Coverage Δ
Assets 53.84% <ø> (ø)
Layouts 97.22% <ø> (ø)
Pages 99.16% <100.00%> (-0.01%) ⬇️
Services 99.45% <100.00%> (-0.01%) ⬇️
Shared 99.68% <ø> (ø)
UI 94.57% <ø> (-0.16%) ⬇️

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 4976bf6...f40908d. Read the comment docs.

@codecov-public-qa
Copy link

codecov-public-qa bot commented Jun 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.35%. Comparing base (4976bf6) to head (f40908d).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found ☺️

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2934      +/-   ##
==========================================
- Coverage   98.37%   98.35%   -0.03%     
==========================================
  Files         885      880       -5     
  Lines       13062    12972      -90     
  Branches     3463     3436      -27     
==========================================
- Hits        12850    12758      -92     
- Misses        208      210       +2     
  Partials        4        4              
Files Coverage Δ
...CommitsTab/CommitsTable/createCommitsTableData.tsx 93.93% <100.00%> (ø)
.../RepoPage/CommitsTab/CommitsTable/CommitsTable.tsx 100.00% <ø> (ø)
...CommitsTab/CommitsTable/createCommitsTableData.tsx 93.93% <100.00%> (ø)
src/pages/RepoPage/PullsTab/PullsTab.tsx 100.00% <100.00%> (ø)
.../pages/RepoPage/PullsTab/PullsTable/PullsTable.tsx 100.00% <100.00%> (ø)
...pages/RepoPage/PullsTab/PullsTable/Title/Title.tsx 100.00% <ø> (ø)
...oPage/PullsTab/PullsTable/createPullsTableData.tsx 100.00% <100.00%> (ø)
src/services/commits/useCommits.tsx 100.00% <100.00%> (ø)
src/services/pulls/usePulls.tsx 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

Components Coverage Δ
Assets 53.84% <ø> (ø)
Layouts 97.22% <ø> (ø)
Pages 99.16% <100.00%> (-0.01%) ⬇️
Services 99.45% <100.00%> (-0.01%) ⬇️
Shared 99.68% <ø> (ø)
UI 94.57% <ø> (-0.16%) ⬇️

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 4976bf6...f40908d. Read the comment docs.

@codecov-staging
Copy link

codecov-staging bot commented Jun 10, 2024

Bundle Report

Changes will decrease total bundle size by 22.8kB ⬇️

Bundle name Size Change
gazebo-staging-array-push 6.82MB 22.8kB ⬇️

@codecov
Copy link

codecov bot commented Jun 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.35%. Comparing base (4976bf6) to head (f40908d).
Report is 2 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@               Coverage Diff                @@
##               main      #2934        +/-   ##
================================================
- Coverage   98.37000   98.35000   -0.02000     
================================================
  Files           885        880         -5     
  Lines         13062      12972        -90     
  Branches       3463       3454         -9     
================================================
- Hits          12850      12758        -92     
- Misses          208        210         +2     
  Partials          4          4                
Files Coverage Δ
...CommitsTab/CommitsTable/createCommitsTableData.tsx 93.93% <100.00%> (ø)
.../RepoPage/CommitsTab/CommitsTable/CommitsTable.tsx 100.00% <ø> (ø)
...CommitsTab/CommitsTable/createCommitsTableData.tsx 93.93% <100.00%> (ø)
src/pages/RepoPage/PullsTab/PullsTab.tsx 100.00% <100.00%> (ø)
.../pages/RepoPage/PullsTab/PullsTable/PullsTable.tsx 100.00% <100.00%> (ø)
...pages/RepoPage/PullsTab/PullsTable/Title/Title.tsx 100.00% <ø> (ø)
...oPage/PullsTab/PullsTable/createPullsTableData.tsx 100.00% <100.00%> (ø)
src/services/commits/useCommits.tsx 100.00% <100.00%> (ø)
src/services/pulls/usePulls.tsx 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

Components Coverage Δ
Assets 53.84% <ø> (ø)
Layouts 97.22% <ø> (ø)
Pages 99.16% <100.00%> (-0.01%) ⬇️
Services 99.45% <100.00%> (-0.01%) ⬇️
Shared 99.68% <ø> (ø)
UI 94.57% <ø> (-0.16%) ⬇️

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 4976bf6...f40908d. Read the comment docs.

@codecov
Copy link

codecov bot commented Jun 10, 2024

Bundle Report

Changes will decrease total bundle size by 22.8kB ⬇️

Bundle name Size Change
gazebo-production-array-push 6.82MB 22.8kB ⬇️

@codecov-releaser
Copy link
Contributor

codecov-releaser commented Jun 10, 2024

✅ Deploy preview for gazebo ready!

Previews expire after 1 month automatically.

Storybook

Commit Created Cloud Enterprise
f8119d6 Mon, 10 Jun 2024 11:02:42 GMT Expired Expired
ed19b74 Mon, 10 Jun 2024 14:02:31 GMT Expired Expired
f26805a Tue, 11 Jun 2024 13:14:29 GMT Expired Expired
f26805a Tue, 11 Jun 2024 13:14:49 GMT Expired Expired
858eeeb Wed, 12 Jun 2024 17:36:20 GMT Expired Expired
f40908d Mon, 17 Jun 2024 18:42:31 GMT Cloud Enterprise

render(<PullsTable />, { wrapper: wrapper(queryClient) })

const bundleAnalysis = await screen.findByText('Upload: ')
const bundleAnalysis = await screen.findByText('Upload: ')
Copy link
Contributor

Choose a reason for hiding this comment

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

is the default this hourglass icon now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, not the default value. It's just reflective of the API response that's being mocked.

patch = pull?.compareWithBase?.patchTotals?.percentCovered ?? 0
change = pull?.compareWithBase?.changeCoverage ?? 0
let patch = <p>-</p>
if (pull?.head?.coverageStatus === 'ERROR') {
Copy link
Contributor

Choose a reason for hiding this comment

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

There an enum for these? 'ERROR', 'PENDING' and 'COMPLETED'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Don't really need it, the coverageStatus type is a union of string literals ERROR | PENDING | COMPLETED, so it'll error and fail the build if you change the return type. Also using strings directly like this is overall better for compression and smaller bundle sizes

Copy link
Contributor

Choose a reason for hiding this comment

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

overall better for compression and smaller bundle sizes

If you have a source on this, would love to read more about the magnitude of gains here.

with respect to it erroring on the build by changing the return type, I'm sure there is a way to update the zod schema to account for this type on either end even with an enum.

In any case, just a thought that may improve readability for some

Copy link
Contributor Author

@nicholas-codecov nicholas-codecov Jun 13, 2024

Choose a reason for hiding this comment

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

Here's an example PR of swapping to regular strings from the object style enum I believe you're talking about, and the savings in size: getsentry/sentry-javascript#4280.

A different concern with using the object syntax like we do in Gazebo (which I think we need to iterate on, and move away from) is that the field names themselves can not be minified. There are also issues with tree shaking that come up since we code split quite heavily so this also brings up issues with bundle sizes.

An alternative I'd be alright exploring would be something more along the lines of:

export const COMMIT_STATUS_COMPLETED = 'COMPLETED'
export const COMMIT_STATUS_ERROR = 'ERROR'
export const COMMIT_STATUS_PENDING = 'PENDING'

const CommitStatusSchema = z.union([
  z.literal(COMMIT_STATUS_COMPLETED),
  z.literal(COMMIT_STATUS_ERROR),
  z.literal(COMMIT_STATUS_PENDING),
])

Copy link
Contributor

Choose a reason for hiding this comment

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

Very neat! 2% savings definitely adds up over time, thanks for sharing that.

I think having a shared schema like that solves my original concern which is the improved readability, and we won't need the object syntax either. I'm all for it

bundleAnalysis = <>Upload: &#x274C;</>
const change =
pull?.bundleAnalysisCompareWithBase?.bundleChange?.size.uncompress
const content = `${change > 0 ? '+' : ''}${formatSizeToString(change)}`
Copy link
Contributor

Choose a reason for hiding this comment

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

if the change < 0, should we show a "-" sign?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

by default as a negative number the - is already present

Copy link
Contributor

Choose a reason for hiding this comment

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

ah okay makes sense, I wasn't sure since the "formatSizeToString" was taking the abs of the number

Looking at your screenshot that seems to be the case, just a little hard to parse atm

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh, no worries. formatSizeToString only abs the size to for the size checks to see if we can concatenate to a larger size (kB, MB, etc.) we than use the passed value directly in the format, rather than the absolute'ed value.

@nicholas-codecov nicholas-codecov force-pushed the gh-eng-1497-updates-to-pulls-table branch from 858eeeb to f40908d Compare June 17, 2024 18:11
@nicholas-codecov nicholas-codecov added this pull request to the merge queue Jun 17, 2024
Merged via the queue into main with commit 1e1966c Jun 17, 2024
@nicholas-codecov nicholas-codecov deleted the gh-eng-1497-updates-to-pulls-table branch June 17, 2024 18:22
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.

5 participants