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

When activating a Bitbucket repo, server requests for branches endlessly #2506

Closed
mzampetakis opened this issue Sep 27, 2023 · 2 comments · Fixed by #2509
Closed

When activating a Bitbucket repo, server requests for branches endlessly #2506

mzampetakis opened this issue Sep 27, 2023 · 2 comments · Fixed by #2509
Labels
bug Something isn't working

Comments

@mzampetakis
Copy link
Contributor

Component

server

Describe the bug

As soon as I activate a repo from bitbucket forge through UI, It sends multiple request to fetch the repo's branches for different pages. So we have consecutive requests with page incrementing by 1 after each call:

/api/repos/5/branches?page=1
/api/repos/5/branches?page=2
/api/repos/5/branches?page=3
/api/repos/5/branches?page=4
/api/repos/5/branches?page=5
/api/repos/5/branches?page=6
...

All of then result in http 200 but with the exact same result:

["master"]

It seems that UI expects to receive an empty response ([]) in order to stop invoking for the next page.

System Info

Local environment from main (commit: #0eacbe8a33823b75e1ecdd738f6c0cad00bd7d68)

The output of `/version` is:

{"source":"https://github.com/woodpecker-ci/woodpecker","version":"dev"}


### Additional context

Tested using other forges (Github & Gitlab) and the issue does not occurs.

![Screenshot 2023-09-27 at 21 55 51](https://github.com/woodpecker-ci/woodpecker/assets/16765483/0a1f929d-4887-470f-a10c-414662341360)

The same log is repeated over and over agian:

9:54PM DBG server/router/middleware/logger.go:59 > ip=XXX latency=287.846458 method=GET path=/api/repos/5/branches status=200 user-agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36"


### Validations

- [X] Read the [Contributing Guidelines](https://github.com/woodpecker-ci/woodpecker/blob/main/CONTRIBUTING.md).
- [X] Read the [docs](https://woodpecker-ci.org/docs/intro).
- [X] Check that there isn't [already an issue](https://github.com/woodpecker-ci/woodpecker/issues) that reports the same bug to avoid creating a duplicate.
- [X] Checked that the bug isn't fixed in the `next` version already [https://woodpecker-ci.org/faq#which-version-of-woodpecker-should-i-use]
- [X] Check that this is a concrete bug. For Q&A join our [Discord Chat Server](https://discord.gg/fcMQqSMXJy) or the [Matrix room](https://matrix.to/#/#woodpecker:matrix.org).
@mzampetakis mzampetakis added the bug Something isn't working label Sep 27, 2023
@mzampetakis mzampetakis changed the title When activating a Bitbucket repo server requests for branches endlessly When activating a Bitbucket repo, server requests for branches endlessly Sep 27, 2023
@qwerty287
Copy link
Contributor

Looks like pagination done wrong. Do you know how you can paginate in bitbucket?

@mzampetakis
Copy link
Contributor Author

Indeed. It seems that the specific request is missing the pagination parameters. I have paginated other requests towards bitbucket, so I will find that out and open a PR when possible.

mzampetakis pushed a commit to mzampetakis/woodpecker that referenced this issue Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants