Git submodule / Gitlab subgroups Invalid HTML Links

Summary

Links to Git submodule within a Gitlab Subgroup do not produce a valid HTML link to the subgroup's tree

Steps to reproduce

  1. Create a Group called test-group.

  2. Create a Project within test-group titled top-level.

  3. Create a second Project within test-group titled submodule1.

  4. Create a Subgroup within top-group called sub.

  5. Create a Project within the subgroup sub titled submodule2.

  6. Initialize the newly created repositories using the following commands:

git clone git@meylor-gitlab:test-group/top-level.git
cd top-level/
touch README.md
git add README.md
git commit -m "initial commit"
git push -u origin master
cd ../

git clone git@meylor-gitlab:test-group/submodule1.git
cd submodule1/
touch README.md
git add README.md
git commit -m "submodule1 initial commit"
git push -u origin master
cd ../

git clone git@meylor-gitlab:test-group/sub/submodule2.git
cd submodule2/
touch README.md
git add README.md
git commit -m "submodule2 initial commit"
git push -u origin master
cd ../top-level

git submodule add git@meylor-gitlab:test-group/submodule1.git
git submodule add git@meylor-gitlab:test-group/sub/submodule2.git
git add .

git commit -m 'added a submodule, and a submodule under a subgroup'
git push -u origin master

In your browser, navigate to the top-level Project and you should see the two submodules within the repository as shown in the screenshot below.

What is the current bug behavior?

  • Clicking on submodule2 or 715d30f0 takes you to http://meylor-gitlab/test-group/git@meylor-gitlab:test-group/sub/submodule2.git and gives the user a 404 error.

What is the expected correct behavior?

  • Clicking on submodule1 takes you to http://meylor-gitlab/test-group/submodule1
  • Clicking on f179667a takes you to http://meylor-gitlab/test-group/submodule1/tree/f179667aa2c7b3166047ca5ad1df0a39f4c7478c

Relevant logs and/or screenshots

http://meylor-gitlab/test-group/top-level

Output of checks

Gitlab checks succeed.

Results of GitLab environment info

$ sudo gitlab-rake gitlab:env:info

System information System: Ubuntu 16.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.10.2 Sidekiq Version:4.2.7

GitLab information Version: 9.0.5-ee Revision: 71d72c9 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql DB Version: 9.6.1 URL: http://meylor-gitlab HTTP Clone URL: http://meylor-gitlab/some-group/some-project.git SSH Clone URL: git@meylor-gitlab:some-group/some-project.git Elasticsearch: no Geo: no Using LDAP: no Using Omniauth: no

GitLab Shell Version: 5.0.0 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

$ sudo gitlab-rake gitlab:check SANITIZE=true Checking GitLab Shell ...

GitLab Shell version >= 5.0.0 ? ... OK (5.0.0) Repo base directory exists? default... yes Repo storage directories are symlinks? default... no Repo paths owned by git:git? default... no User id for git: 998. Groupd id for git: 998 Try fixing it: sudo chown -R git:git /var/opt/gitlab/git-data/repositories For more information see: doc/install/installation.md in section "GitLab Shell" Please fix the error above and rerun the checks. Repo paths access is drwxrws---? default... yes hooks directories in repos are links: ... 4/2 ... ok 4/3 ... ok 6/4 ... ok Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Access to /var/opt/gitlab/.ssh/authorized_keys: OK Send ping to redis server: OK 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 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? ... yes 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: ... 4/2 ... yes 4/3 ... yes 6/4 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.1.0 ? ... yes (2.3.3) Your git bin path is "/opt/gitlab/embedded/bin/git" Git version >= 2.7.3 ? ... yes (2.10.2) Active users: 1

Checking GitLab ... Finished

Possible fixes

N/A

Assignee Loading
Time tracking Loading