Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Optimize fetch_repository resolver#1261

Merged
Swatinem merged 3 commits intomainfrom
swatinem/repo-resolver-fields
Apr 1, 2025
Merged

Optimize fetch_repository resolver#1261
Swatinem merged 3 commits intomainfrom
swatinem/repo-resolver-fields

Conversation

@Swatinem
Copy link
Copy Markdown
Contributor

@Swatinem Swatinem commented Apr 1, 2025

Previously, the owner.repository resolver would unconditionally execute a very complicated query through fetch_repository.

We can avoid that expensive subquery by inspecting the requested fields as stated in the graphql query.


This might fix codecov/engineering-team#3396

Previously, the `owner.repository` resolver would unconditionally execute a very complicated query through `fetch_repository`.

We can avoid that expensive subquery by inspecting the requested fields as stated in the graphql query.
@Swatinem Swatinem requested a review from adrian-codecov April 1, 2025 11:19
@Swatinem Swatinem self-assigned this Apr 1, 2025
@Swatinem Swatinem requested a review from a team as a code owner April 1, 2025 11:19
@seer-by-sentry
Copy link
Copy Markdown
Contributor

seer-by-sentry bot commented Apr 1, 2025

✅ Sentry found no issues in your recent changes ✅

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2025

Codecov Report

Attention: Patch coverage is 92.10526% with 3 lines in your changes missing coverage. Please review.

Project coverage is 96.32%. Comparing base (1983799) to head (1649d07).
Report is 2 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
graphql_api/helpers/requested_fields.py 88.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1261      +/-   ##
==========================================
- Coverage   96.33%   96.32%   -0.02%     
==========================================
  Files         492      493       +1     
  Lines       16898    16933      +35     
==========================================
+ Hits        16278    16310      +32     
- Misses        620      623       +3     
Flag Coverage Δ
unit 96.32% <92.10%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@codecov-notifications
Copy link
Copy Markdown

codecov-notifications bot commented Apr 1, 2025

Codecov Report

Attention: Patch coverage is 92.10526% with 3 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
graphql_api/helpers/requested_fields.py 88.00% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor

@joseph-sentry joseph-sentry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would just leave a comment in the requested_fields.py to look at graphql/language/parser.py to understand what's going on there

@Swatinem Swatinem enabled auto-merge April 1, 2025 14:53
@Swatinem Swatinem added this pull request to the merge queue Apr 1, 2025
Merged via the queue into main with commit defc6a5 Apr 1, 2025
19 of 24 checks passed
@Swatinem Swatinem deleted the swatinem/repo-resolver-fields branch April 1, 2025 15:05
@sentry
Copy link
Copy Markdown

sentry bot commented Apr 14, 2025

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ OperationalError: server closed the connection unexpectedly /graphql/{service} View Issue
  • ‼️ GraphQLError: server closed the connection unexpectedly /graphql/{service} View Issue

Did you find this useful? React with a 👍 or 👎

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[API] - Improve FetchRepositoryInteractor.execute resolve time

2 participants