feat(graphql): add partialsCount to ImpactedFile type - #1985
Conversation
Codecov Report❌ Patch coverage is
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
Codecov Report❌ Patch coverage is
❌ 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:
|
|
🤖 Harness AI Code Review in progress… · View results → |
This PR addresses the
GraphQLError: Cannot query field 'partialsCount' on type 'ImpactedFile'.The root cause was that the
ImpactedFileGraphQL type did not expose apartialsCountfield, even thoughmissesCountwas 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:
apps/codecov-api/services/comparison.py: Added acached_propertynamedpartials_countto theImpactedFileservice class. This property calculates the total number of partials by iterating throughadded_diff_coverageand counting lines marked as 'p', mirroring the existingmisses_countlogic.apps/codecov-api/graphql_api/types/impacted_file/impacted_file.graphql: Updated theImpactedFileGraphQL type definition to includepartialsCount: Int!.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 thepartials_countproperty from theImpactedFileservice 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