Skip to content

Add "import since" feature for Gitlab #421

@Zic0-91

Description

@Zic0-91

Hi,

Here is my journey, with the Gitlab plugin.

First I have tried to import everithing. Because my repo is very hudge with lots of commits across to many old branches,
the import process raise a php memory error :

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 16384 bytes) in /var/www/html/vendor/adodb/adodb-php/drivers/adodb-mysqli.inc.php on line 1422

When I check into the database, I can see that commits have been imported.
But it was only old commits.

I have tried to configure the Allowed branches fields with a regex to limit the number of branches to look up but it failed.
Even after fix this issue (see commit 7528e98), I still have my import issue.

The root cause of my import issue is on gitlab, the branches API return only the 20 first branches of the projet.
Results are paginated. We have to iterate over this API and play with per_page and page parameters, ex :
https://gitlab.mycompagny.com/api/v4/projects/id/repository/branches?per_page=100&page=1"

So in commit c005c2f, I propose several improvments :

I change the import strategy:

  • Instead of pulling all branches, and then exclude unwanted one, we pull only interested branches.
  • Add a date to forbid to import oldest commits
    This date allows to limit the number of commits to import.
    On old projet, commits messages may not respects the pattern that allow link a commit with an issue. So it is no use to import then.

I hope the proposal of pull-request #420 will be accepted.

Regards,
Nicolas

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions