v4 Recursive File Listing Broken for /repository/tree?recursive=1 API Call
Summary
The page documenting changes from v3 to v4:
https://docs.gitlab.com/ce/api/v3_to_v4.html
There are no mentions of any changes to repository/trees for recursive behaviour with repository/trees,
so I assume that the behaviour for recursion from v3 to v4 should be consistent.
When I use v4 with repository/trees and recursion=true however only trees/directories are listed, without blobs.
The original feature branch that added in recursion:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6088/
Steps to reproduce
http://gitlab.EXAMPLE.com/api/v3/projects/:id/repository/tree?recursive=1
vs.
http://gitlab.EXAMPLE.com/api/v4/projects/:id/repository/tree?recursive=1
v3 will list all blobs and trees,
v4 will list only trees.
Example Project
Will comment an example project if one is made later on. Should be easily reproduceable with following structure:
tree1
-> blob1
blob2
What is the current bug behavior?
v4 only lists trees, excluding all blobs, when recursive = true (eg. tree1).
When recursion is off, the behaviour is as expected, listing all trees and blobs non-recursively (tree1, blob1)
What is the expected correct behavior?
When recursion is true, all blobs and trees should be listed (tree1, tree1/blob1, blob2)
Relevant logs and/or screenshots
TODO: later in comments
Output of checks
This bug was detected on gitLab.clearpathrobotics.com
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Ubuntu 14.04 Proxy: no Current User: git Using RVM: no Ruby Version: 2.3.3p222 Gem Version: 2.6.6 Bundler Version:1.13.7 Rake Version: 10.5.0 Redis Version: 3.2.5 Git Version: 2.11.1 Sidekiq Version:5.0.0
GitLab information Version: 9.2.7-ee Revision: 61fee15 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql DB Version: 9.6.1 URL: http://gitlab.clearpathrobotics.com HTTP Clone URL: http://gitlab.clearpathrobotics.com/some-group/some-project.git SSH Clone URL: git@gitlab.clearpathrobotics.com:some-group/some-project.git Elasticsearch: yes Geo: no Using LDAP: yes Using Omniauth: no
GitLab Shell Version: 5.0.4 Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Expand for output related to the GitLab application check
All tests successfully passed, unfortunately the output was too large
Possible fixes
Perhaps update the v3 to v4 notes if this is actually expected behaviour, or add in support for blob listing.
The original feature was added here: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6088/