API doesn't return pagination headers for /api/v3/projects/:id/repository/commits endpoint
(this is a repost of github issue https://github.com/gitlabhq/gitlabhq/issues/10040 (see initial discussion on that link))
Just found that latest version doesn't return X-Total-Pages and other headers for some of endpoints which has pagination support.
Sample:
$ curl -i "http://192.168.7.3/api/v3/projects/4/repository/commits?&page=0&per_page=10"
HTTP/1.1 200 OK
Server: nginx
Date: Thu, 18 Feb 2016 03:53:04 GMT
Content-Type: application/json
Content-Length: 2499
Connection: keep-alive
Cache-Control: max-age=0, private, must-revalidate
Etag: W/"9363a8f706ca53938e5f390840f4d4f9"
Status: 200 OK
Vary: Origin
X-Request-Id: 4f862a82-c43e-4d3c-8ba6-68c284fd0ff1
X-Runtime: 0.048007
For different endpoints it's seems works well:
$ curl -i "http://192.168.7.3/api/v3/projects/4/issues/2/notes?&page=0&per_page=2"
HTTP/1.1 200 OK
Server: nginx
Date: Thu, 18 Feb 2016 04:00:34 GMT
Content-Type: application/json
Content-Length: 783
Connection: keep-alive
Cache-Control: max-age=0, private, must-revalidate
Etag: W/"2644593ddd365520cf4aa0fc0b95cfde"
Link: <http://192.168.7.3/api/v3/projects/4/issues/2/notes?page=2&per_page=2>; rel="next", <http://192.168.7.3/api/v3/projects/4/issues/2/notes?page=1&per_page=2>; rel="first", <http://192.168.7.3/api/v3/projects/4/issues/2/notes?page=4&per_page=2>; rel="last"
Status: 200 OK
Vary: Origin
X-Next-Page: 2
X-Page: 1
X-Per-Page: 2
X-Prev-Page:
X-Request-Id: b7991204-56fa-430b-87bd-6ebc3c09e271
X-Runtime: 0.062908
X-Total: 8
X-Total-Pages: 4
Gitlab installation info:
CentOS Linux release 7.2.1511 (Core)
System information
System:
Current User: git
Using RVM: no
Ruby Version: 2.1.8p440
Gem Version: 2.5.1
Bundler Version:1.10.6
Rake Version: 10.5.0
Sidekiq Version:4.0.1
GitLab information
Version: 8.4.4
Revision: 9c31cc6
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
URL: http://192.168.7.3
HTTP Clone URL: http://192.168.7.3/some-group/some-project.git
SSH Clone URL: git@192.168.7.3:some-group/some-project.git
Using LDAP: no
Using Omniauth: no
GitLab Shell
Version: 2.6.10
Repositories: /var/opt/gitlab/git-data/repositories
Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks/
Git: /opt/gitlab/embedded/bin/git
(installed from Omnibus Package)
Application Check
$ sudo gitlab-rake gitlab:check SANITIZE=true
Checking GitLab Shell ...
GitLab Shell version >= 2.6.10 ? ... OK (2.6.10)
Repo base directory exists? ... yes
Repo base directory is a symlink? ... no
Repo base owned by git:git? ... yes
Repo base access is drwxrws---? ... yes
hooks directories in repos are links: ...
1/2 ... ok
1/4 ... ok
1/5 ... ok
1/6 ... ok
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: OK
Check directories and files:
/var/opt/gitlab/git-data/repositories: OK
/var/opt/gitlab/.ssh/authorized_keys: OK
Test redis-cli executable: redis-cli 2.8.21
Send ping to redis server: PONG
gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes
Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Reply by email ...
Reply by email is disabled in config/gitlab.yml
Checking Reply by email ... Finished
Checking LDAP ...
LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab ...
Git configured with autocrlf=input? ... yes
Database config exists? ... yes
Database is SQLite ... no
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory setup correctly? ... skipped (no tmp uploads folder yet)
Init script exists? ... skipped (omnibus-gitlab has no init script)
Init script up-to-date? ... skipped (omnibus-gitlab has no init script)
projects have namespace: ...
1/2 ... yes
1/4 ... yes
1/5 ... yes
1/6 ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.1.0 ? ... yes (2.1.8)
Your git bin path is "/opt/gitlab/embedded/bin/git"
Git version >= 1.7.10 ? ... yes (2.6.2)
Active users: 1
Checking GitLab ... Finished