diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-01-25 17:50:09 +0000 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-01-25 17:50:09 +0000 |
commit | 6cfe60df2275dace9804f4bc37b9746a9eadc6fd (patch) | |
tree | 05e401f44722603121eb196d3097879b98e0aa0c /lib | |
parent | b55c1bc4b5fb8d259ba9f264eff607f81012fa39 (diff) | |
parent | b368447cf7fbd090704e22311dde72cd293d9779 (diff) | |
download | gitlab-ce-6cfe60df2275dace9804f4bc37b9746a9eadc6fd.tar.gz |
Merge branch 'backport-ee-changes-for-build-minutes' into 'master'
Backport changes introduced by https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/1078
See merge request !8657
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ci/api/builds.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/visibility_level.rb | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/ci/api/builds.rb b/lib/ci/api/builds.rb index c4bdef781f7..a9da8ea7eeb 100644 --- a/lib/ci/api/builds.rb +++ b/lib/ci/api/builds.rb @@ -23,7 +23,7 @@ module Ci new_update = current_runner.ensure_runner_queue_value - build = Ci::RegisterBuildService.new.execute(current_runner) + build = Ci::RegisterBuildService.new(current_runner).execute if build Gitlab::Metrics.add_event(:build_found, diff --git a/lib/gitlab/visibility_level.rb b/lib/gitlab/visibility_level.rb index 9462f3368e6..c7953af29dd 100644 --- a/lib/gitlab/visibility_level.rb +++ b/lib/gitlab/visibility_level.rb @@ -11,6 +11,7 @@ module Gitlab included do scope :public_only, -> { where(visibility_level: PUBLIC) } scope :public_and_internal_only, -> { where(visibility_level: [PUBLIC, INTERNAL] ) } + scope :non_public_only, -> { where.not(visibility_level: PUBLIC) } scope :public_to_user, -> (user) { user && !user.external ? public_and_internal_only : public_only } end |