fix(self-hosted): Prevent ZodError from HasAdmins query on cloud#4045
fix(self-hosted): Prevent ZodError from HasAdmins query on cloud#4045sentry[bot] wants to merge 1 commit into
Conversation
Bundle ReportChanges will decrease total bundle size by 5.81MB (-49.66%) ⬇️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: gazebo-production-esmAssets Changed:
Files in
|
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #4045 +/- ##
==========================================
- Coverage 98.76% 98.75% -0.02%
==========================================
Files 822 822
Lines 15092 15092
Branches 4359 4351 -8
==========================================
- Hits 14906 14904 -2
- Misses 179 181 +2
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 #4045 +/- ##
==========================================
- Coverage 98.76% 98.75% -0.02%
==========================================
Files 822 822
Lines 15092 15092
Branches 4351 4359 +8
==========================================
- Hits 14906 14904 -2
- Misses 179 181 +2
Partials 7 7
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4045 +/- ##
==========================================
- Coverage 98.76% 98.75% -0.02%
==========================================
Files 822 822
Lines 15092 15092
Branches 4351 4351
==========================================
- Hits 14906 14904 -2
- Misses 179 181 +2
Partials 7 7
Continue to review full report in Codecov by Harness.
|
✅ 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 #4045 +/- ##
==========================================
- Coverage 98.76% 98.75% -0.02%
==========================================
Files 822 822
Lines 15092 15092
Branches 4351 4351
==========================================
- Hits 14906 14904 -2
- Misses 179 181 +2
Partials 7 7
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Description
This PR resolves GAZEBO-182P, a
ZodErrorencountered when theSelfHostedHasAdminsQueryOptswas invoked on Codecov's cloud deployment.The
HasAdminsGraphQL query is designed for self-hosted instances. On cloud, the API returns an empty data object, leading to theconfigfield beingundefinedin the response. The original Zod schema expectedconfigto be an object ornull, but notundefined, causing a validation error.Code Example
Notable Changes
HasAdminsSchemainSelfHostedHasAdminsQueryOpts.tshas been updated to mark theconfigfield as.optional(), making the schema resilient to an absentconfigfield.MissingDesignatedAdminsWrapperinMissingDesignatedAdmins.tsxnow conditionally renders theMissingDesignatedAdminscomponent only whenconfig.IS_SELF_HOSTEDis true. This is the correct pattern for preventinguseSuspenseQueryfrom firing on cloud deployments, asuseSuspenseQueryignores theenabledflag.enabled: config.IS_SELF_HOSTEDflag was removed fromSelfHostedHasAdminsQueryOptsas it has no effect when used withuseSuspenseQuery.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-182P