1

I am used to gitlab automatically detecting the license of a project based on a license file. This time, however, it failed.

I have a LaTeX package and a test script in one gitlab project which are licensed under different licenses. I have two license files in the root directory called license_lppl.txt and license_wtfpl.txt. But gitlab does not recognize either of the licenses, saying "No license. All rights reserved". If it would just not display the license I might just live with it but this statement is just wrong.

How does gitlab recognize the license? How can I tell gitlab that the code is licensed? How does gitlab deal with multiple licenses?

I have failed to find anything about that in the user documentation of gitlab (https://docs.gitlab.com/ee/user/project/index.html). They list a feature called "License Compliance" which probably depends on the (not) recognized license. I am not convinced that I would be able to set the license there but I don't even find License Compliance in the settings of my repository. Is this feature available in a free account?

jakun
  • 121
  • Have you contacted GitLab support in order to determine if it's a feature of a free account? – Ramhound Jun 26 '20 at 17:20
  • as far as I know Gitlab has no support for free accounts. It's just asking the community. – jakun Jun 26 '20 at 17:28
  • You are a potential customer. I am sure if you contact them with regards to the differences between a free account and a paid account they will clarify it. – Ramhound Jun 26 '20 at 17:30
  • good point. But the main question is: How can I tell gitlab that the code is licensed? – jakun Jun 26 '20 at 17:34

1 Answers1

1

There is an open issue for the incorrect message with not much activity: https://gitlab.com/gitlab-org/gitlab/-/issues/30997

I have resolved this for my project by renaming both licenses to license.txt and moving one of them to a subdirectory. Both files are now recognized as license files judging by the icon displayed in front of them. However, only the license of the license file located in the project root is displayed in the project overview.

I don't think this is a good solution because it makes it less obvious that several licenses are used but in my case where I am using one license for the main project and a different for the automated tests I think it's better than the wrong claim that there was "No license".


At https://gitlab.com/gitlab-org/gitlab-foss/-/issues/15470 a maintainer of gitlab says:

We're now using the "Licensee" Gem for finding licenses.

I have found a git repository with that name here: https://github.com/licensee/licensee

I have installed it with # apt install ruby-licensee. Running $ licensee in my project repository finds license_lppl.txt and detects the license correctly. Running $ licensee license_wtfpl.txt also detects the license correctly. But the program does not support the commands documented on github therefore I am assuming that the version installed with apt is outdated.

I have created a test repository and just tried out different things. Even if I create the license file with the Add License button (and name it license_lppl.txt or license_wtfpl.txt) instead of pushing it gitlab does not recognize it.

Based on my observations I am assuming that gitlab is checking a bunch of predefined file names for existence and only for those files it tries to extract the license with licensee. If no matching file is found it claims the project had no license.

The idea of an option to manually select a license (file) is mentioned as a new feature in the above mentioned issue but is not the scope of that issue.

jakun
  • 121