Repository navigation
fix(pull-page): prevent GraphQL query with non-numeric pullId - #4138
sentry[bot] wants to merge 1 commit into
Conversation
|
The Sentry GitHub App installation for this repository is missing permissions it needs to keep iterating on this pull request to get CI passing. Review and accept the updated permissions to let Seer continue: https://github.com/organizations/codecov/settings/installations/86101127/permissions/update |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4138 +/- ##
==========================================
- Coverage 98.77% 98.76% -0.01%
==========================================
Files 823 823
Lines 15147 15150 +3
Branches 4387 4380 -7
==========================================
+ Hits 14961 14963 +2
- Misses 179 180 +1
Partials 7 7
Continue to review full report in Codecov by Harness.
|
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #4138 +/- ##
==========================================
- Coverage 98.77% 98.76% -0.01%
==========================================
Files 823 823
Lines 15147 15150 +3
Branches 4387 4388 +1
==========================================
+ Hits 14961 14963 +2
- Misses 179 180 +1
Partials 7 7
Continue to review full report in Codecov by Harness.
|
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
@@ Coverage Diff @@
## main #4138 +/- ##
==========================================
- Coverage 98.77% 98.76% -0.01%
==========================================
Files 823 823
Lines 15147 15150 +3
Branches 4379 4380 +1
==========================================
+ Hits 14961 14963 +2
- Misses 179 180 +1
Partials 7 7
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #4138 +/- ##
==========================================
- Coverage 98.77% 98.76% -0.01%
==========================================
Files 823 823
Lines 15147 15150 +3
Branches 4387 4380 -7
==========================================
+ Hits 14961 14963 +2
- Misses 179 180 +1
Partials 7 7
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Bundle ReportChanges will increase total bundle size by 201 bytes (0.0%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: gazebo-production-esmAssets Changed:
Files in
view changes for bundle: gazebo-production-systemAssets Changed:
Files in
|
Description
The
PullPageDataQueryOptsingazebowas sendingpullId: nullto the GraphQL API when thepullIdroute parameter was not a valid integer. This typically happened for legacy/compare/<sha>...<sha>URLs that redirect to/pull/<sha>...<sha>, where the commit range was passed aspullId.parseInt(pullId, 10)would result inNaNfor non-numeric values, which then gets serialized asnullin the GraphQL variables. Since the API'spull(id: Int!)argument is non-nullable, this caused aGraphQLErroron the API side, which was being reported as an internal server error.Code Example
Problematic GraphQL variable serialization:
GraphQL API argument:
Previous parsing logic:
New logic involves checking
pullIdusing a regex and returningpull: nullif not numeric.Notable Changes
This change modifies
PullPageDataQueryOptsto check if thepullIdis numeric using a regex. If it's not numeric, the GraphQL query is skipped, and a result withpull: nullis returned. This allows thePullRequestPageto correctly render aNotFoundpage for such URLs, preventing the API error.Screenshots
Link to Sample Entry
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-CDS
@sentry <feedback>: Autofix iterates on these changes@sentry stop iterating: Autofix stops iterating on this runThis PR was automatically generated by Sentry. You can adjust this setting at any time.