Skip to content

fix: page through all list results instead of relying on Page: -1 - #178

Open
ghaering wants to merge 1 commit into
svalabs:mainfrom
ghaering:fix/paging
Open

fix: page through all list results instead of relying on Page: -1#178
ghaering wants to merge 1 commit into
svalabs:mainfrom
ghaering:fix/paging

Conversation

@ghaering

Copy link
Copy Markdown

Page: -1 does not return everything. The SDK sends page=0&limit=0 and Forgejo answers with just the default first page (~30 items), so listing and then searching by name or id missed anything past page 1.

Walk the pages instead. Same as the team fix, applied to the remaining list-then-search data sources and the action secret resources.

Page: -1 does not return everything. The SDK sends page=0&limit=0 and
Forgejo answers with just the default first page (~30 items), so listing
and then searching by name or id missed anything past page 1.

Walk the pages instead. Same as the team fix, applied to the remaining
list-then-search data sources and the action secret resources.
@acch

acch commented Aug 4, 2026

Copy link
Copy Markdown
Member

Hi @ghaering, many thanks for your interest in the provider, and thank you very much for your valuable contribution!

I had been experimenting with the pagination feature (#119) but couldn't really get anywhere, since the API / SDK never returned anything past the first page. That's why we ended up switching to ID-based lookups for organizations, in order to avoid the pagination misbehavior altogether.

Have you tested that the API / SDK pagination now fully works for all objects? Which version of Forgejo is that?

Please include acceptance tests to verify if we can actually retrieve items past the first page.

@acch acch added bug Something isn't working question Further information is requested go Pull requests that update Go code labels Aug 4, 2026

@acch acch left a comment

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.

Please include acceptance tests to verify if we can actually retrieve items past the first page.

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

Labels

bug Something isn't working go Pull requests that update Go code question Further information is requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants