summaryrefslogtreecommitdiff
path: root/lib/system_check/base_check.rb
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-09-06 13:18:53 +0100
committerFilipa Lacerda <filipa@gitlab.com>2017-09-06 13:18:53 +0100
commit0e1404d441b0db532046d50dcbaf754ff4d3a77e (patch)
tree87a5b482c31e846d5e799291aa9852a008732c2a /lib/system_check/base_check.rb
parentfa0f9d60e2be51261f4f58c25d75229ba996659d (diff)
parentba302454e1191f28453929df80e13c4dd418f8c7 (diff)
downloadgitlab-ce-collapsable-pipeline-settings.tar.gz
Merge branch 'master' into collapsable-pipeline-settingscollapsable-pipeline-settings
* master: (260 commits) Enable auto-retry in GitLab CI/CD pipeline Clean up new navigation templates Wait for gitaly to boot during tests Update 'Visibility of pipelines' refactored code Fix note resolution specs Add author and MR to changelog Tidy up projects API specs Resolve outdated diff discussions on push Fix migration change collapse to resolve and comments to discussions add unit tests for new collapse_outdated_diff_comments toggle Add functionality to collapse outdated diff comments regardless of discussion resolution refactor code based on feedback fix spec failures Use flexbox for prometheus graph row grouping instead of bootstrap classes Fix wrong API status codes small refactor Hide admin link from default search results for non-admins Make search dropdowns consistent ...
Diffstat (limited to 'lib/system_check/base_check.rb')
-rw-r--r--lib/system_check/base_check.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/system_check/base_check.rb b/lib/system_check/base_check.rb
index 7f9e2ffffc2..0f5742dd67f 100644
--- a/lib/system_check/base_check.rb
+++ b/lib/system_check/base_check.rb
@@ -62,6 +62,25 @@ module SystemCheck
call_or_return(@skip_reason) || 'skipped'
end
+ # Define a reason why we skipped the SystemCheck (during runtime)
+ #
+ # This is used when you need dynamic evaluation like when you have
+ # multiple reasons why a check can fail
+ #
+ # @param [String] reason to be displayed
+ def skip_reason=(reason)
+ @skip_reason = reason
+ end
+
+ # Skip reason defined during runtime
+ #
+ # This value have precedence over the one defined in the subclass
+ #
+ # @return [String] the reason
+ def skip_reason
+ @skip_reason
+ end
+
# Does the check support automatically repair routine?
#
# @return [Boolean] whether check implemented `#repair!` method or not