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

Fix pagination being ignored for Gitea #66

Merged
merged 3 commits into from
Jun 21, 2020
Merged

Conversation

CirnoT
Copy link
Contributor

@CirnoT CirnoT commented Jun 19, 2020

Fixes #64

Gitea implementation was completely ignoring opts from Drone, so after we introduced proper pagination headers in v1.12, Drone would ask go-scm for page 2, and go-scm would request page 1 and return it, causing infinite loop of requests.

@moepman
Copy link

moepman commented Jun 19, 2020

Sorry for being slightly off-topic here, but my go skills are not good enough to tell it to use your patch when building drone. If you could give me a pointer how to achieve that I'd like to rebuild drone and report back if this actually fixes go-gitea/gitea#11970

@paulbsd
Copy link

paulbsd commented Jun 19, 2020

Hi,

On your commit, there're mentions to "per_page" parameters but on the Gitea API version 1.12.0, per_page doesn't exists, and may be replaced by "limit".

Paul

@CirnoT
Copy link
Contributor Author

CirnoT commented Jun 20, 2020

Ah sorry @paulbsd didn't notice that when copying util file from github implementation

@CirnoT
Copy link
Contributor Author

CirnoT commented Jun 20, 2020

@moepman Before building drone you need to go get new version of go-scm.

@CirnoT
Copy link
Contributor Author

CirnoT commented Jun 20, 2020

@bradrydzewski I've went ahead and added support for pagination on every endpoint. I do not guarantee that all of them support pagination right now, but If i am right then it won't matter anyway because Drone will never ask go-scm for next page if Link header is not present.

@moepman
Copy link

moepman commented Jun 20, 2020

@moepman Before building drone you need to go get new version of go-scm.

I still didn't quite figure out how to tell go get use your branch instead of upstream...
However: putting the contents of CrinoT/patch-1 inside go/pkg/mod/github.com/drone/[email protected] and then running go install github.com/drone/drone/cmd/drone-server resulted in a drone-server binary that would correctly display all of my 33 repositories from my gitea 1.12 installation :)
So I can confirm that this should fix the issue.

@bradrydzewski bradrydzewski merged commit 3731ec1 into drone:master Jun 21, 2020
@CirnoT CirnoT deleted the patch-1 branch June 21, 2020 20:45
jstrachan pushed a commit to jstrachan/go-scm that referenced this pull request Dec 22, 2020
fix: add an API for listing files in a repository
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.

paginate Gitea repository list
5 participants