-
Notifications
You must be signed in to change notification settings - Fork 2
Fix some issues with syncing projects on codeberg #5
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
base: master
Are you sure you want to change the base?
Conversation
|
@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/" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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]>
11046d0 to
ab33584
Compare
|
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 |
Linkheader other paginated endpoints do - workaround withX-Total-Countcb_members