-
Notifications
You must be signed in to change notification settings - Fork 35
chore: Convert erase repository files to TS #3951
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Mutation Close Before Erase Completes
The eraseRepo function is being awaited but it's the mutate function from useMutation which returns void, not a Promise. This causes closeModal() to execute immediately instead of waiting for the mutation to complete. The modal closes before the erase operation finishes, preventing users from seeing the loading state and potentially causing confusion about whether the operation succeeded.
src/pages/RepoPage/ConfigTab/tabs/GeneralTab/DangerZone/EraseRepo/EraseRepoModal.tsx#L41-L44
gazebo/src/pages/RepoPage/ConfigTab/tabs/GeneralTab/DangerZone/EraseRepo/EraseRepoModal.tsx
Lines 41 to 44 in 0daf1ef
| variant="danger" | |
| onClick={async () => { | |
| await eraseRepo() | |
| closeModal() |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3951 +/- ##
==========================================
- Coverage 98.63% 98.61% -0.02%
==========================================
Files 828 828
Lines 15127 15126 -1
Branches 4348 4340 -8
==========================================
- Hits 14920 14917 -3
- Misses 199 201 +2
Partials 8 8
... and 1 file with indirect coverage changes
Continue to review full report in Codecov by Sentry.
|
Bundle ReportChanges will decrease total bundle size by 460 bytes (-0.0%) ⬇️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: gazebo-staging-systemAssets Changed:
Files in
view changes for bundle: gazebo-staging-esmAssets Changed:
Files in
|
Bundle ReportChanges will decrease total bundle size by 460 bytes (-0.0%) ⬇️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: gazebo-production-systemAssets Changed:
Files in
view changes for bundle: gazebo-production-esmAssets Changed:
Files in
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #3951 +/- ##
==========================================
- Coverage 98.63% 98.61% -0.02%
==========================================
Files 828 828
Lines 15127 15126 -1
Branches 4348 4340 -8
==========================================
- Hits 14920 14917 -3
- Misses 199 201 +2
Partials 8 8
... and 1 file with indirect coverage changes
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
✅ Deploy preview for gazebo ready!Previews expire after 1 month automatically.
|
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #3951 +/- ##
==========================================
- Coverage 98.63% 98.61% -0.02%
==========================================
Files 828 828
Lines 15127 15126 -1
Branches 4348 4340 -8
==========================================
- Hits 14920 14917 -3
- Misses 199 201 +2
Partials 8 8
... and 1 file with indirect coverage changes
Continue to review full report in Codecov by Sentry.
|
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #3951 +/- ##
==========================================
+ Coverage 96.54% 98.61% +2.06%
==========================================
Files 828 828
Lines 15127 15126 -1
Branches 4348 4348
==========================================
+ Hits 14605 14917 +312
+ Misses 467 201 -266
+ Partials 55 8 -47
... and 43 files with indirect coverage changes
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
| function setup({ | ||
| failedMutation = false, | ||
| isLoading = false, | ||
| unauthorized = false, | ||
| } = {}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice fix. this was confusing
Description
This PR aims to convert the erase repository components to TS and do a couple little copy modifications. Just some yak shaving before we update / modify how this erase behavior works in app.
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.
Note
Migrate erase repository components/tests to TypeScript, replace PropTypes with interfaces, and update modal/description copy with expanded test coverage (incl. unauthorized).
EraseRepo.tsxandEraseRepoModal.tsxto TypeScript; replacePropTypeswith typed interfaces.EraseRepo.test.tsxwith TypeScript typings (e.g.,ReactNodewrapper).Written by Cursor Bugbot for commit 0daf1ef. This will update automatically on new commits. Configure here.