Commit Graph

7 Commits

Author SHA1 Message Date
GitLab Bot 1581767ea1 Add latest changes from gitlab-org/gitlab@master 2021-07-15 15:09:41 +00:00
GitLab Bot 507c0e71cd Add latest changes from gitlab-org/gitlab@master 2021-01-27 12:09:01 +00:00
GitLab Bot 0211553b0c Add latest changes from gitlab-org/gitlab@master 2020-06-10 12:08:58 +00:00
GitLab Bot 69849c280c Add latest changes from gitlab-org/gitlab@master 2019-10-10 12:06:19 +00:00
Nick Thomas 013f7cd24c
Inherit from ApplicationRecord instead of ActiveRecord::Base 2019-03-28 16:18:23 +00:00
gfyoung 32af384adf Enable frozen string in rest of app/models/**/*.rb
Partially addresses #47424.
2018-08-10 00:51:01 -07:00
Zeger-Jan van de Weg 79a5d76801
Add repository languages for projects
Our friends at GitHub show the programming languages for a long time,
and inspired by that this commit means to create about the same
functionality.

Language detection is done through Linguist, as before, where the
difference is that we cache the result in the database. Also, Gitaly can
incrementaly scan a repository. This is done through a shell out, which
creates overhead of about 3s each run. For now this won't be improved.

Scans are triggered by pushed to the default branch, usually `master`.
However, one exception to this rule the charts page. If we're requesting
this expensive data anyway, we just cache it in the database.

Edge cases where there is no repository, or its empty are caught in the
Repository model. This makes use of Redis caching, which is probably
already loaded.

The added model is called RepositoryLanguage, which will make it harder
if/when GitLab supports multiple repositories per project. However, for
now I think this shouldn't be a concern. Also, Language could be
confused with the i18n languages and felt like the current name was
suiteable too.

Design of the Project#Show page is done with help from @dimitrieh. This
change is not visible to the end user unless detections are done.
2018-08-01 18:58:29 +02:00