Skip to content

Rewrite Gitlab::Utils.which function

Matthias Käppler requested to merge mk-cleanroom-which into master

What does this MR do and why?

Part of https://gitlab.com/groups/gitlab-org/-/epics/6129

We made several simplifications, such as not providing Windows support via PATH_EXT, since Windows is not a supported platform.

How to set up and validate locally

  1. open rails console
  2. `Gitlab::Utils.which('toolname')

Result should be consistent with what which returns on the host (however, note that in a Rails env the PATH is extended with bundler's bin dir, so some deviations are expected.)

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports