Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-08-24 15:10:17 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-08-24 15:10:17 +0300
commit4b9bde7848d9538c1635ffe7a5385ba013487b4a (patch)
tree5aad1d5d94ea233a36c8ac2850e099236e1c2cdc /lib/gitlab
parent2f752481c2e727834216a93dee82df9f8e2acb2e (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab')
-rw-r--r--lib/gitlab/badge/pipeline/status.rb7
-rw-r--r--lib/gitlab/setup_helper.rb20
2 files changed, 5 insertions, 22 deletions
diff --git a/lib/gitlab/badge/pipeline/status.rb b/lib/gitlab/badge/pipeline/status.rb
index 17f179f027d..f061ba22688 100644
--- a/lib/gitlab/badge/pipeline/status.rb
+++ b/lib/gitlab/badge/pipeline/status.rb
@@ -12,6 +12,7 @@ module Gitlab
def initialize(project, ref, opts: {})
@project = project
@ref = ref
+ @ignore_skipped = Gitlab::Utils.to_boolean(opts[:ignore_skipped], default: false)
@customization = {
key_width: opts[:key_width].to_i,
key_text: opts[:key_text]
@@ -26,9 +27,11 @@ module Gitlab
# rubocop: disable CodeReuse/ActiveRecord
def status
- @project.ci_pipelines
+ pipelines = @project.ci_pipelines
.where(sha: @sha)
- .latest_status(@ref) || 'unknown'
+
+ relation = @ignore_skipped ? pipelines.without_statuses([:skipped]) : pipelines
+ relation.latest_status(@ref) || 'unknown'
end
# rubocop: enable CodeReuse/ActiveRecord
diff --git a/lib/gitlab/setup_helper.rb b/lib/gitlab/setup_helper.rb
index 47c685f1bc8..64a30fbe16c 100644
--- a/lib/gitlab/setup_helper.rb
+++ b/lib/gitlab/setup_helper.rb
@@ -28,26 +28,6 @@ module Gitlab
end
# rubocop:enable Rails/Output
- module Workhorse
- extend Gitlab::SetupHelper
- class << self
- def configuration_toml(dir, _)
- config = { redis: { URL: redis_url } }
-
- TomlRB.dump(config)
- end
-
- def redis_url
- data = YAML.load_file(Rails.root.join('config/resque.yml'))
- data.dig(Rails.env, 'url')
- end
-
- def get_config_path(dir)
- File.join(dir, 'config.toml')
- end
- end
- end
-
module Gitaly
extend Gitlab::SetupHelper
class << self