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] Add repo level exceeded GH rate limit banner #2999

Merged
merged 9 commits into from
Jul 17, 2024

Conversation

rohitvinnakota-codecov
Copy link
Contributor

@rohitvinnakota-codecov rohitvinnakota-codecov commented Jul 10, 2024

Description

This banner will show up on the Commit detail and PR detail page if there is a GH rate limit error. This info will be surfaced via a resolver from the API(which queries a redis cache under the hood).

Related API changes: codecov/codecov-api@56269e3

We make a call to Github when the files changed tab is expanded, or a file is viewed.

Screenshot 2024-07-16 at 8 48 56 PM

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.

Copy link

codecov-public-qa bot commented Jul 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.36%. Comparing base (0756143) to head (e360e7b).

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2999   +/-   ##
=======================================
  Coverage   98.35%   98.36%           
=======================================
  Files         910      912    +2     
  Lines       13534    13563   +29     
  Branches     3659     3595   -64     
=======================================
+ Hits        13312    13341   +29     
  Misses        218      218           
  Partials        4        4           
Files Coverage Δ
...CommitDetailPage/CommitCoverage/CommitCoverage.jsx 100.00% <100.00%> (ø)
...ages/PullRequestPage/PullCoverage/PullCoverage.jsx 100.00% <100.00%> (ø)
...rvices/navigation/useNavLinks/useStaticNavLinks.js 97.22% <100.00%> (+0.03%) ⬆️
src/services/repo/useRepoRateLimitStatus.tsx 100.00% <100.00%> (ø)
...ateLimitExceeded/GitHubRateLimitExceededBanner.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 53.84% <ø> (ø)
Layouts 97.67% <ø> (ø)
Pages 99.15% <100.00%> (+<0.01%) ⬆️
Services 99.47% <100.00%> (+<0.01%) ⬆️
Shared 99.69% <100.00%> (+<0.01%) ⬆️
UI 94.28% <ø> (ø)

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 0756143...e360e7b. Read the comment docs.

@codecov-notifications
Copy link

codecov-notifications bot commented Jul 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    #2999   +/-   ##
=======================================
  Coverage   98.35%   98.36%           
=======================================
  Files         910      912    +2     
  Lines       13534    13563   +29     
  Branches     3664     3666    +2     
=======================================
+ Hits        13312    13341   +29     
  Misses        218      218           
  Partials        4        4           
Files Coverage Δ
...CommitDetailPage/CommitCoverage/CommitCoverage.jsx 100.00% <100.00%> (ø)
...ages/PullRequestPage/PullCoverage/PullCoverage.jsx 100.00% <100.00%> (ø)
...rvices/navigation/useNavLinks/useStaticNavLinks.js 97.22% <100.00%> (+0.03%) ⬆️
src/services/repo/useRepoRateLimitStatus.tsx 100.00% <100.00%> (ø)
...ateLimitExceeded/GitHubRateLimitExceededBanner.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 53.84% <ø> (ø)
Layouts 97.67% <ø> (ø)
Pages 99.15% <100.00%> (+<0.01%) ⬆️
Services 99.47% <100.00%> (+<0.01%) ⬆️
Shared 99.69% <100.00%> (+<0.01%) ⬆️
UI 94.28% <ø> (ø)

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 0756143...e360e7b. Read the comment docs.

@codecov-qa
Copy link

codecov-qa bot commented Jul 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.36%. Comparing base (0756143) to head (e360e7b).

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2999   +/-   ##
=======================================
  Coverage   98.35%   98.36%           
=======================================
  Files         910      912    +2     
  Lines       13534    13563   +29     
  Branches     3659     3666    +7     
=======================================
+ Hits        13312    13341   +29     
  Misses        218      218           
  Partials        4        4           
Files Coverage Δ
...CommitDetailPage/CommitCoverage/CommitCoverage.jsx 100.00% <100.00%> (ø)
...ages/PullRequestPage/PullCoverage/PullCoverage.jsx 100.00% <100.00%> (ø)
...rvices/navigation/useNavLinks/useStaticNavLinks.js 97.22% <100.00%> (+0.03%) ⬆️
src/services/repo/useRepoRateLimitStatus.tsx 100.00% <100.00%> (ø)
...ateLimitExceeded/GitHubRateLimitExceededBanner.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 53.84% <ø> (ø)
Layouts 97.67% <ø> (ø)
Pages 99.15% <100.00%> (+<0.01%) ⬆️
Services 99.47% <100.00%> (+<0.01%) ⬆️
Shared 99.69% <100.00%> (+<0.01%) ⬆️
UI 94.28% <ø> (ø)

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 0756143...e360e7b. Read the comment docs.

@codecov-staging
Copy link

codecov-staging bot commented Jul 10, 2024

Bundle Report

Changes will increase total bundle size by 7.61kB ⬆️

Bundle name Size Change
gazebo-staging-array-push 6.09MB 7.61kB ⬆️

Copy link

codecov bot commented Jul 10, 2024

Bundle Report

Changes will increase total bundle size by 7.61kB ⬆️

Bundle name Size Change
gazebo-production-array-push 6.09MB 7.61kB ⬆️

@codecov-releaser
Copy link
Contributor

codecov-releaser commented Jul 10, 2024

✅ Deploy preview for gazebo ready!

Previews expire after 1 month automatically.

Storybook

Commit Created Cloud Enterprise
5b78d34 Wed, 10 Jul 2024 16:18:22 GMT Expired Expired
fd64d2c Wed, 10 Jul 2024 20:31:33 GMT Expired Expired
1da3846 Thu, 11 Jul 2024 14:58:26 GMT Expired Expired
7c38a8a Thu, 11 Jul 2024 16:01:23 GMT Expired Expired
129eb12 Thu, 11 Jul 2024 16:18:46 GMT Expired Expired
bdb7250 Thu, 11 Jul 2024 16:35:59 GMT Expired Expired
0069def Tue, 16 Jul 2024 14:17:03 GMT Expired Expired
0b93de8 Wed, 17 Jul 2024 01:02:09 GMT Expired Expired
e360e7b Wed, 17 Jul 2024 19:05:59 GMT Cloud Enterprise

Copy link

codecov bot commented Jul 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.36%. Comparing base (0756143) to head (e360e7b).

✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@               Coverage Diff                @@
##               main      #2999        +/-   ##
================================================
+ Coverage   98.35000   98.36000   +0.01000     
================================================
  Files           910        912         +2     
  Lines         13534      13563        +29     
  Branches       3638       3595        -43     
================================================
+ Hits          13312      13341        +29     
  Misses          218        218                
  Partials          4          4                
Files Coverage Δ
...CommitDetailPage/CommitCoverage/CommitCoverage.jsx 100.00% <100.00%> (ø)
...ages/PullRequestPage/PullCoverage/PullCoverage.jsx 100.00% <100.00%> (ø)
...rvices/navigation/useNavLinks/useStaticNavLinks.js 97.22% <100.00%> (+0.03%) ⬆️
src/services/repo/useRepoRateLimitStatus.tsx 100.00% <100.00%> (ø)
...ateLimitExceeded/GitHubRateLimitExceededBanner.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 53.84% <ø> (ø)
Layouts 97.67% <ø> (ø)
Pages 99.15% <100.00%> (+<0.01%) ⬆️
Services 99.47% <100.00%> (+<0.01%) ⬆️
Shared 99.69% <100.00%> (+<0.01%) ⬆️
UI 94.28% <ø> (ø)

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 0756143...e360e7b. Read the comment docs.

@rohitvinnakota-codecov rohitvinnakota-codecov changed the title [draft] Add exceeded GH rate limit banner [draft] Add repo level exceeded GH rate limit banner Jul 11, 2024
@rohitvinnakota-codecov rohitvinnakota-codecov marked this pull request as ready for review July 11, 2024 16:22
@rohitvinnakota-codecov rohitvinnakota-codecov changed the title [draft] Add repo level exceeded GH rate limit banner [feat] Add repo level exceeded GH rate limit banner Jul 11, 2024
})
}

if (data?.owner?.repository?.__typename === 'OwnerNotActivatedError') {
Copy link
Contributor

Choose a reason for hiding this comment

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

Just want to confirm we don't want to return a Promise.reject() for these two cases

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, avoiding any page level errors as this does not block critical functionality.

Copy link
Contributor

Choose a reason for hiding this comment

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

got it, thanks for confirming

</Alert.Title>
<Alert.Description>
<p className="flex items-center gap-2">
Unable to calculate coverage due to GitHub rate limit exceeded.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Github vs GitHub

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Screenshot 2024-07-17 at 2 31 01 PM

Keeping consistency with what I see on google lol

Copy link
Contributor

@ajay-sentry ajay-sentry left a comment

Choose a reason for hiding this comment

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

teeny copy nit, looks good

@rohitvinnakota-codecov rohitvinnakota-codecov added this pull request to the merge queue Jul 17, 2024
Merged via the queue into main with commit 2e3fa40 Jul 17, 2024
61 checks passed
@rohitvinnakota-codecov rohitvinnakota-codecov deleted the rvinnakota/gh-rate-limit-surface branch July 17, 2024 18:45
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