Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

read all repos in org with pagination #76

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

Barbapapazes
Copy link
Member

πŸ”— Linked issue

fix #74

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This support pagination by permitting to pass page and per_page parameters. In the same time, it will also store and return the Link header provided by the API.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@Barbapapazes Barbapapazes added the enhancement New feature or request label Jan 8, 2024
@Barbapapazes Barbapapazes self-assigned this Jan 8, 2024
@Barbapapazes Barbapapazes requested a review from pi0 January 8, 2024 16:26
@pi0 pi0 changed the title feat: support pagination read all repos in org with pagination Mar 6, 2024
`orgs/${event.context.params.owner}/repos?per_page=100`,
const query = getQuery(event);
const page = query.page ? Number(query.page) : 1;
const perPage = query.perPage ? Number(query.perPage) : 100;
Copy link
Member

Choose a reason for hiding this comment

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

I think we can handle the pagination once and return theall pages instead of asking API consumers to do it.

@BobbieGoede
Copy link

This would be a nice addition (and would resolve allow us to resolve issues like nuxt/scripts#295).

@Barbapapazes / @pi0
I can look into implementing the suggested changes if necessary, I assume you meant returning the complete merged/concatenated results? I suppose that boils down to making requests until the result count is less than per_page (may make the response big depending on the request/repo).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support pagination
3 participants