Skip to content

Conversation

@laumann
Copy link
Contributor

@laumann laumann commented Feb 1, 2026

  1. The teams API doesn't provide the Link header other paginated endpoints do - workaround with X-Total-Count
  2. Team descriptions are limited to 255 chars
  3. Fix subtle bug in setting up cb_members

@laumann
Copy link
Contributor Author

laumann commented Feb 1, 2026

@mgorny I've tested this with the full projects.xml and it seems to work.

# providing the Link header to the next page. We do get the
# X-Total-Count header which lets us work out the number of
# pages ourselves.
url = f"{self.orgs_baseurl}/{org}/teams/"
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 it makes sense to increase the limit here and for other paginated data. It's not like we're going to do parts of it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Increased to 100

There's literally a missing Link. The Link header that is usually
provided for paginated responses is simply not provided for this
particular endpoint. Fortunately the X-Total-Count header is provided
so we can work out how many pages to fetch.

While we're at it, we increase the default page size as well.

Signed-off-by: Thomas Bracht Laumann Jespersen <[email protected]>
The team description field is limited to 255 characters, so let's
stick within that limit and truncate entries that are too long.

Signed-off-by: Thomas Bracht Laumann Jespersen <[email protected]>
Using "devs.get(x)" instead of "x in devs" not only lets us filter out
the cases where x is not in devs, but also the cases where the devs[x]
entry is None or an empty string.

Signed-off-by: Thomas Bracht Laumann Jespersen <[email protected]>
@laumann
Copy link
Contributor Author

laumann commented Feb 2, 2026

Filed a bug for the teams pagination issue: go-gitea/gitea#36516

UPDATE! A fix is in the making: https://codeberg.org/forgejo/forgejo/pulls/9910

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.

2 participants