Skip to content

Fix Linguist not working on Gitaly nodes

Stan Hu requested to merge sh-ensure-path-to-binstubs into master

What does this MR do?

!824 (merged) changed the build process in such a way that the default Ruby binstubs (e.g. in /usr/bin) that were installed with bundle install are no longer copied. Instead, binstubs are manually installed in /srv/gitlab/bin. However, Gitaly executes a script that assumes git-linguist is in the PATH.

To fix this problem, we append the /srv/gitlab/bin to the PATH.

Related issues

Relates to gitlab-org/charts/gitlab#3034 (closed)

This is similar to what was done in !808 (merged).

Tests

irb(main):002:0> ::Projects::DetectRepositoryLanguagesService.new(Project.find(2)).execute
=> #<ActiveRecord::Associations::CollectionProxy [#<RepositoryLanguage project_id: 2, programming_language_id: 1, share: 100.0>]>

Checklist

See Definition of done.

For anything in this list which will not be completed, please provide a reason in the MR discussion

Required

  • Merge Request Title, and Description are up to date, accurate, and descriptive
  • MR targeting the appropriate branch
  • MR has a green pipeline on GitLab.com

Expected (please provide an explanation if not completing)

  • Test plan indicating conditions for success has been posted and passes
  • Documentation created/updated
  • Integration tests added to GitLab QA
  • The impact any change in container size has should be evaluated
Edited by Stan Hu

Merge request reports