The source project of this merge request has been removed.
fix: handle multiple gitlab groups (config argument) properly
Why
Before the fix, whenever multiple groups are passed to the config like this:
{
"api_url": "https://gitlab.com",
"private_token": "XXXXXX",
"projects": "",
"groups": "1234 5678",
"start_date": "2020-04-01T00:00:00Z"
}
the project-level API requests fetch only project data for the first group: 1234, completely skipping projects of group 5678.
The reason is that this condition https://gitlab.com/meltano/tap-gitlab/-/blob/master/tap_gitlab/init.py#L477 is never met for the 2nd, 3rd, 4th etc group - because pids of the 1st group are already occupying the list.
What
Move sync_project execution inside the "if" statement which checks whether any pids have been provided to the tap. If no pids were provided, just execute sync_project on the fly but don't persist "pids of a group" so that the 2nd, 3rd and next iterations of the for gid in gids loop are not impacted.