summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/import_export
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <git@zjvandeweg.nl>2018-06-06 13:10:59 +0200
committerZeger-Jan van de Weg <git@zjvandeweg.nl>2018-08-01 18:58:29 +0200
commit79a5d76801a45696db629e1f543f2e1d6fa4784f (patch)
tree2c494eee7f3c26bb450f6f1ee3c6152ac4fe7666 /spec/lib/gitlab/import_export
parentf175014067c38f577646d101cc8d32212d582148 (diff)
downloadgitlab-ce-79a5d76801a45696db629e1f543f2e1d6fa4784f.tar.gz
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.
Diffstat (limited to 'spec/lib/gitlab/import_export')
-rw-r--r--spec/lib/gitlab/import_export/all_models.yml1
1 files changed, 1 insertions, 0 deletions
diff --git a/spec/lib/gitlab/import_export/all_models.yml b/spec/lib/gitlab/import_export/all_models.yml
index c175dc1e4dd..b3e3ead9c5e 100644
--- a/spec/lib/gitlab/import_export/all_models.yml
+++ b/spec/lib/gitlab/import_export/all_models.yml
@@ -297,6 +297,7 @@ project:
- settings
- ci_cd_settings
- import_export_upload
+- repository_languages
award_emoji:
- awardable
- user