#!/usr/bin/env perl
use strict;
use warnings;
use GitLab::API::v4;
use Data::Dumper;
use feature qw(switch say);
my $project_id= 15730252; # this project
my $gitlab_api_url = 'https://gitlab.com/api/v4';
my $gitlab_api_token = $ENV{'GITLAB_COM_PRIVATE_TOKEN'};
my $api = GitLab::API::v4->new(
url => $gitlab_api_url,
private_token => $gitlab_api_token,
);
my %params;
my $branches = $api->branches( $project_id );
#say Dumper($branches);
my $commits = $api->commits(
$project_id,
\%params,
);
my @coll_commits;
foreach(@{$commits}) {
my $c = $_;
push @coll_commits, $c->{'title'};
}
say join("\n", @coll_commits);
generates
Perl: Add query.pl
Perl: Add API Playground
Perl: Add library as submodule
Python: Adjust protected branches levels
Python: Add protected branch creation tests
Import Python API client playground
Initial commit
ok, so you are using the paginator class which maybe behaves differently to just fetching the commit history.
I’ve modified my code to use pagination as well, and yet I cannot see any commit logs from the submodule itself.
======== Commits ========
Add Perl to README
Perl: Add query.pl
Perl: Add API Playground
Perl: Add library as submodule
Python: Adjust protected branches levels
Python: Add protected branch creation tests
Import Python API client playground
Initial commit
======== Paginated Commits ========
Add Perl to README
Perl: Add query.pl
Perl: Add API Playground
Perl: Add library as submodule
Python: Adjust protected branches levels
Python: Add protected branch creation tests
Import Python API client playground
Initial commit
Can you test that in your code as well, and provide some evidence from your git commit history - a screenshot from Gitlab’s view (or git log) and the output of your API script?
Besides, which Perl version and GitLab::API::v4 module version are involved here?