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 configured repos table to the Codecov AI tab #3303

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

rohitvinnakota-codecov
Copy link
Contributor

@rohitvinnakota-codecov rohitvinnakota-codecov commented Sep 25, 2024

Description

See design here.

If the user has already installed the app, we want to display a table with a list of repos the app is installed on.
Please note that we currently do not support pagination here, nor are we doing any server side sorting. This will be added in the future.

Screenshot 2024-09-25 at 5 02 22 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.

@codecov-staging
Copy link

codecov-staging bot commented Sep 25, 2024

Codecov Report

Attention: Patch coverage is 91.37931% with 5 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
.../ConfiguredRepositories/ConfiguredRepositories.tsx 87.50% 4 Missing ⚠️
src/pages/CodecovAIPage/CodecovAIPage.tsx 75.00% 1 Missing ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3303      +/-   ##
==========================================
- Coverage   98.79%   98.73%   -0.06%     
==========================================
  Files         803      806       +3     
  Lines       14016    14072      +56     
  Branches     3913     4000      +87     
==========================================
+ Hits        13847    13894      +47     
- Misses        158      167       +9     
  Partials       11       11              
Files with missing lines Coverage Δ
...odecovAIPage/InstallCodecovAI/InstallCodecovAI.tsx 100.00% <ø> (ø)
...rc/services/codecovAI/useCodecovAIInstallation.tsx 100.00% <100.00%> (ø)
.../services/codecovAI/useCodecovAIInstalledRepos.tsx 100.00% <100.00%> (ø)
src/pages/CodecovAIPage/CodecovAIPage.tsx 80.00% <75.00%> (-20.00%) ⬇️
.../ConfiguredRepositories/ConfiguredRepositories.tsx 87.50% <87.50%> (ø)

... and 12 files with indirect coverage changes

Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 98.49% <ø> (ø)
Pages 98.55% <86.11%> (-0.11%) ⬇️
Services 99.41% <100.00%> (+<0.01%) ⬆️
Shared 99.23% <ø> (ø)
UI 98.05% <ø> (ø)

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 f2a4d49...3c06152. Read the comment docs.

@codecov-qa
Copy link

codecov-qa bot commented Sep 25, 2024

Codecov Report

Attention: Patch coverage is 91.37931% with 5 lines in your changes missing coverage. Please review.

Project coverage is 98.73%. Comparing base (f2a4d49) to head (3c06152).
Report is 10 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
.../ConfiguredRepositories/ConfiguredRepositories.tsx 87.50% 4 Missing ⚠️
src/pages/CodecovAIPage/CodecovAIPage.tsx 75.00% 1 Missing ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3303      +/-   ##
==========================================
- Coverage   98.79%   98.73%   -0.06%     
==========================================
  Files         803      806       +3     
  Lines       14016    14072      +56     
  Branches     3913     4005      +92     
==========================================
+ Hits        13847    13894      +47     
- Misses        158      167       +9     
  Partials       11       11              
Files with missing lines Coverage Δ
...odecovAIPage/InstallCodecovAI/InstallCodecovAI.tsx 100.00% <ø> (ø)
...rc/services/codecovAI/useCodecovAIInstallation.tsx 100.00% <100.00%> (ø)
.../services/codecovAI/useCodecovAIInstalledRepos.tsx 100.00% <100.00%> (ø)
src/pages/CodecovAIPage/CodecovAIPage.tsx 80.00% <75.00%> (-20.00%) ⬇️
.../ConfiguredRepositories/ConfiguredRepositories.tsx 87.50% <87.50%> (ø)

... and 12 files with indirect coverage changes

Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 98.49% <ø> (ø)
Pages 98.55% <86.11%> (-0.11%) ⬇️
Services 99.41% <100.00%> (+<0.01%) ⬆️
Shared 99.23% <ø> (ø)
UI 98.05% <ø> (ø)

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 f2a4d49...3c06152. Read the comment docs.

Copy link

codecov-public-qa bot commented Sep 25, 2024

Codecov Report

Attention: Patch coverage is 91.37931% with 5 lines in your changes missing coverage. Please review.

Project coverage is 98.73%. Comparing base (f2a4d49) to head (3c06152).
Report is 10 commits behind head on main.

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3303      +/-   ##
==========================================
- Coverage   98.79%   98.73%   -0.06%     
==========================================
  Files         803      806       +3     
  Lines       14016    14072      +56     
  Branches     3992     4000       +8     
==========================================
+ Hits        13847    13894      +47     
- Misses        158      167       +9     
  Partials       11       11              
Files Coverage Δ
...odecovAIPage/InstallCodecovAI/InstallCodecovAI.tsx 100.00% <ø> (ø)
...rc/services/codecovAI/useCodecovAIInstallation.tsx 100.00% <100.00%> (ø)
.../services/codecovAI/useCodecovAIInstalledRepos.tsx 100.00% <100.00%> (ø)
src/pages/CodecovAIPage/CodecovAIPage.tsx 80.00% <75.00%> (-20.00%) ⬇️
.../ConfiguredRepositories/ConfiguredRepositories.tsx 87.50% <87.50%> (ø)

... and 12 files with indirect coverage changes

Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 98.49% <ø> (ø)
Pages 98.55% <86.11%> (-0.11%) ⬇️
Services 99.41% <100.00%> (+<0.01%) ⬆️
Shared 99.23% <ø> (ø)
UI 98.05% <ø> (ø)

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 f2a4d49...3c06152. Read the comment docs.

@codecov-staging
Copy link

codecov-staging bot commented Sep 25, 2024

Bundle Report

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

Detailed changes
Bundle name Size Change
gazebo-staging-array-push 6.05MB 3.74kB (0.06%) ⬆️

Copy link

codecov bot commented Sep 25, 2024

Codecov Report

Attention: Patch coverage is 91.37931% with 5 lines in your changes missing coverage. Please review.

Project coverage is 98.73%. Comparing base (f2a4d49) to head (3c06152).
Report is 10 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
.../ConfiguredRepositories/ConfiguredRepositories.tsx 87.50% 4 Missing ⚠️
src/pages/CodecovAIPage/CodecovAIPage.tsx 75.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3303      +/-   ##
==========================================
- Coverage   98.79%   98.73%   -0.06%     
==========================================
  Files         803      806       +3     
  Lines       14016    14072      +56     
  Branches     3964     4005      +41     
==========================================
+ Hits        13847    13894      +47     
- Misses        158      167       +9     
  Partials       11       11              
Files with missing lines Coverage Δ
...odecovAIPage/InstallCodecovAI/InstallCodecovAI.tsx 100.00% <ø> (ø)
...rc/services/codecovAI/useCodecovAIInstallation.tsx 100.00% <100.00%> (ø)
.../services/codecovAI/useCodecovAIInstalledRepos.tsx 100.00% <100.00%> (ø)
src/pages/CodecovAIPage/CodecovAIPage.tsx 80.00% <75.00%> (-20.00%) ⬇️
.../ConfiguredRepositories/ConfiguredRepositories.tsx 87.50% <87.50%> (ø)

... and 12 files with indirect coverage changes

Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 98.49% <ø> (ø)
Pages 98.55% <86.11%> (-0.11%) ⬇️
Services 99.41% <100.00%> (+<0.01%) ⬆️
Shared 99.23% <ø> (ø)
UI 98.05% <ø> (ø)

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 f2a4d49...3c06152. Read the comment docs.

Copy link

codecov bot commented Sep 25, 2024

Bundle Report

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

Detailed changes
Bundle name Size Change
gazebo-production-array-push 6.05MB 3.74kB (0.06%) ⬆️

@codecov-releaser
Copy link
Contributor

codecov-releaser commented Sep 25, 2024

✅ Deploy preview for gazebo ready!

Previews expire after 1 month automatically.

Storybook

Commit Created Cloud Enterprise
169f4a3 Wed, 25 Sep 2024 21:04:16 GMT Expired Expired
2fe4f86 Thu, 26 Sep 2024 15:16:23 GMT Expired Expired
0b90123 Thu, 26 Sep 2024 15:52:33 GMT Expired Expired
0ef0f78 Thu, 26 Sep 2024 23:49:33 GMT Expired Expired
3b3f724 Fri, 27 Sep 2024 00:08:38 GMT Expired Expired
3c7ca5e Fri, 27 Sep 2024 00:16:32 GMT Expired Expired
db84403 Fri, 27 Sep 2024 13:31:32 GMT Expired Expired
3c06152 Fri, 27 Sep 2024 22:46:50 GMT Cloud Enterprise

@rohitvinnakota-codecov rohitvinnakota-codecov changed the title [draft] Add configured repos table to the Codecov AI tab [feat] Add configured repos table to the Codecov AI tab Sep 26, 2024
@rohitvinnakota-codecov rohitvinnakota-codecov marked this pull request as ready for review September 27, 2024 13:26

const repo1Link = await screen.findByText(/repo-1/)
expect(repo1Link).toBeInTheDocument()
const repo2Link = await screen.findByText(/repo-1/)
Copy link
Contributor

Choose a reason for hiding this comment

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

repo-2 right?

getCoreRowModel: getCoreRowModel(),
})

// This should technically never happen, but render a fallback just in case
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure how much value this comment is giving tbh :P

@@ -0,0 +1,110 @@
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
Copy link
Contributor

Choose a reason for hiding this comment

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

Any taste for turning this into a vite file? Otherwise maybe we can create a followup ticket

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 think I ran into some minor issues, and this is a bit time sensitive. I'll give it another try Tuesday before merging. Otherwise, will make a followup.

Copy link
Contributor

Choose a reason for hiding this comment

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

no worries! I get it

const ResponseSchema = z.object({
owner: z
.object({
aiFeaturesEnabled: z.boolean(),
Copy link
Contributor

Choose a reason for hiding this comment

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

will this always have a boolean value?

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

@@ -0,0 +1,110 @@
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
Copy link
Contributor

Choose a reason for hiding this comment

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

Same for this re:vite

}

return {
aiEnabledRepos: parsedRes.data.owner?.aiEnabledRepos,
Copy link
Contributor

Choose a reason for hiding this comment

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

should we default to an empty array here maybe?

Then I think we can get rid of this line in the ConfiguredRepositories component maybe?

if (!data?.aiEnabledRepos) return []

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.

Couple small things, lgtm!

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