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

[Client] Add logic to return measurements data based on specifying public and private repo #2402

Merged
merged 4 commits into from
Nov 15, 2023

Conversation

rohitvinnakota-codecov
Copy link
Contributor

@rohitvinnakota-codecov rohitvinnakota-codecov commented Nov 14, 2023

Description

Make the line chart on the Analytics page filter on only public repos if the user is on a team plan. This makes use of the new isPublic parameter on the measurements GQL field as added in codecov/engineering-team#786. This PR closes codecov/engineering-team#787.

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 Nov 14, 2023

Codecov Report

Merging #2402 (884e545) into main (1594c3c) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2402   +/-   ##
=======================================
  Coverage   96.23%   96.23%           
=======================================
  Files         750      750           
  Lines        9431     9433    +2     
  Branches     2324     2327    +3     
=======================================
+ Hits         9076     9078    +2     
  Misses        340      340           
  Partials       15       15           
Files Coverage Δ
src/pages/AnalyticsPage/Chart/useCoverage.js 100.00% <100.00%> (ø)
...rc/services/charts/useReposCoverageMeasurements.ts 100.00% <ø> (ø)

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 1594c3c...884e545. Read the comment docs.

Copy link

codecov bot commented Nov 14, 2023

Codecov Report

Merging #2402 (884e545) into main (1594c3c) will not change coverage.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #2402   +/-   ##
=====================================
  Coverage   96.24   96.24           
=====================================
  Files        750     750           
  Lines       9431    9433    +2     
  Branches    2370    2358   -12     
=====================================
+ Hits        9076    9078    +2     
  Misses       338     338           
  Partials      17      17           
Files Coverage Δ
src/pages/AnalyticsPage/Chart/useCoverage.js 100.00% <100.00%> (ø)
...rc/services/charts/useReposCoverageMeasurements.ts 100.00% <ø> (ø)

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 1594c3c...884e545. Read the comment docs.

@codecov-qa
Copy link

codecov-qa bot commented Nov 14, 2023

Codecov Report

Merging #2402 (884e545) into main (1594c3c) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2402   +/-   ##
=======================================
  Coverage   96.23%   96.23%           
=======================================
  Files         750      750           
  Lines        9431     9433    +2     
  Branches     2375     2371    -4     
=======================================
+ Hits         9076     9078    +2     
- Misses        338      340    +2     
+ Partials       17       15    -2     
Files Coverage Δ
src/pages/AnalyticsPage/Chart/useCoverage.js 100.00% <100.00%> (ø)
...rc/services/charts/useReposCoverageMeasurements.ts 100.00% <ø> (ø)

... and 2 files with indirect coverage changes


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 1594c3c...884e545. Read the comment docs.

Copy link

netlify bot commented Nov 14, 2023

Deploy Preview for gazebo-staging ready!

Name Link
🔨 Latest commit 884e545
🔍 Latest deploy log https://app.netlify.com/sites/gazebo-staging/deploys/65552989599a5f0008f74bc1
😎 Deploy Preview https://deploy-preview-2402--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.

@rohitvinnakota-codecov rohitvinnakota-codecov marked this pull request as ready for review November 15, 2023 18:42

import { useCoverage } from './useCoverage'

jest.mock('services/charts')
jest.mock('react-router-dom', () => ({
Copy link
Contributor

Choose a reason for hiding this comment

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

This is an antipattern we used to do back in the day we're trying to replace. Effectively this is mocking useParams so that jest doesn't complain, but we can also rightfully provide it to emulate the router, take a look at this test for example, https://github.com/codecov/gazebo/blob/main/src/services/trial/useStartTrial.spec.tsx#L23. Could you get rid of this mock and instead provide the route parameters, seems like owner and provider, to the request instead? Lmk if you have a question

@rohitvinnakota-codecov rohitvinnakota-codecov merged commit 9aa9e6e into main Nov 15, 2023
31 checks passed
@rohitvinnakota-codecov rohitvinnakota-codecov deleted the rvinnakota/add-public-field-measurements branch November 15, 2023 20:56
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.

[Client] Add logic to return measurements data based on specifying public and private repo
2 participants