Skip to content

read all repos in org with pagination#76

Draft
Barbapapazes wants to merge 2 commits into
mainfrom
feat/pagination
Draft

read all repos in org with pagination#76
Barbapapazes wants to merge 2 commits into
mainfrom
feat/pagination

Conversation

@Barbapapazes

Copy link
Copy Markdown
Contributor

🔗 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
Copy Markdown
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
Copy Markdown

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).

lil2kki added a commit to lil2kki/ungh-exp that referenced this pull request Jul 5, 2025
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