You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR addresses the GraphQLError: Cannot query field 'linesCount' on type 'ImpactedFile'. Did you mean 'missesCount'? by adding the linesCount field to the ImpactedFile GraphQL type.
Previously, clients attempting to query linesCount on ImpactedFile would encounter an error because this field was not defined in the schema. The total line count can be derived from the headCoverage totals (hits + misses + partials).
Changes include:
Added linesCount: Int! to the ImpactedFile type definition in apps/codecov-api/graphql_api/types/impacted_file/impacted_file.graphql.
Implemented a @cached_property lines_count on the ImpactedFile dataclass in apps/codecov-api/services/comparison.py. This property calculates the total lines by summing head_coverage.hits, head_coverage.misses, and head_coverage.partials. It returns 0 if head_coverage is None (e.g., for deleted files).
Created a resolver resolve_lines_count in apps/codecov-api/graphql_api/types/impacted_file/impacted_file.py to expose this new property 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.
❌ Patch coverage is 50.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.63%. Comparing base (a8ec2db) to head (597958d).
✅ All tests successful. No failed tests found.
❌ Your patch check has failed because the patch coverage (50.00%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage.
📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses the
GraphQLError: Cannot query field 'linesCount' on type 'ImpactedFile'. Did you mean 'missesCount'?by adding thelinesCountfield to theImpactedFileGraphQL type.Previously, clients attempting to query
linesCountonImpactedFilewould encounter an error because this field was not defined in the schema. The total line count can be derived from theheadCoveragetotals (hits + misses + partials).Changes include:
linesCount: Int!to theImpactedFiletype definition inapps/codecov-api/graphql_api/types/impacted_file/impacted_file.graphql.@cached_property lines_counton theImpactedFiledataclass inapps/codecov-api/services/comparison.py. This property calculates the total lines by summinghead_coverage.hits,head_coverage.misses, andhead_coverage.partials. It returns 0 ifhead_coverageisNone(e.g., for deleted files).resolve_lines_countinapps/codecov-api/graphql_api/types/impacted_file/impacted_file.pyto expose this new property 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-EWF
This PR was automatically generated by Sentry. You can adjust this setting at any time.