summaryrefslogtreecommitdiff
path: root/lib/gitlab/ci/config/external/file/base.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/ci/config/external/file/base.rb')
-rw-r--r--lib/gitlab/ci/config/external/file/base.rb33
1 files changed, 24 insertions, 9 deletions
diff --git a/lib/gitlab/ci/config/external/file/base.rb b/lib/gitlab/ci/config/external/file/base.rb
index a660dd339d8..89da0796906 100644
--- a/lib/gitlab/ci/config/external/file/base.rb
+++ b/lib/gitlab/ci/config/external/file/base.rb
@@ -16,8 +16,6 @@ module Gitlab
@params = params
@context = context
@errors = []
-
- validate!
end
def matching?
@@ -48,6 +46,30 @@ module Gitlab
expanded_content_hash
end
+ def validate!
+ context.logger.instrument(:config_file_validation) do
+ validate_execution_time!
+ validate_location!
+ validate_content! if errors.none?
+ validate_hash! if errors.none?
+ end
+ end
+
+ def metadata
+ {
+ context_project: context.project&.full_path,
+ context_sha: context.sha
+ }
+ end
+
+ def eql?(other)
+ other.hash == hash
+ end
+
+ def hash
+ [params, context.project&.full_path, context.sha].hash
+ end
+
protected
def expanded_content_hash
@@ -66,13 +88,6 @@ module Gitlab
nil
end
- def validate!
- validate_execution_time!
- validate_location!
- validate_content! if errors.none?
- validate_hash! if errors.none?
- end
-
def validate_execution_time!
context.check_execution_time!
end