Skip to content

fix(self-hosted): Prevent ZodError from HasAdmins query on cloud#4045

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/gazebo-182p-zoderror
Open

fix(self-hosted): Prevent ZodError from HasAdmins query on cloud#4045
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/gazebo-182p-zoderror

Conversation

@sentry

@sentry sentry Bot commented Jul 13, 2026

Copy link
Copy Markdown

Description

This PR resolves GAZEBO-182P, a ZodError encountered when the SelfHostedHasAdminsQueryOpts was invoked on Codecov's cloud deployment.

The HasAdmins GraphQL query is designed for self-hosted instances. On cloud, the API returns an empty data object, leading to the config field being undefined in the response. The original Zod schema expected config to be an object or null, but not undefined, causing a validation error.

Code Example

Notable Changes

  • The HasAdminsSchema in SelfHostedHasAdminsQueryOpts.ts has been updated to mark the config field as .optional(), making the schema resilient to an absent config field.
  • The MissingDesignatedAdminsWrapper in MissingDesignatedAdmins.tsx now conditionally renders the MissingDesignatedAdmins component only when config.IS_SELF_HOSTED is true. This is the correct pattern for preventing useSuspenseQuery from firing on cloud deployments, as useSuspenseQuery ignores the enabled flag.
  • The redundant enabled: config.IS_SELF_HOSTED flag was removed from SelfHostedHasAdminsQueryOpts as it has no effect when used with useSuspenseQuery.

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

@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Bundle Report

Changes will decrease total bundle size by 5.81MB (-49.66%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
gazebo-production-esm 5.89MB 29 bytes (0.0%) ⬆️
gazebo-production-system (removed) -5.81MB (-100.0%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: gazebo-production-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index.*.js 29 bytes 577.78kB 0.01%

Files in assets/index.*.js:

  • ./src/services/selfHosted/SelfHostedHasAdminsQueryOpts.ts → Total Size: 866 bytes

  • ./src/shared/GlobalBanners/MissingDesignatedAdmins/MissingDesignatedAdmins.tsx → Total Size: 1.23kB

@codecov-notifications

Copy link
Copy Markdown

Codecov Report

✅ All 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     4359     4351       -8     
==========================================
- Hits        14906    14904       -2     
- Misses        179      181       +2     
  Partials        7        7              
Files with missing lines Coverage Δ
...ervices/selfHosted/SelfHostedHasAdminsQueryOpts.ts 91.66% <ø> (-8.34%) ⬇️
...issingDesignatedAdmins/MissingDesignatedAdmins.tsx 90.90% <100.00%> (-9.10%) ⬇️
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.72% <ø> (ø)
Pages 98.42% <ø> (ø)
Services 99.29% <ø> (-0.04%) ⬇️
Shared 98.87% <100.00%> (-0.07%) ⬇️
UI 99.02% <ø> (ø)

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 0fc5370...6e11b60. Read the comment docs.

@codecov-public-qa

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.75%. Comparing base (0fc5370) to head (6e11b60).

✅ 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              
Files with missing lines Coverage Δ
...ervices/selfHosted/SelfHostedHasAdminsQueryOpts.ts 91.66% <ø> (-8.34%) ⬇️
...issingDesignatedAdmins/MissingDesignatedAdmins.tsx 90.90% <100.00%> (-9.10%) ⬇️
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.72% <ø> (ø)
Pages 98.42% <ø> (ø)
Services 99.29% <ø> (-0.04%) ⬇️
Shared 98.87% <100.00%> (-0.07%) ⬇️
UI 99.02% <ø> (ø)

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 0fc5370...6e11b60. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.75%. Comparing base (0fc5370) to head (6e11b60).
✅ All tests successful. No failed tests found.

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              
Files with missing lines Coverage Δ
...ervices/selfHosted/SelfHostedHasAdminsQueryOpts.ts 91.66% <ø> (-8.34%) ⬇️
...issingDesignatedAdmins/MissingDesignatedAdmins.tsx 90.90% <100.00%> (-9.10%) ⬇️
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.72% <ø> (ø)
Pages 98.42% <ø> (ø)
Services 99.29% <ø> (-0.04%) ⬇️
Shared 98.87% <100.00%> (-0.07%) ⬇️
UI 99.02% <ø> (ø)

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0fc5370...6e11b60. Read the comment docs.

@codecov-releaser

Copy link
Copy Markdown
Collaborator

✅ Deploy preview for gazebo ready!

Previews expire after 1 month automatically.

Storybook

Commit Created Cloud Enterprise
6e11b60 Mon, 13 Jul 2026 19:28:21 GMT Cloud Enterprise

@codecov-qa

codecov-qa Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.75%. Comparing base (0fc5370) to head (6e11b60).

@@            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              
Files with missing lines Coverage Δ
...ervices/selfHosted/SelfHostedHasAdminsQueryOpts.ts 91.66% <ø> (-8.34%) ⬇️
...issingDesignatedAdmins/MissingDesignatedAdmins.tsx 90.90% <100.00%> (-9.10%) ⬇️
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.72% <ø> (ø)
Pages 98.42% <ø> (ø)
Services 99.29% <ø> (-0.04%) ⬇️
Shared 98.87% <100.00%> (-0.07%) ⬇️
UI 99.02% <ø> (ø)

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0fc5370...6e11b60. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant