Skip to content

fix(graphql): Add deprecated 'head'/'base' fields to ComponentComparison - #1872

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

fix(graphql): Add deprecated 'head'/'base' fields to ComponentComparison#1872
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/graphql-component-comparison-head-base

Conversation

@sentry

@sentry sentry Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

This PR addresses issue API-ESM, where external API clients were encountering GraphQLError: Cannot query field 'head' on type 'ComponentComparison'. The root cause was identified as a mismatch between client queries and the GraphQL schema for the ComponentComparison type. While the schema provides headTotals and baseTotals, some clients were querying for head and base fields, which are present on other comparison types (e.g., FlagComparison) but not ComponentComparison). To provide backward compatibility and prevent breaking existing external integrations, this change introduces head and base fields to the ComponentComparison GraphQL type. These fields are marked as @deprecated in the schema and their resolvers are implemented to delegate to the existing headTotals and baseTotals fields, respectively. This allows older clients to continue functioning while encouraging migration to the correct field names.

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-ESM

@codecov-notifications

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 2 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 ⚠️

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

@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.83%. Comparing base (d8942db) to head (93a1667).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...types/component_comparison/component_comparison.py 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1872      +/-   ##
==========================================
- Coverage   91.83%   91.83%   -0.01%     
==========================================
  Files        1332     1332              
  Lines       51830    51836       +6     
  Branches     1647     1647              
==========================================
+ Hits        47598    47602       +4     
- Misses       3911     3913       +2     
  Partials      321      321              
Flag Coverage Δ
apiunit 94.74% <66.66%> (-0.01%) ⬇️

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.

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