Commit graph

7 commits

Author SHA1 Message Date
Mario de la Ossa
eaada9d706 use Gitlab::UserSettings directly as a singleton instead of including/extending it 2018-02-02 18:39:55 +00:00
🙈 jacopo beschi 🙉
729f05f0e3 Adds Rubocop rule for line break around conditionals 2018-01-11 16:34:01 +00:00
Nick Thomas
4b785df27b
Import gitlab_projects.rb from gitlab-shell
By importing this Ruby code into gitlab-rails (and gitaly-ruby), we avoid
200ms of startup time for each gitlab_projects subprocess we are eliminating.

By not having a gitlab_projects subprocess between gitlab-rails / sidekiq and
any git subprocesses (e.g. for fork_project, fetch_remote, etc, calls), we can
also manage these git processes more cleanly, and avoid sending SIGKILL to them
2017-12-14 16:00:04 +00:00
Sean McGivern
5883ce95ef current_application_settings belongs on Gitlab::CurrentSettings
The initializers including this were doing so at the top level, so every object
loaded after them had a `current_application_settings` method. However, if
someone had rack-attack enabled (which was loaded before these initializers), it
would try to load the API, and fail, because `Gitlab::CurrentSettings` didn't
have that method.

To fix this:

1. Don't include `Gitlab::CurrentSettings` at the top level. We do not need
   `Object.new.current_application_settings` to work.
2. Make `Gitlab::CurrentSettings` explicitly `extend self`, as we already use it
   like that in several places.
3. Change the initializers to use that new form.
2017-08-31 13:38:33 +01:00
Rémy Coutable
8f13c1ebd9
Use a slightly cleaner approach to stub ENV
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-06-28 11:18:09 +02:00
Stan Hu
1a47bd37a1 Reset the state of StubENV's @env_already_stubbed after each spec run
In certain combination of tests, @env_already_stubbed could be set
to `true` even though it never ran for that specific test.
2017-06-26 08:13:46 -07:00
Adam Niedzielski
a8177e03e5 Introduce "stub_env" test helper for safely stubbing environment variables 2017-01-09 18:19:48 +01:00