fix(graphql): restore directChangedFiles field on Comparison type - #1981
fix(graphql): restore directChangedFiles field on Comparison type#1981sentry[bot] wants to merge 1 commit into
Conversation
|
🤖 Harness AI Code Review in progress… · View results → |
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (37.50%) 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:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1981 +/- ##
==========================================
- Coverage 91.61% 91.60% -0.01%
==========================================
Files 1336 1336
Lines 53174 53182 +8
Branches 1647 1647
==========================================
+ Hits 48715 48718 +3
- Misses 4138 4143 +5
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. |
This PR addresses issue API-EVX, where an external client was encountering a
GraphQLError: Cannot query field 'directChangedFiles' on type 'Comparison'.The root cause was that the
ComparisonGraphQL type only exposeddirectChangedFilesCount(an integer) but not thedirectChangedFilesconnection field that the client was attempting to query.To resolve this, the following changes were made:
Schema Update (
apps/codecov-api/graphql_api/types/comparison/comparison.graphql):directChangedFiles(filters: ImpactedFilesFilters): ImpactedFilesResult!field to theComparisontype.Resolver Implementation (
apps/codecov-api/graphql_api/types/comparison/comparison.py):resolve_direct_changed_fileswas added.command.fetch_impacted_filesmethod.has_unintended_changes=Falsein the filters to ensure that only files with direct changes are returned, aligning with the semantic meaning of 'direct changed files'.ImpactedFilesResultformat, which is consistent with other file list queries.Note for clients: While the field is restored, clients previously querying with Relay-style
edges { node { headName } }will need to adjust their queries to use theresults: [...]structure provided byImpactedFilesResult.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-EVX