Skip to content

fix(graphql): add deprecated orderingDirection to ImpactedFilesFilters for backward compatibility - #1982

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/graphql-ordering-direction-compat
Open

fix(graphql): add deprecated orderingDirection to ImpactedFilesFilters for backward compatibility#1982
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/graphql-ordering-direction-compat

Conversation

@sentry

@sentry sentry Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

This PR addresses a GraphQLError where older clients were querying the impactedFiles field with filters: {orderingDirection: NAME}. The ImpactedFilesFilters input type was refactored to use a nested ordering: { direction, parameter } structure, causing these queries to fail.

To maintain backward compatibility for existing clients, this change introduces the following:

  1. Schema Update: Added orderingDirection: OrderingDirection as a deprecated field to the ImpactedFilesFilters input type in apps/codecov-api/graphql_api/types/inputs/impacted_files_filters.graphql. This allows the GraphQL engine to accept the old field without error.
  2. Interactor Logic: Modified the _apply_filters method in apps/codecov-api/compare/commands/compare/interactors/fetch_impacted_files.py to check for orderingDirection if the nested ordering.direction is not provided. When orderingDirection is used, the parameter is defaulted to FILE_NAME to match the expected behavior of the old query.

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

@thomasrockhu-codecov

Copy link
Copy Markdown
Contributor

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

@codecov-notifications

codecov-notifications Bot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...mmands/compare/interactors/fetch_impacted_files.py 80.00% 1 Missing ⚠️

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

@codecov

codecov Bot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 91.61%. Comparing base (68c86d1) to head (d8da879).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...mmands/compare/interactors/fetch_impacted_files.py 80.00% 1 Missing ⚠️

❌ Your patch check has failed because the patch coverage (80.00%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1982      +/-   ##
==========================================
- Coverage   91.61%   91.61%   -0.01%     
==========================================
  Files        1336     1336              
  Lines       53174    53177       +3     
  Branches     1647     1647              
==========================================
+ Hits        48715    48717       +2     
- Misses       4138     4139       +1     
  Partials      321      321              
Flag Coverage Δ
apiunit 93.94% <80.00%> (-0.01%) ⬇️

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.

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