Skip to content

Conversation

@quinlanj
Copy link
Member

@quinlanj quinlanj commented Apr 12, 2024

background

There are a couple flows in eas-cli where we fetch the user's entire dataset (ie) dist certs, push keys, etc. We don't expect the user to have many, but sometimes there are outlier users who end up having way more items than expected. I'm moving these fetches to use our paginated endpoints. We currently attempt to fetch the entire dataset in one request, and for the outlier users with many items, it causes the request to fail/timeout.

Why

This PR makes a generic pagination fetcher to get an entire dataset.

  • Happy case: most users will have <= 1 page of data (20 items), so in this case we don't bother showing a progress bar
  • Medium outlier case: If a user has many items, a progress bar will be displayed. Because we use relay pagination, you cannot know the total number of items in the dataset until you fetch them all, so I've set the progress bar to become full at around 10 pages
medium-150-items-dataset.mov
  • Super outlier case: If a user has so many items that it fills up the progress bar, we update the total estimated work, so the user can still see progress is being made:
large-600-items.mov

Test Plan

  • new tests on full and empty datasets pass

@github-actions
Copy link

github-actions bot commented Apr 12, 2024

Size Change: +104 B (0%)

Total Size: 51.4 MB

Filename Size Change
./packages/eas-cli/dist/eas-linux-x64.tar.gz 51.4 MB +104 B (0%)

compressed-size-action

@codecov
Copy link

codecov bot commented Apr 12, 2024

Codecov Report

Attention: Patch coverage is 93.33333% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 53.73%. Comparing base (40afed1) to head (439abcb).
Report is 8 commits behind head on main.

❗ Current head 439abcb differs from pull request most recent head 7e53059. Consider uploading reports for the commit 7e53059 to get more accurate results

Files Patch % Lines
packages/eas-cli/src/utils/relay.ts 93.34% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2326      +/-   ##
==========================================
+ Coverage   53.68%   53.73%   +0.06%     
==========================================
  Files         525      525              
  Lines       19190    19226      +36     
  Branches     4054     4061       +7     
==========================================
+ Hits        10301    10330      +29     
- Misses       8162     8171       +9     
+ Partials      727      725       -2     

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

@quinlanj
Copy link
Member Author

/changelog-entry chore add progress bar for fetching paginated datasets

@quinlanj quinlanj changed the title [0/n][eas-cli] paginated progress bar [1/2][eas-cli] paginated progress bar Apr 13, 2024
@github-actions
Copy link

✅ Thank you for adding the changelog entry!

@quinlanj quinlanj merged commit a8cde5e into main Apr 15, 2024
@quinlanj quinlanj deleted the @quin/pagination-0 branch April 15, 2024 17:11
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.

4 participants