Skip to content
  • Zeger-Jan van de Weg's avatar
    Add repository languages for projects · fc85a3572af6
    Zeger-Jan van de Weg authored
    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....
    fc85a3572af6