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
Previously, GraphQL validation errors, such as missing required arguments (e.g., Field 'repository' argument 'name' of type 'String!' is required, but it was not provided.), were being logged as GraphQL internal server error and sent to Sentry.
This occurred because the error_formatter in apps/codecov-api/graphql_api/views.py only explicitly handled a narrow case of "bad queries" (those containing "Cannot query field"). Other GraphQLErrors, where the original_error was None (indicating a schema validation error from the GraphQL engine itself, not an application-level exception), fell through to the generic internal server error logging.
This change modifies the error_formatter to correctly identify all GraphQL validation errors by checking if error.original_error is None. These errors are client-side issues and should not be treated as internal server errors or trigger Sentry alerts. This reduces noise in Sentry and provides more accurate error reporting.
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.
This PR reclassifies GraphQL validation errors (error.original_error is None) so they are no longer logged as internal server errors or sent to Sentry — a reasonable noise-reduction change. The most important thing to fix first: the existing test test_when_bad_query_and_anonymous still asserts "INTERNAL SERVER ERROR" for an anonymous bad query and will now fail in CI, since that path returns the raw validation message under the new condition. A secondary concern is that original_error is None also matches execution-time errors like "Cannot return null for non-nullable field", which are real resolver bugs that will now be swallowed silently instead of reaching Sentry.
Top findings
HIGH · TESTapps/codecov-api/graphql_api/views.py:351 — New condition breaks existing test test_when_bad_query_and_anonymous (expects INTERNAL SERVER ERROR); test not updated.
MEDIUM · SILENT-FAILUREapps/codecov-api/graphql_api/views.py:351 — Non-null / execution errors (real resolver bugs) also have original_error is None and are now no longer logged or sent to Sentry.
Seer wants to keep iterating on this pull request to get CI passing, but the Sentry GitHub App installation is missing permissions it needs to read the failing checks and push a fix.
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.
Previously, GraphQL validation errors, such as missing required arguments (e.g.,
Field 'repository' argument 'name' of type 'String!' is required, but it was not provided.), were being logged asGraphQL internal server errorand sent to Sentry.This occurred because the
error_formatterinapps/codecov-api/graphql_api/views.pyonly explicitly handled a narrow case of "bad queries" (those containing "Cannot query field"). OtherGraphQLErrors, where theoriginal_errorwasNone(indicating a schema validation error from the GraphQL engine itself, not an application-level exception), fell through to the generic internal server error logging.This change modifies the
error_formatterto correctly identify all GraphQL validation errors by checking iferror.original_error is None. These errors are client-side issues and should not be treated as internal server errors or trigger Sentry alerts. This reduces noise in Sentry and provides more accurate error reporting.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-F1B
This PR was automatically generated by Sentry. You can adjust this setting at any time.