Gitea import does not import all issues
During the import of Gitea repositories into GitLab some issues may be skipped over due to query string parameters changing during API pagination requests.
Steps to reproduce
Import a Gitea repository containing more than 10 issues, some of which are closed. This results in not all issues being imported.
What is the current bug behavior?
When an import from a Gitea repository is kicked off it attempts to import all the issues. The first query to the Gitea API is correct in that it sends a requests like:
However, subsequent pagination requests to the API don't include the query string parameters included in the first request. ie:
While the Gitea API ignores the
sort query parameters anyway, the missing
state=all parameter causes Gitea to only return the default "open" issues. This causes all closed issues not returned by the first request to not be imported, as well any open issues that get lost because they weren't included in the initial request because that request included closed issues.
What is the expected correct behavior?
All Gitea issues imported correctly with none being lost.
As best as I could track down, it seems to be an issues somewhere within the call to increment_page(resource_type) which appears to follow a different code path to initial requests made by client.public_send(resource_type, *opts)
Given that the problem is in the fetch_resources(resource_type, *opts) method, this issues may affect the importing of other resource types as well.