Skip to content

feat(graphql): add linesCount to ImpactedFile type - #2028

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

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

Conversation

@sentry

@sentry sentry Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

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.

Fixes API-EWF

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

@thomasrockhu-codecov

Copy link
Copy Markdown
Contributor
✨ Harness AI Code Review View in Harness →

ℹ️ Review in progress — analyzing the changes on this pull request.
This comment updates automatically when the review finishes.

@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

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

Files with missing lines Patch % Lines
apps/codecov-api/services/comparison.py 40.00% 3 Missing ⚠️
...i/graphql_api/types/impacted_file/impacted_file.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2028      +/-   ##
==========================================
- Coverage   91.63%   91.63%   -0.01%     
==========================================
  Files        1336     1336              
  Lines       53230    53238       +8     
  Branches     1647     1647              
==========================================
+ Hits        48778    48782       +4     
- Misses       4131     4135       +4     
  Partials      321      321              
Flag Coverage Δ
apiunit 93.97% <50.00%> (-0.02%) ⬇️

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 50.00000% with 4 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 40.00% 3 Missing ⚠️
...i/graphql_api/types/impacted_file/impacted_file.py 66.66% 1 Missing ⚠️

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

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

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