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

chore: Migrate useCommitPageData to TSQ V5 #3537

Merged

Conversation

nicholas-codecov
Copy link
Contributor

Description

This PR updates the useCommitPageData hook to CommitPageDataQueryOpts following along with the new style of writing data fetching utils.

Ticket: codecov/engineering-team#2966

Notable Changes

  • Update useCommitPageData to CommitPageDataQueryOpts
  • Update tests

@codecov-staging
Copy link

codecov-staging bot commented Nov 28, 2024

Bundle Report

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

Detailed changes
Bundle name Size Change
gazebo-staging-system-esm 5.72MB 8.42kB (-0.15%) ⬇️
gazebo-staging-system 5.66MB 9.05kB (-0.16%) ⬇️

Copy link

codecov bot commented Nov 28, 2024

Bundle Report

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

Detailed changes
Bundle name Size Change
gazebo-production-system 5.66MB 9.05kB (-0.16%) ⬇️
gazebo-production-system-esm 5.72MB 8.42kB (-0.15%) ⬇️

Copy link

codecov bot commented Nov 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.90%. Comparing base (f399f75) to head (3dcc556).
Report is 7 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3537      +/-   ##
==========================================
- Coverage   98.91%   98.90%   -0.02%     
==========================================
  Files         806      807       +1     
  Lines       14443    14476      +33     
  Branches     4104     4116      +12     
==========================================
+ Hits        14287    14318      +31     
- Misses        149      151       +2     
  Partials        7        7              
Files with missing lines Coverage Δ
...Page/CommitBundleAnalysis/CommitBundleAnalysis.tsx 100.00% <100.00%> (ø)
...CommitDetailPage/CommitCoverage/CommitCoverage.jsx 100.00% <100.00%> (ø)
src/pages/CommitDetailPage/CommitDetailPage.tsx 100.00% <100.00%> (ø)
...mmitDetailPage/queries/CommitPageDataQueryOpts.tsx 100.00% <100.00%> (ø)

... and 20 files with indirect coverage changes

Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (-0.29%) ⬇️
Pages 98.59% <100.00%> (+<0.01%) ⬆️
Services 99.33% <ø> (ø)
Shared 99.33% <ø> (ø)
UI 99.14% <ø> (-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 f399f75...3dcc556. Read the comment docs.

@codecov-notifications
Copy link

codecov-notifications bot commented Nov 28, 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    #3537      +/-   ##
==========================================
- Coverage   98.91%   98.90%   -0.02%     
==========================================
  Files         806      807       +1     
  Lines       14443    14476      +33     
  Branches     4104     4116      +12     
==========================================
+ Hits        14287    14318      +31     
- Misses        149      151       +2     
  Partials        7        7              
Files with missing lines Coverage Δ
...Page/CommitBundleAnalysis/CommitBundleAnalysis.tsx 100.00% <100.00%> (ø)
...CommitDetailPage/CommitCoverage/CommitCoverage.jsx 100.00% <100.00%> (ø)
src/pages/CommitDetailPage/CommitDetailPage.tsx 100.00% <100.00%> (ø)
...mmitDetailPage/queries/CommitPageDataQueryOpts.tsx 100.00% <100.00%> (ø)

... and 20 files with indirect coverage changes

Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (-0.29%) ⬇️
Pages 98.59% <100.00%> (+<0.01%) ⬆️
Services 99.33% <ø> (ø)
Shared 99.33% <ø> (ø)
UI 99.14% <ø> (-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 f399f75...3dcc556. Read the comment docs.

@codecov-qa
Copy link

codecov-qa bot commented Nov 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.90%. Comparing base (f399f75) to head (3dcc556).
Report is 7 commits behind head on main.

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3537      +/-   ##
==========================================
- Coverage   98.91%   98.90%   -0.02%     
==========================================
  Files         806      807       +1     
  Lines       14443    14476      +33     
  Branches     4097     4109      +12     
==========================================
+ Hits        14287    14318      +31     
- Misses        149      151       +2     
  Partials        7        7              
Files with missing lines Coverage Δ
...Page/CommitBundleAnalysis/CommitBundleAnalysis.tsx 100.00% <100.00%> (ø)
...CommitDetailPage/CommitCoverage/CommitCoverage.jsx 100.00% <100.00%> (ø)
src/pages/CommitDetailPage/CommitDetailPage.tsx 100.00% <100.00%> (ø)
...mmitDetailPage/queries/CommitPageDataQueryOpts.tsx 100.00% <100.00%> (ø)

... and 20 files with indirect coverage changes

Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (-0.29%) ⬇️
Pages 98.59% <100.00%> (+<0.01%) ⬆️
Services 99.33% <ø> (ø)
Shared 99.33% <ø> (ø)
UI 99.14% <ø> (-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 f399f75...3dcc556. Read the comment docs.

@codecov-releaser
Copy link
Contributor

codecov-releaser commented Nov 28, 2024

✅ Deploy preview for gazebo ready!

Previews expire after 1 month automatically.

Storybook

Commit Created Cloud Enterprise
027d582 Thu, 28 Nov 2024 18:51:58 GMT Expired Expired
3dcc556 Tue, 03 Dec 2024 11:45:08 GMT Cloud Enterprise

Copy link
Contributor

@suejung-sentry suejung-sentry 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!

provider,
owner,
repo,
commitId: commitSha,
Copy link
Contributor

Choose a reason for hiding this comment

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

Unrelated question - Do you happen to know how pervasively we allow sha and id to be interchanged like it is here?

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 don't think it's too bad, but it is a symptom of the API argument for commit sha's being id, see:

query CommitPageData($owner: String!, $repo: String!, $commitId: String!) {
  owner(username: $owner) {
    isCurrentUserPartOfOrg
    repository(name: $repo) {
      __typename
      ... on Repository {
        private
        bundleAnalysisEnabled
        coverageEnabled
        commit(id: $commitId) { # <- should be sha imo
          commitid
          compareWithParent {
            __typename
          }
          bundleAnalysis {
            bundleAnalysisCompareWithParent {
              __typename
            }
          }
        }
      }
      ... on NotFoundError {
        message
      }
      ... on OwnerNotActivatedError {
        message
      }
    }
  }
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Gotcha, yeah I guess the api accepts both as the key. Thanks for looking at it!

@nicholas-codecov nicholas-codecov added this pull request to the merge queue Dec 3, 2024
Merged via the queue into main with commit 4ca8129 Dec 3, 2024
58 of 62 checks passed
@nicholas-codecov nicholas-codecov deleted the gh-eng-2966-migrate-use-commit-page-data-to-tsqv5 branch December 3, 2024 11:48
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.90%. Comparing base (f399f75) to head (3dcc556).
Report is 7 commits behind head on main.

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3537      +/-   ##
==========================================
- Coverage   98.91%   98.90%   -0.02%     
==========================================
  Files         806      807       +1     
  Lines       14443    14476      +33     
  Branches     4104     4109       +5     
==========================================
+ Hits        14287    14318      +31     
- Misses        149      151       +2     
  Partials        7        7              
Files with missing lines Coverage Δ
...Page/CommitBundleAnalysis/CommitBundleAnalysis.tsx 100.00% <100.00%> (ø)
...CommitDetailPage/CommitCoverage/CommitCoverage.jsx 100.00% <100.00%> (ø)
src/pages/CommitDetailPage/CommitDetailPage.tsx 100.00% <100.00%> (ø)
...mmitDetailPage/queries/CommitPageDataQueryOpts.tsx 100.00% <100.00%> (ø)

... and 20 files with indirect coverage changes

Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (-0.29%) ⬇️
Pages 98.59% <100.00%> (+<0.01%) ⬆️
Services 99.33% <ø> (ø)
Shared 99.33% <ø> (ø)
UI 99.14% <ø> (-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 f399f75...3dcc556. Read the comment docs.

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