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

feat: Update commit graphql queries to use new coverage and bundleAna… #3363

Merged
merged 4 commits into from
Oct 15, 2024

Conversation

calvin-codecov
Copy link
Contributor

@calvin-codecov calvin-codecov commented Oct 7, 2024

…lysis schemas

Description

Closes codecov/engineering-team#2285
Related to changes made in api at codecov/codecov-api#847 - TLDR: following fields in the Commit.graphql type were pulled out into another subtype.

components, flagNames, coverageFile and totals were moved down one level into coverageAnalytics
bundleAnalysisCompareWithParent and bundleAnalysisReport were moved down one level into bundleAnalysis.

The only changes made in this PR are adding in an extra level of nesting for these 6 fields in the Commit type.

Made changes to

  • type Repository's commit
  • type Branch's head
  • type Commit's parent
  • and type Pull's head
    , as they are all of type Commit, and their uses across the codebase.

*Type Pull's comparedTo did not use any of those fields so did not need any changes even though it is also of type Commit.

Code Example

Notable Changes

Screenshots

Link to Sample Entry

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

@codecov-staging
Copy link

codecov-staging bot commented Oct 7, 2024

Codecov Report

Attention: Patch coverage is 95.45455% with 1 line in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/services/bundleAnalysis/useBundleAssets.tsx 66.66% 1 Missing ⚠️

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3363   +/-   ##
=======================================
  Coverage   99.18%   99.18%           
=======================================
  Files         805      805           
  Lines       14232    14233    +1     
  Branches     3927     3927           
=======================================
+ Hits        14116    14117    +1     
  Misses        107      107           
  Partials        9        9           
Files with missing lines Coverage Δ
...mmitBundleAnalysis/BundleMessage/BundleMessage.tsx 100.00% <100.00%> (ø)
...Page/CommitBundleAnalysis/CommitBundleAnalysis.tsx 100.00% <100.00%> (ø)
...tBundleAnalysisTable/CommitBundleAnalysisTable.tsx 100.00% <100.00%> (ø)
...CommitCoverageSummary/hooks/useCommitForSummary.js 100.00% <100.00%> (ø)
...pages/CommitDetailPage/hooks/useCommitPageData.tsx 100.00% <ø> (ø)
...uestPage/PullBundleAnalysis/PullBundleAnalysis.tsx 100.00% <100.00%> (ø)
...alysis/PullBundleHeadTable/PullBundleHeadTable.tsx 100.00% <100.00%> (ø)
...Summary/CompareSummary/usePullForCompareSummary.js 100.00% <ø> (ø)
...CommitsTab/CommitsTable/createCommitsTableData.tsx 93.93% <100.00%> (ø)
...rc/pages/PullRequestPage/hooks/usePullPageData.tsx 100.00% <ø> (ø)
... and 24 more
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 100.00% <ø> (ø)
Pages 98.94% <100.00%> (+<0.01%) ⬆️
Services 99.45% <83.33%> (ø)
Shared 99.80% <ø> (ø)
UI 99.10% <ø> (ø)

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 b3910ea...c206e3d. Read the comment docs.

Copy link

codecov-public-qa bot commented Oct 7, 2024

Codecov Report

Attention: Patch coverage is 95.45455% with 1 line in your changes missing coverage. Please review.

Project coverage is 99.18%. Comparing base (b3910ea) to head (c206e3d).

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3363   +/-   ##
=======================================
  Coverage   99.18%   99.18%           
=======================================
  Files         805      805           
  Lines       14232    14233    +1     
  Branches     3922     3927    +5     
=======================================
+ Hits        14116    14117    +1     
  Misses        107      107           
  Partials        9        9           
Files Coverage Δ
...mmitBundleAnalysis/BundleMessage/BundleMessage.tsx 100.00% <100.00%> (ø)
...Page/CommitBundleAnalysis/CommitBundleAnalysis.tsx 100.00% <100.00%> (ø)
...tBundleAnalysisTable/CommitBundleAnalysisTable.tsx 100.00% <100.00%> (ø)
...CommitCoverageSummary/hooks/useCommitForSummary.js 100.00% <100.00%> (ø)
...pages/CommitDetailPage/hooks/useCommitPageData.tsx 100.00% <ø> (ø)
...uestPage/PullBundleAnalysis/PullBundleAnalysis.tsx 100.00% <100.00%> (ø)
...alysis/PullBundleHeadTable/PullBundleHeadTable.tsx 100.00% <100.00%> (ø)
...Summary/CompareSummary/usePullForCompareSummary.js 100.00% <ø> (ø)
...CommitsTab/CommitsTable/createCommitsTableData.tsx 93.93% <100.00%> (ø)
...rc/pages/PullRequestPage/hooks/usePullPageData.tsx 100.00% <ø> (ø)
... and 24 more
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 100.00% <ø> (ø)
Pages 98.94% <100.00%> (+<0.01%) ⬆️
Services 99.45% <83.33%> (ø)
Shared 99.80% <ø> (ø)
UI 99.10% <ø> (ø)

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 b3910ea...c206e3d. Read the comment docs.

@codecov-qa
Copy link

codecov-qa bot commented Oct 7, 2024

Codecov Report

Attention: Patch coverage is 95.45455% with 1 line in your changes missing coverage. Please review.

Project coverage is 99.18%. Comparing base (b3910ea) to head (c206e3d).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/services/bundleAnalysis/useBundleAssets.tsx 66.66% 1 Missing ⚠️

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3363   +/-   ##
=======================================
  Coverage   99.18%   99.18%           
=======================================
  Files         805      805           
  Lines       14232    14233    +1     
  Branches     3922     3922           
=======================================
+ Hits        14116    14117    +1     
  Misses        107      107           
  Partials        9        9           
Files with missing lines Coverage Δ
...mmitBundleAnalysis/BundleMessage/BundleMessage.tsx 100.00% <100.00%> (ø)
...Page/CommitBundleAnalysis/CommitBundleAnalysis.tsx 100.00% <100.00%> (ø)
...tBundleAnalysisTable/CommitBundleAnalysisTable.tsx 100.00% <100.00%> (ø)
...CommitCoverageSummary/hooks/useCommitForSummary.js 100.00% <100.00%> (ø)
...pages/CommitDetailPage/hooks/useCommitPageData.tsx 100.00% <ø> (ø)
...uestPage/PullBundleAnalysis/PullBundleAnalysis.tsx 100.00% <100.00%> (ø)
...alysis/PullBundleHeadTable/PullBundleHeadTable.tsx 100.00% <100.00%> (ø)
...Summary/CompareSummary/usePullForCompareSummary.js 100.00% <ø> (ø)
...CommitsTab/CommitsTable/createCommitsTableData.tsx 93.93% <100.00%> (ø)
...rc/pages/PullRequestPage/hooks/usePullPageData.tsx 100.00% <ø> (ø)
... and 24 more
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 100.00% <ø> (ø)
Pages 98.94% <100.00%> (+<0.01%) ⬆️
Services 99.45% <83.33%> (ø)
Shared 99.80% <ø> (ø)
UI 99.10% <ø> (ø)

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 b3910ea...c206e3d. Read the comment docs.

@codecov-staging
Copy link

codecov-staging bot commented Oct 7, 2024

Bundle Report

Changes will increase total bundle size by 4.8kB (0.08%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
gazebo-staging-array-push 6.15MB 4.8kB (0.08%) ⬆️

Copy link

codecov bot commented Oct 7, 2024

Bundle Report

Changes will increase total bundle size by 4.8kB (0.08%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
gazebo-production-array-push 6.15MB 4.8kB (0.08%) ⬆️

Copy link

codecov bot commented Oct 7, 2024

Codecov Report

Attention: Patch coverage is 95.45455% with 1 line in your changes missing coverage. Please review.

Project coverage is 99.18%. Comparing base (b3910ea) to head (c206e3d).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/services/bundleAnalysis/useBundleAssets.tsx 66.66% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3363   +/-   ##
=======================================
  Coverage   99.18%   99.18%           
=======================================
  Files         805      805           
  Lines       14232    14233    +1     
  Branches     3922     3922           
=======================================
+ Hits        14116    14117    +1     
  Misses        107      107           
  Partials        9        9           
Files with missing lines Coverage Δ
...mmitBundleAnalysis/BundleMessage/BundleMessage.tsx 100.00% <100.00%> (ø)
...Page/CommitBundleAnalysis/CommitBundleAnalysis.tsx 100.00% <100.00%> (ø)
...tBundleAnalysisTable/CommitBundleAnalysisTable.tsx 100.00% <100.00%> (ø)
...CommitCoverageSummary/hooks/useCommitForSummary.js 100.00% <100.00%> (ø)
...pages/CommitDetailPage/hooks/useCommitPageData.tsx 100.00% <ø> (ø)
...uestPage/PullBundleAnalysis/PullBundleAnalysis.tsx 100.00% <100.00%> (ø)
...alysis/PullBundleHeadTable/PullBundleHeadTable.tsx 100.00% <100.00%> (ø)
...Summary/CompareSummary/usePullForCompareSummary.js 100.00% <ø> (ø)
...CommitsTab/CommitsTable/createCommitsTableData.tsx 93.93% <100.00%> (ø)
...rc/pages/PullRequestPage/hooks/usePullPageData.tsx 100.00% <ø> (ø)
... and 24 more
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 100.00% <ø> (ø)
Pages 98.94% <100.00%> (+<0.01%) ⬆️
Services 99.45% <83.33%> (ø)
Shared 99.80% <ø> (ø)
UI 99.10% <ø> (ø)

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 b3910ea...c206e3d. Read the comment docs.

@codecov-releaser
Copy link
Contributor

codecov-releaser commented Oct 7, 2024

✅ Deploy preview for gazebo ready!

Previews expire after 1 month automatically.

Storybook

Commit Created Cloud Enterprise
543d7ce Mon, 07 Oct 2024 19:28:57 GMT Expired Expired
543d7ce Mon, 07 Oct 2024 19:33:13 GMT Expired Expired
f4386a0 Tue, 08 Oct 2024 16:43:47 GMT Expired Expired
56ff161 Tue, 08 Oct 2024 21:01:08 GMT Expired Expired
5aa73e5 Wed, 09 Oct 2024 09:21:44 GMT Expired Expired
c2f266c Wed, 09 Oct 2024 16:39:01 GMT Expired Expired
1592694 Thu, 10 Oct 2024 16:38:23 GMT Expired Expired
c206e3d Tue, 15 Oct 2024 20:46:50 GMT Cloud Enterprise

@calvin-codecov calvin-codecov force-pushed the cy/update_commit_graphql branch 3 times, most recently from fbdfd18 to 4335fa9 Compare October 9, 2024 08:37
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.

These are what I reviewed:

  1. Went through each non- .test. file and checked out the graphql query, zod schema update, and data access changes (the updates to make the coverageAnalytics and bundleAnalysis as .nullable() look good.
  2. Did a smoke test clicking around the Preview Deploy for any regression but didn't see anything out of place
  3. Skimmed test files for anything out of place. Tried to look harder on any that were still JS (not TS)

I think before we remove the code on api side I can help with another sweep to make sure we didn't miss any other frontend bits! As in you can stage the changes in api and we can run main frontend against it for any missed spots

coverage: percentCovered # Absolute coverage of the commit
coverageAnalytics {
totals {
coverage: percentCovered # Absolute coverage of the commit
Copy link
Contributor

Choose a reason for hiding this comment

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

May be nice to use this opportunity to move over to percentCovered? Since according to below coverage is "deprecated" 2 years ago 😂

https://github.com/codecov/codecov-api/blame/main/graphql_api/types/coverage_totals/coverage_totals.graphql#L3
Screenshot 2024-10-11 at 10 47 03 AM

Looks like the resolver is set up for it, so good to go (may not hurt to do a quick check in graphQL playground) - https://github.com/codecov/codecov-api/blob/b9c83a2916464fc8cf1bfee98017e8397b6c7803/graphql_api/types/coverage_totals/coverage_totals.py#L5

Can grab it in a follow-up if we want to get this large chunk out there first and reduce the mental load

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, that would cause so many changes haha, we should grab it in a separate PR imo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah... i changed a couple instances but when I started going down changing other instances, the work started to balloon. I'll create a ticket for the work

Copy link
Contributor Author

Choose a reason for hiding this comment

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

) {
bundles =
data.owner.repository.branch.head.bundleAnalysisReport.bundles?.map(
data.owner.repository.branch.head.bundleAnalysis?.bundleAnalysisReport?.bundles?.map(
Copy link
Contributor

Choose a reason for hiding this comment

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

Noting the extra ? check on bundleAnalysisReport here - I think that makes sense. Can't think of any way that'd cause different, unexpected behavior.

@calvin-codecov calvin-codecov added this pull request to the merge queue Oct 15, 2024
Merged via the queue into main with commit 6ad3322 Oct 15, 2024
54 of 62 checks passed
@calvin-codecov calvin-codecov deleted the cy/update_commit_graphql branch October 15, 2024 21:05
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.2] Update Gazebo Queries
3 participants