Skip to content

fix(pull-page): prevent GraphQL query with non-numeric pullId - #4138

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/non-numeric-pull-id
Open

sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/non-numeric-pull-id

Conversation

@sentry

@sentry sentry Bot commented Oct 3, 2026

Copy link
Copy Markdown

Description

The PullPageDataQueryOpts in gazebo was sending pullId: null to the GraphQL API when the pullId route 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 as pullId.

parseInt(pullId, 10) would result in NaN for non-numeric values, which then gets serialized as null in the GraphQL variables. Since the API's pull(id: Int!) argument is non-nullable, this caused a GraphQLError on the API side, which was being reported as an internal server error.

Code Example

Problematic GraphQL variable serialization:

pullId: null

GraphQL API argument:

pull(id: Int!)

Previous parsing logic:

parseInt(pullId, 10)

New logic involves checking pullId using a regex and returning pull: null if not numeric.

Notable Changes

This change modifies PullPageDataQueryOpts to check if the pullId is numeric using a regex. If it's not numeric, the GraphQL query is skipped, and a result with pull: null is returned. This allows the PullRequestPage to correctly render a NotFound page 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 run

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

@sentry

sentry Bot commented Oct 3, 2026

Copy link
Copy Markdown
Author

⚠️ Sentry needs additional GitHub App permissions

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

codecov Bot commented Oct 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 98.76%. Comparing base (b8fbfc0) to head (f5ed282).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
.../PullRequestPage/queries/PullPageDataQueryOpts.tsx 75.00% 1 Missing ⚠️
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              
Files with missing lines Coverage Δ
.../PullRequestPage/queries/PullPageDataQueryOpts.tsx 96.29% <75.00%> (-3.71%) ⬇️
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.72% <ø> (ø)
Pages 98.42% <75.00%> (-0.02%) ⬇️
Services 99.32% <ø> (ø)
Shared 98.94% <ø> (ø)
UI 99.02% <ø> (ø)

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b8fbfc0...f5ed282. Read the comment docs.

@codecov-notifications

Copy link
Copy Markdown

Codecov Report

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

Files with missing lines Patch % Lines
.../PullRequestPage/queries/PullPageDataQueryOpts.tsx 75.00% 1 Missing ⚠️
@@            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              
Files with missing lines Coverage Δ
.../PullRequestPage/queries/PullPageDataQueryOpts.tsx 96.29% <75.00%> (-3.71%) ⬇️
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.72% <ø> (ø)
Pages 98.42% <75.00%> (-0.02%) ⬇️
Services 99.32% <ø> (ø)
Shared 98.94% <ø> (ø)
UI 99.02% <ø> (ø)

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b8fbfc0...f5ed282. Read the comment docs.

@codecov-public-qa

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 98.76%. Comparing base (b8fbfc0) to head (f5ed282).

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
.../PullRequestPage/queries/PullPageDataQueryOpts.tsx 75.00% 1 Missing ⚠️
@@            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              
Files with missing lines Coverage Δ
.../PullRequestPage/queries/PullPageDataQueryOpts.tsx 96.29% <75.00%> (-3.71%) ⬇️
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.72% <ø> (ø)
Pages 98.42% <75.00%> (-0.02%) ⬇️
Services 99.32% <ø> (ø)
Shared 98.94% <ø> (ø)
UI 99.02% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b8fbfc0...f5ed282. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codecov-qa

codecov-qa Bot commented Oct 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 98.76%. Comparing base (b8fbfc0) to head (f5ed282).

Files with missing lines Patch % Lines
.../PullRequestPage/queries/PullPageDataQueryOpts.tsx 75.00% 1 Missing ⚠️
@@            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              
Files with missing lines Coverage Δ
.../PullRequestPage/queries/PullPageDataQueryOpts.tsx 96.29% <75.00%> (-3.71%) ⬇️
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.72% <ø> (ø)
Pages 98.42% <75.00%> (-0.02%) ⬇️
Services 99.32% <ø> (ø)
Shared 98.94% <ø> (ø)
UI 99.02% <ø> (ø)

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b8fbfc0...f5ed282. Read the comment docs.

🚀 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 Oct 3, 2026

Copy link
Copy Markdown

Bundle Report

Changes will increase total bundle size by 201 bytes (0.0%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
gazebo-production-system 5.82MB 97 bytes (0.0%) ⬆️
gazebo-production-esm 5.89MB 104 bytes (0.0%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: gazebo-production-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index.*.js 104 bytes 125.74kB 0.08%

Files in assets/index.*.js:

  • ./src/pages/PullRequestPage/queries/PullPageDataQueryOpts.tsx → Total Size: 5.99kB
view changes for bundle: gazebo-production-system

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index-legacy.*.js 97 bytes 113.16kB 0.09%

Files in assets/index-legacy.*.js:

  • ./src/pages/PullRequestPage/queries/PullPageDataQueryOpts.tsx → Total Size: 5.99kB

This branch has not been deployed

No deployments
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.

0 participants