Group label should show up in project if defined in grand-parent group

Summary

Group Labels doesn't show up in Project Label if they are defined more than one group Upper.

According to the Label Docs

Prioritization happens at the project level, only on the project label list page, and not on the group label list page. However, both project and group labels can be prioritized on the project label list page since both types are displayed on the project label list page.

Steps to reproduce

  • Create a Group : UpperGroup
  • Create a Group under UpperGroup : LowerGroup
  • Create a Project under UpperGroup : UpperProject
  • Create a Project under LowerGroup : LowerProject
  • Create a Group Label in UpperGroup : "UpperLabel"
  • Go to UpperProject->Labels and see UpperLabel (this is the expected behaviour)
  • Go to LowerProject->Labels and see no label
  • Create a Group Label in LowerGroup : "LowerLabel"
  • Go to LowerProject->Labels and see "LowerLabel"

What is the current bug behavior?

Group Labels only show up if they have been created in the parent Group

What is the expected correct behavior?

Group Labels should show up if they have been created in any upper group (parent / grand parent)

Output of checks

I'm using Gitlab Starter Edition 12.0.2-ee(ef76b54f).

Results of GitLab environment info

Expand for output related to GitLab environment info
System information
System:		
Proxy:		no
Current User:	git
Using RVM:	no
Ruby Version:	2.6.3p62
Gem Version:	2.7.9
Bundler Version:1.17.3
Rake Version:	12.3.2
Redis Version:	3.2.12
Git Version:	2.21.0
Sidekiq Version:5.2.7
Go Version:	unknown

GitLab information Version: 12.0.2-ee Revision: ef76b54fc1e Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: PostgreSQL DB Version: 9.6.11 URL: https://gitlab.deciplus.pro HTTP Clone URL: https://gitlab.deciplus.pro/some-group/some-project.git SSH Clone URL: git@gitlab.deciplus.pro:some-group/some-project.git Elasticsearch: no Geo: no Using LDAP: no Using Omniauth: yes Omniauth Providers: google_oauth2

GitLab Shell Version: 9.3.0 Repository storage paths:

  • default: /var/opt/gitlab/git-data/repositories GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell Git: /opt/gitlab/embedded/bin/git

Results of GitLab application Check

Expand for output related to the GitLab application check

Checking GitLab subtasks ...

Checking GitLab Shell ...

GitLab Shell: ... GitLab Shell version >= 9.3.0 ? ... OK (9.3.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Redis available via internal API: OK

Access to /var/opt/gitlab/.ssh/authorized_keys: OK gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Gitaly ...

Gitaly: ... default ... OK

Checking Gitaly ... Finished

Checking Sidekiq ...

Sidekiq: ... Running? ... yes Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Checking Incoming Email ...

Incoming Email: ... Reply by email is disabled in config/gitlab.yml

Checking Incoming Email ... Finished

Checking LDAP ...

LDAP: ... LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab App ...

Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... 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/4 ... yes 9/5 ... yes 8/6 ... yes 8/7 ... yes 8/8 ... yes 10/9 ... yes 9/11 ... yes 9/12 ... yes 10/13 ... yes 10/14 ... yes 10/15 ... yes 4/16 ... yes 15/17 ... yes 8/18 ... yes 10/19 ... yes 9/20 ... yes 9/21 ... yes 9/22 ... yes 8/23 ... yes 8/24 ... yes 23/25 ... yes 63/27 ... yes 63/28 ... yes 63/29 ... yes 63/30 ... yes 5/31 ... yes 9/32 ... yes 9/33 ... yes 9/34 ... yes 65/35 ... yes 67/36 ... yes 7/37 ... yes 10/38 ... yes 75/40 ... yes 77/41 ... yes 76/42 ... yes 4/43 ... yes 79/44 ... yes 14/47 ... yes 14/48 ... yes 82/49 ... yes 85/50 ... yes 85/51 ... yes 78/53 ... yes 78/54 ... yes 78/55 ... yes 78/56 ... yes 78/57 ... yes 78/58 ... yes 3/59 ... yes 85/61 ... yes 3/62 ... yes 63/63 ... yes 3/64 ... yes 63/65 ... yes 3/67 ... yes 9/68 ... yes 3/69 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.5.3 ? ... yes (2.6.3) Git version >= 2.21.0 ? ... yes (2.21.0) Git user has default SSH configuration? ... yes Active users: ... 17 Elasticsearch version 5.6 - 6.x? ... skipped (elasticsearch is disabled)

Checking GitLab App ... Finished

Checking GitLab subtasks ... Finished

Possible fixes

(If you can, link to the line of code that might be responsible for the problem)

Edited by Nicolas Borderes