Skip to content

fix(graphql): Add base/head aliases to Component/FlagComparison types - #1873

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/graphql-component-flag-comparison-aliases
Open

fix(graphql): Add base/head aliases to Component/FlagComparison types#1873
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/graphql-component-flag-comparison-aliases

Conversation

@sentry

@sentry sentry Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

This PR addresses a GraphQLError where clients attempted to query base and head fields on the ComponentComparison GraphQL type, which only exposed baseTotals and headTotals.

The root cause was an inconsistency in the GraphQL schema: FlagComparison used base and head fields for coverage totals, while ComponentComparison used baseTotals and headTotals. This led to client queries expecting a consistent field naming convention.

To resolve this, base and head fields have been added as deprecated aliases to both ComponentComparison and FlagComparison types in the GraphQL schema. These new fields map directly to the existing baseTotals and headTotals resolvers, ensuring backward compatibility and allowing clients to use the expected field names while being gently guided towards the canonical *Totals fields.

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 API-ESJ

@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.82%. Comparing base (d8942db) to head (352ce94).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...types/component_comparison/component_comparison.py 66.66% 2 Missing ⚠️
...aphql_api/types/flag_comparison/flag_comparison.py 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1873      +/-   ##
==========================================
- Coverage   91.83%   91.82%   -0.01%     
==========================================
  Files        1332     1332              
  Lines       51830    51842      +12     
  Branches     1647     1647              
==========================================
+ Hits        47598    47606       +8     
- Misses       3911     3915       +4     
  Partials      321      321              
Flag Coverage Δ
apiunit 94.73% <66.66%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@codecov-notifications

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 4 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...types/component_comparison/component_comparison.py 66.66% 2 Missing ⚠️
...aphql_api/types/flag_comparison/flag_comparison.py 66.66% 2 Missing ⚠️

❌ Your patch check has failed because the patch coverage (66.66%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage.

📢 Thoughts on this report? Let us know!

🚀 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.

0 participants