diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-12-02 13:27:26 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-12-02 13:27:26 +0100 |
commit | 119757ac9c2e968a4e97bd3a7f7d7a783456da83 (patch) | |
tree | 399f91edcda675c608d5f3dd2b1e4da9c3d3328f | |
parent | 943b3d0e0007d2f48a64ffdef6bf0ff0fcb774f2 (diff) | |
download | gitlab-ce-119757ac9c2e968a4e97bd3a7f7d7a783456da83.tar.gz |
Add scaffold for remaining statuses-related classes
8 files changed, 64 insertions, 0 deletions
diff --git a/lib/gitlab/ci/status/extended/base.rb b/lib/gitlab/ci/status/extended/base.rb new file mode 100644 index 00000000000..1d7819c6891 --- /dev/null +++ b/lib/gitlab/ci/status/extended/base.rb @@ -0,0 +1,11 @@ +module Gitlab::Ci + module Status + module Extended + module Base + def matches?(_subject) + raise NotImplementedError + end + end + end + end +end diff --git a/lib/gitlab/ci/status/extended/pipeline/common.rb b/lib/gitlab/ci/status/extended/pipeline/common.rb new file mode 100644 index 00000000000..75d392fab6c --- /dev/null +++ b/lib/gitlab/ci/status/extended/pipeline/common.rb @@ -0,0 +1,24 @@ +module Gitlab::Ci + module Status + module Extended + module Pipeline + module Common + def initialize(pipeline) + @pipeline = pipeline + end + + def has_details? + true + end + + def details_path + end + + def has_action? + false + end + end + end + end + end +end diff --git a/lib/gitlab/ci/status/extended/pipeline/success_with_warnings.rb b/lib/gitlab/ci/status/extended/pipeline/success_with_warnings.rb new file mode 100644 index 00000000000..5e92bb97eec --- /dev/null +++ b/lib/gitlab/ci/status/extended/pipeline/success_with_warnings.rb @@ -0,0 +1,23 @@ +module Gitlab::Ci + module Status + module Extended + module Pipeline + class SuccessWithWarnings < SimpleDelegator + extend Status::Extended::Base + + def label + 'passed with warnings' + end + + def icon + 'icon_status_warning' + end + + def self.matches?(pipeline) + pipeline.success? && pipeline.has_warnings? + end + end + end + end + end +end diff --git a/lib/gitlab/ci/status/factory.rb b/lib/gitlab/ci/status/factory.rb new file mode 100644 index 00000000000..212cd1a1687 --- /dev/null +++ b/lib/gitlab/ci/status/factory.rb @@ -0,0 +1,6 @@ +module Gitlab::Ci + module Status + class Factory + end + end +end diff --git a/spec/lib/gitlab/ci/status/extended/base_spec.rb b/spec/lib/gitlab/ci/status/extended/base_spec.rb new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/spec/lib/gitlab/ci/status/extended/base_spec.rb diff --git a/spec/lib/gitlab/ci/status/extended/pipeline/common_spec.rb b/spec/lib/gitlab/ci/status/extended/pipeline/common_spec.rb new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/spec/lib/gitlab/ci/status/extended/pipeline/common_spec.rb diff --git a/spec/lib/gitlab/ci/status/extended/pipeline/success_with_warnings_spec.rb b/spec/lib/gitlab/ci/status/extended/pipeline/success_with_warnings_spec.rb new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/spec/lib/gitlab/ci/status/extended/pipeline/success_with_warnings_spec.rb diff --git a/spec/lib/gitlab/ci/status/factory_spec.rb b/spec/lib/gitlab/ci/status/factory_spec.rb new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/spec/lib/gitlab/ci/status/factory_spec.rb |