Skip to content

Gitlab - update fails when branch qty > gitlab REST API pagination default setting #389

Open

Description

@fmancardi

I've a repo with 22 branches and obviously this is greater than Gitlab default -> 20.
Please add at least add '&per_page=50' or may be '&per_page=100' when building the uri in the following function
public function import_full( $p_repo ) {

# Always pull back full list of repos
$t_repoid = $p_repo->info['hub_repoid'];
$t_uri = $this->api_uri( $p_repo, "projects/$t_repoid/repository/branches" );

# My silly FIX !!! - fmancardi
$t_uri .= '&per_page=50';

may be there is a better solution.
And maybe this '&per_page=xx' need to be added to other REST API call

Best regards

Activity

  1. changed the title [-]Gitlab - update failed when branch qty > that gitlab REST API pagination setting[/-] [+]Gitlab - update fails when branch qty > gitlab REST API pagination default setting[/+] on Feb 24, 2022
  2. dregad commented on Apr 28, 2022

    @dregad
    Member

    @fmancardi it would probably be better to implement pagination in this case, as if we just bump the per_page limit sooner or later you or someone else will hit the new limit.

    The Gitlab plugin is community-maintained, so contributions are welcome.

    I suggest you have a look at how this is done in the SourceGithub plugin, the logic can probably be applied to Gitlab fairly easily.

  3. fmancardi commented on Apr 28, 2022

    @fmancardi
    Author
  4. dregad commented on Jul 13, 2022

    @dregad
    Member
  5. Zic0-91 commented on Oct 1, 2025

    @Zic0-91

    Hi,

    The pull request #420 could fix your issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions