Skip to content

fix(api): Add deprecated 'report' field to Comparison GraphQL type - #2459

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/api-comparison-report-field
Open

sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/api-comparison-report-field

Conversation

@sentry

@sentry sentry Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

This PR addresses an issue where an external API client was querying a non-existent report field on the GraphQL Comparison type, leading to a GraphQLError: Cannot query field 'report' on type 'Comparison'.

To resolve this validation error for the external client, a report field has been added to the Comparison type in the GraphQL schema. This new field is marked as @deprecated and returns the same CoverageTotals data as the existing headTotals field. This provides backward compatibility for the client's query while encouraging migration to the more explicit headTotals field.

Changes:

  • Added report: CoverageTotals @deprecated(reason: "Use headTotals instead") to apps/codecov-api/graphql_api/types/comparison/comparison.graphql.
  • Implemented a resolve_report resolver in apps/codecov-api/graphql_api/types/comparison/comparison.py that delegates to resolve_head_totals.

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

@sentry <feedback>: Autofix iterates on these changes
@sentry stop iterating: Autofix stops iterating on this run

This PR was automatically generated by Sentry. You can adjust this setting at any time.


Note

Low Risk
Schema-only compatibility shim with no new business logic; deprecated field mirrors existing headTotals resolution.

Overview
Restores backward compatibility for GraphQL clients that still query Comparison.report, which was removed from the schema and caused validation errors (Cannot query field 'report' on type 'Comparison').

The PR reintroduces report on the Comparison type as a deprecated alias: it returns the same CoverageTotals as headTotals, with @deprecated(reason: "Use headTotals instead") in the schema. The new resolve_report resolver simply delegates to resolve_head_totals, so behavior matches the canonical field with no separate data path.

Reviewed by Cursor Bugbot for commit 2b9e02b. Bugbot is set up for automated code reviews on this repo. Configure here.

@codecov-notifications

codecov-notifications Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codecov Report

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

Files with missing lines Patch % Lines
...cov-api/graphql_api/types/comparison/comparison.py 66.66% 1 Missing ⚠️

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

@sentry

sentry Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

⚠️ Sentry needs additional GitHub App permissions

The Sentry GitHub App installation for this repository is missing permissions it needs to keep iterating on this pull request to get CI passing.

Review and accept the updated permissions to let Seer continue: https://github.com/organizations/codecov/settings/installations/86101127/permissions/update

@codecov

codecov Bot commented Oct 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 91.64%. Comparing base (65af8ae) to head (2b9e02b).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...cov-api/graphql_api/types/comparison/comparison.py 66.66% 1 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.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2459      +/-   ##
==========================================
- Coverage   91.65%   91.64%   -0.01%     
==========================================
  Files        1341     1341              
  Lines       53342    53345       +3     
  Branches     1649     1649              
==========================================
+ Hits        48888    48890       +2     
- Misses       4133     4134       +1     
  Partials      321      321              
Flag Coverage Δ
apiunit 94.01% <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.

This branch has not been deployed

No deployments
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