fix: Add missing GraphQL error message fragments for repo components#4024
fix: Add missing GraphQL error message fragments for repo components#4024sentry[bot] wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4024 +/- ##
=======================================
Coverage 98.74% 98.74%
=======================================
Files 831 831
Lines 15196 15196
Branches 4378 4378
=======================================
Hits 15005 15005
Misses 184 184
Partials 7 7
Continue to review full report in Codecov by Harness.
|
Bundle ReportChanges will increase total bundle size by 242 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 Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #4024 +/- ##
=======================================
Coverage 98.74% 98.74%
=======================================
Files 831 831
Lines 15196 15196
Branches 4370 4370
=======================================
Hits 15005 15005
Misses 184 184
Partials 7 7
Continue to review full report in Codecov by Sentry.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #4024 +/- ##
=======================================
Coverage 98.74% 98.74%
=======================================
Files 831 831
Lines 15196 15196
Branches 4378 4370 -8
=======================================
Hits 15005 15005
Misses 184 184
Partials 7 7
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 #4024 +/- ##
=======================================
Coverage 98.74% 98.74%
=======================================
Files 831 831
Lines 15196 15196
Branches 4378 4370 -8
=======================================
Hits 15005 15005
Misses 184 184
Partials 7 7
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Description
This PR addresses a
ZodErrorthat occurred when attempting to access the components page (/:provider/:owner/:repo/components) for a non-existent or inaccessible repository.The root cause was that the GraphQL query in
useComponentsBackfilled.tsxdid not explicitly request themessagefield forNotFoundErrorandOwnerNotActivatedErrortypes. However, the corresponding Zod schemas (RepoNotFoundErrorSchemaandRepoOwnerNotActivatedErrorSchema) expected thismessagefield to be present. When the API returned aNotFoundErrororOwnerNotActivatedErrorwithout amessagefield, Zod validation failed, leading to theZodError.Code Example
Notable Changes
The fix involves updating the GraphQL query in
src/services/repo/useComponentsBackfilled.tsxto include... on NotFoundError { message }and... on OwnerNotActivatedError { message }fragments. This ensures that themessagefield is fetched from the API when these error types are returned, allowing Zod to correctly validate the response and enabling the application to handle these errors gracefully.Screenshots
Link to Sample Entry
Legal Boilerplate
Look, I get it. The entity doing business as "Codecov" is owned by Harness, Inc. In 2026 Harness acquired Codecov and as a result Harness 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 Harness can use, modify, copy, and redistribute my contributions, under Harness's choice of terms.
Fixes GAZEBO-181Y