Skip to content

feat(graphql): add partialsCount to ImpactedFile type - #1985

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/feat/graphql-impacted-file-partials-count
Open

feat(graphql): add partialsCount to ImpactedFile type#1985
sentry[bot] wants to merge 1 commit into
mainfrom
seer/feat/graphql-impacted-file-partials-count

Conversation

@sentry

@sentry sentry Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

This PR addresses the GraphQLError: Cannot query field 'partialsCount' on type 'ImpactedFile'.

The root cause was that the ImpactedFile GraphQL type did not expose a partialsCount field, even though missesCount was available and the underlying service data contained partials information. The client was attempting to query a field that was not defined in the schema for that specific type.

This fix implements the following changes:

  1. apps/codecov-api/services/comparison.py: Added a cached_property named partials_count to the ImpactedFile service class. This property calculates the total number of partials by iterating through added_diff_coverage and counting lines marked as 'p', mirroring the existing misses_count logic.
  2. apps/codecov-api/graphql_api/types/impacted_file/impacted_file.graphql: Updated the ImpactedFile GraphQL type definition to include partialsCount: Int!.
  3. apps/codecov-api/graphql_api/types/impacted_file/impacted_file.py: Implemented a new resolver, resolve_partials_count, decorated with @impacted_file_bindable.field("partialsCount"), to expose the partials_count property from the ImpactedFile service class via the GraphQL API.

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

@codecov

codecov Bot commented Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 36.36364% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.62%. Comparing base (a8ec2db) to head (e2c36b5).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
apps/codecov-api/services/comparison.py 25.00% 6 Missing ⚠️
...i/graphql_api/types/impacted_file/impacted_file.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1985      +/-   ##
==========================================
- Coverage   91.63%   91.62%   -0.02%     
==========================================
  Files        1336     1336              
  Lines       53230    53241      +11     
  Branches     1647     1647              
==========================================
+ Hits        48778    48782       +4     
- Misses       4131     4138       +7     
  Partials      321      321              
Flag Coverage Δ
apiunit 93.96% <36.36%> (-0.03%) ⬇️

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 36.36364% with 7 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
apps/codecov-api/services/comparison.py 25.00% 6 Missing ⚠️
...i/graphql_api/types/impacted_file/impacted_file.py 66.66% 1 Missing ⚠️

❌ Your patch check has failed because the patch coverage (36.36%) 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.

@thomasrockhu-codecov

Copy link
Copy Markdown
Contributor

🤖 Harness AI Code Review in progress… · View results →

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