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

ref: Move useReposBackfilled off Repo Deprecated #2862

Merged
merged 4 commits into from May 14, 2024

Conversation

ajay-sentry
Copy link
Contributor

@ajay-sentry ajay-sentry commented May 8, 2024

Description

Similar to other conversions in codecov/engineering-team#355, converts useReposBackfilled off RepoDeprecated, with some other small TS conversions and test fixes

Screenshots

Screenshot 2024-05-08 at 11 44 25 AM

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-qa
Copy link

codecov-qa bot commented May 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.48%. Comparing base (4702b47) to head (5ef5686).

✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2862   +/-   ##
=======================================
  Coverage   98.48%   98.48%           
=======================================
  Files         879      879           
  Lines       12951    12957    +6     
  Branches     3468     3410   -58     
=======================================
+ Hits        12755    12761    +6     
  Misses        192      192           
  Partials        4        4           
Files Coverage Δ
src/services/repo/useRepoBackfilled.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 54.54% <ø> (ø)
Layouts 97.26% <ø> (ø)
Pages 99.28% <ø> (ø)
Services 99.47% <100.00%> (+<0.01%) ⬆️
Shared 99.84% <ø> (ø)
UI 94.53% <ø> (ø)

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 4702b47...5ef5686. Read the comment docs.

Copy link

codecov-public-qa bot commented May 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.48%. Comparing base (4702b47) to head (5ef5686).

✅ All tests successful. No failed tests found ☺️

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2862   +/-   ##
=======================================
  Coverage   98.48%   98.48%           
=======================================
  Files         879      879           
  Lines       12951    12957    +6     
  Branches     3407     3470   +63     
=======================================
+ Hits        12755    12761    +6     
  Misses        192      192           
  Partials        4        4           
Files Coverage Δ
src/services/repo/useRepoBackfilled.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 54.54% <ø> (ø)
Layouts 97.26% <ø> (ø)
Pages 99.28% <ø> (ø)
Services 99.47% <100.00%> (+<0.01%) ⬆️
Shared 99.84% <ø> (ø)
UI 94.53% <ø> (ø)

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 4702b47...5ef5686. Read the comment docs.

Copy link

codecov bot commented May 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.49%. Comparing base (4702b47) to head (5ef5686).

✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #2862   +/-   ##
=====================================
  Coverage   98.49   98.49           
=====================================
  Files        879     879           
  Lines      12951   12957    +6     
  Branches    3473    3409   -64     
=====================================
+ Hits       12755   12761    +6     
  Misses       192     192           
  Partials       4       4           
Files Coverage Δ
src/services/repo/useRepoBackfilled.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 54.54% <ø> (ø)
Layouts 97.26% <ø> (ø)
Pages 99.28% <ø> (ø)
Services 99.47% <100.00%> (+<0.01%) ⬆️
Shared 99.84% <ø> (ø)
UI 94.53% <ø> (ø)

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 4702b47...5ef5686. Read the comment docs.

@codecov-staging
Copy link

codecov-staging bot commented May 8, 2024

Bundle Report

Changes will increase total bundle size by 907 bytes ⬆️

Bundle name Size Change
gazebo-staging-array-push 6.61MB 907 bytes ⬆️

Copy link

codecov bot commented May 8, 2024

Bundle Report

Changes will increase total bundle size by 907 bytes ⬆️

Bundle name Size Change
gazebo-production-array-push 6.61MB 907 bytes ⬆️

@codecov-notifications
Copy link

codecov-notifications bot commented May 8, 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    #2862   +/-   ##
=======================================
  Coverage   98.48%   98.48%           
=======================================
  Files         879      879           
  Lines       12951    12957    +6     
  Branches     3473     3470    -3     
=======================================
+ Hits        12755    12761    +6     
  Misses        192      192           
  Partials        4        4           
Files Coverage Δ
src/services/repo/useRepoBackfilled.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 54.54% <ø> (ø)
Layouts 97.26% <ø> (ø)
Pages 99.28% <ø> (ø)
Services 99.47% <100.00%> (+<0.01%) ⬆️
Shared 99.84% <ø> (ø)
UI 94.53% <ø> (ø)

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 4702b47...5ef5686. Read the comment docs.

@codecov-releaser
Copy link
Contributor

codecov-releaser commented May 8, 2024

✅ Deploy preview for gazebo ready!

Previews expire after 1 month automatically.

Commit Created Cloud Enterprise
1d857db Wed, 08 May 2024 15:10:23 GMT Expired Expired
0a4efc6 Wed, 08 May 2024 16:01:06 GMT Expired Expired
5ef5686 Mon, 13 May 2024 15:58:08 GMT Cloud Enterprise

@nicholas-codecov nicholas-codecov self-requested a review May 10, 2024 14:39
Copy link
Contributor

@nicholas-codecov nicholas-codecov left a comment

Choose a reason for hiding this comment

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

Couple of things to peak at

afterAll(() => server.close())

console.error = () => {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you mock this console in a setup, but also reset it after the test is finished, just to ensure that the console is back and running normally.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep yep! Fixed in 5ef5686

}

export function useRepoBackfilled() {
const { provider, owner, repo } = useParams<URLParams>()
Copy link
Contributor

Choose a reason for hiding this comment

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

m: We've shifted away from grabbing these in the service hooks directly and instead have moved to favouring them being passed in as args, do you mind making that quick update 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.

Definitely agree with you here, looking at this reference though:

export function useRepoBackfillingStatus() {
const { data } = useRepoBackfilled()
, we end up going down a rabbit hole increasing the scope of this PR to a degree I'm not super comfortable with. Would prefer to leave as is and tackle in a separate PR

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you make a ticket for this?

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-05-14 at 9 23 47 AM Screenshot 2024-05-14 at 9 24 27 AM

Doing a quick search in the codebase, we have 54 hooks to update. I can go ahead and create an epic for that; though I don't really see this getting prioritized

Copy link
Contributor

@nicholas-codecov nicholas-codecov left a comment

Choose a reason for hiding this comment

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

Approved, with a question, and a comment

@@ -212,6 +221,7 @@ describe('useUpdateRepo', () => {
wrapper: wrapper(),
})

// @ts-expect-error
Copy link
Contributor

Choose a reason for hiding this comment

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

Interested as to what's going on here? is it just that the current hook that returns the mutation hasn't been uploaded to TS yet?

Comment on lines +316 to +347
})
it('can return unsuccessful parse error', async () => {
setup({ isUnsuccessfulParseError: true })
const { result } = renderHook(() => useRepoBackfilled(), {
wrapper: wrapper(),
})

await waitFor(() => expect(result.current.isError).toBeTruthy())
await waitFor(() =>
expect(result.current.error).toEqual(
expect.objectContaining({
status: 404,
})
)
)
})
it('can return not found error', async () => {
setup({ isNotFoundError: true })
const { result } = renderHook(() => useRepoBackfilled(), {
wrapper: wrapper(),
})

await waitFor(() => expect(result.current.isError).toBeTruthy())
await waitFor(() =>
expect(result.current.error).toEqual(
expect.objectContaining({
status: 404,
})
)
)
})
it('can return owner not activated error', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Just me being a little picky, moving forward if you're working on tests do you mind adding in an empty line in between these test blocks, I feel like it makes things a lot cleaning when you're working around the tests and "mini-mizing" them in your editor.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For sure, I think stylistic things like this could be brought up in our weekly meeting as well if we want to make team norms around them!

@ajay-sentry ajay-sentry added this pull request to the merge queue May 14, 2024
Merged via the queue into main with commit f98191f May 14, 2024
59 checks passed
@ajay-sentry ajay-sentry deleted the Ajay/convert-use-repos-backfilled branch May 14, 2024 16:20
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.

None yet

3 participants