diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-24 15:10:17 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-24 15:10:17 +0300 |
commit | 4b9bde7848d9538c1635ffe7a5385ba013487b4a (patch) | |
tree | 5aad1d5d94ea233a36c8ac2850e099236e1c2cdc /lib/gitlab | |
parent | 2f752481c2e727834216a93dee82df9f8e2acb2e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab')
-rw-r--r-- | lib/gitlab/badge/pipeline/status.rb | 7 | ||||
-rw-r--r-- | lib/gitlab/setup_helper.rb | 20 |
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 |