diff options
Diffstat (limited to 'lib/gitlab/ci')
-rw-r--r-- | lib/gitlab/ci/build/artifacts/adapters/gzip_stream.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/ci/build/artifacts/adapters/raw_stream.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/ci/build/artifacts/metadata.rb | 10 | ||||
-rw-r--r-- | lib/gitlab/ci/build/artifacts/path.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/ci/config/entry/cache.rb | 6 | ||||
-rw-r--r-- | lib/gitlab/ci/config/entry/global.rb | 14 | ||||
-rw-r--r-- | lib/gitlab/ci/config/entry/job.rb | 28 | ||||
-rw-r--r-- | lib/gitlab/ci/config/extendable/entry.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/ci/config/external/file/base.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/ci/parsers/test/junit.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/ci/pipeline/chain/populate.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/ci/pipeline/chain/validate/abilities.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/ci/pipeline/expression/lexeme/pattern.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/ci/pipeline/expression/lexer.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/ci/pipeline/expression/statement.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/ci/trace.rb | 8 | ||||
-rw-r--r-- | lib/gitlab/ci/trace/chunked_io.rb | 4 |
17 files changed, 51 insertions, 51 deletions
diff --git a/lib/gitlab/ci/build/artifacts/adapters/gzip_stream.rb b/lib/gitlab/ci/build/artifacts/adapters/gzip_stream.rb index 25a82086676..5e816c8859c 100644 --- a/lib/gitlab/ci/build/artifacts/adapters/gzip_stream.rb +++ b/lib/gitlab/ci/build/artifacts/adapters/gzip_stream.rb @@ -11,7 +11,7 @@ module Gitlab InvalidStreamError = Class.new(StandardError) def initialize(stream) - raise InvalidStreamError, "Stream is required" unless stream + raise InvalidStreamError, _("Stream is required") unless stream @stream = stream end diff --git a/lib/gitlab/ci/build/artifacts/adapters/raw_stream.rb b/lib/gitlab/ci/build/artifacts/adapters/raw_stream.rb index cf37d700991..7cee09b4db7 100644 --- a/lib/gitlab/ci/build/artifacts/adapters/raw_stream.rb +++ b/lib/gitlab/ci/build/artifacts/adapters/raw_stream.rb @@ -11,7 +11,7 @@ module Gitlab InvalidStreamError = Class.new(StandardError) def initialize(stream) - raise InvalidStreamError, "Stream is required" unless stream + raise InvalidStreamError, _("Stream is required") unless stream @stream = stream end diff --git a/lib/gitlab/ci/build/artifacts/metadata.rb b/lib/gitlab/ci/build/artifacts/metadata.rb index 08dac756cc1..648a872e024 100644 --- a/lib/gitlab/ci/build/artifacts/metadata.rb +++ b/lib/gitlab/ci/build/artifacts/metadata.rb @@ -29,12 +29,12 @@ module Gitlab gzip do |gz| read_string(gz) # version errors = read_string(gz) - raise ParserError, 'Errors field not found!' unless errors + raise ParserError, _('Errors field not found!') unless errors begin JSON.parse(errors) rescue JSON::ParserError - raise ParserError, 'Invalid errors field!' + raise ParserError, _('Invalid errors field!') end end end @@ -85,11 +85,11 @@ module Gitlab version_string = read_string(gz) unless version_string - raise ParserError, 'Artifacts metadata file empty!' + raise ParserError, _('Artifacts metadata file empty!') end unless version_string =~ VERSION_PATTERN - raise ParserError, 'Invalid version!' + raise ParserError, _('Invalid version!') end version_string.chomp @@ -109,7 +109,7 @@ module Gitlab end def gzip(&block) - raise InvalidStreamError, "Invalid stream" unless @stream + raise InvalidStreamError, _("Invalid stream") unless @stream # restart gzip reading @stream.seek(0) diff --git a/lib/gitlab/ci/build/artifacts/path.rb b/lib/gitlab/ci/build/artifacts/path.rb index 65cd935afaa..ec1cfc4f7b6 100644 --- a/lib/gitlab/ci/build/artifacts/path.rb +++ b/lib/gitlab/ci/build/artifacts/path.rb @@ -28,11 +28,11 @@ module Gitlab def to_s @path.tap do |path| unless nonzero? - raise ArgumentError, 'Path contains zero byte character!' + raise ArgumentError, _('Path contains zero byte character!') end unless utf8? - raise ArgumentError, 'Path contains non-UTF-8 byte sequence!' + raise ArgumentError, _('Path contains non-UTF-8 byte sequence!') end end end diff --git a/lib/gitlab/ci/config/entry/cache.rb b/lib/gitlab/ci/config/entry/cache.rb index 7b94af24c09..03a17ff9442 100644 --- a/lib/gitlab/ci/config/entry/cache.rb +++ b/lib/gitlab/ci/config/entry/cache.rb @@ -20,13 +20,13 @@ module Gitlab end entry :key, Entry::Key, - description: 'Cache key used to define a cache affinity.' + description: _('Cache key used to define a cache affinity.') entry :untracked, ::Gitlab::Config::Entry::Boolean, - description: 'Cache all untracked files.' + description: _('Cache all untracked files.') entry :paths, Entry::Paths, - description: 'Specify which paths should be cached across builds.' + description: _('Specify which paths should be cached across builds.') helpers :key diff --git a/lib/gitlab/ci/config/entry/global.rb b/lib/gitlab/ci/config/entry/global.rb index 09ecb5fdb99..64652d07bc7 100644 --- a/lib/gitlab/ci/config/entry/global.rb +++ b/lib/gitlab/ci/config/entry/global.rb @@ -12,28 +12,28 @@ module Gitlab include ::Gitlab::Config::Entry::Configurable entry :before_script, Entry::Script, - description: 'Script that will be executed before each job.' + description: _('Script that will be executed before each job.') entry :image, Entry::Image, - description: 'Docker image that will be used to execute jobs.' + description: _('Docker image that will be used to execute jobs.') entry :services, Entry::Services, - description: 'Docker images that will be linked to the container.' + description: _('Docker images that will be linked to the container.') entry :after_script, Entry::Script, - description: 'Script that will be executed after each job.' + description: _('Script that will be executed after each job.') entry :variables, Entry::Variables, - description: 'Environment variables that will be used.' + description: _('Environment variables that will be used.') entry :stages, Entry::Stages, - description: 'Configuration of stages for this pipeline.' + description: _('Configuration of stages for this pipeline.') entry :types, Entry::Stages, description: 'Deprecated: stages for this pipeline.' entry :cache, Entry::Cache, - description: 'Configure caching between build jobs.' + description: _('Configure caching between build jobs.') helpers :before_script, :image, :services, :after_script, :variables, :stages, :types, :cache, :jobs diff --git a/lib/gitlab/ci/config/entry/job.rb b/lib/gitlab/ci/config/entry/job.rb index 1d8904f7b29..58e4ffb1a02 100644 --- a/lib/gitlab/ci/config/entry/job.rb +++ b/lib/gitlab/ci/config/entry/job.rb @@ -42,50 +42,50 @@ module Gitlab end entry :before_script, Entry::Script, - description: 'Global before script overridden in this job.' + description: _('Global before script overridden in this job.') entry :script, Entry::Commands, - description: 'Commands that will be executed in this job.' + description: _('Commands that will be executed in this job.') entry :stage, Entry::Stage, - description: 'Pipeline stage this job will be executed into.' + description: _('Pipeline stage this job will be executed into.') entry :type, Entry::Stage, description: 'Deprecated: stage this job will be executed into.' entry :after_script, Entry::Script, - description: 'Commands that will be executed when finishing job.' + description: _('Commands that will be executed when finishing job.') entry :cache, Entry::Cache, - description: 'Cache definition for this job.' + description: _('Cache definition for this job.') entry :image, Entry::Image, - description: 'Image that will be used to execute this job.' + description: _('Image that will be used to execute this job.') entry :services, Entry::Services, - description: 'Services that will be used to execute this job.' + description: _('Services that will be used to execute this job.') entry :only, Entry::Policy, - description: 'Refs policy this job will be executed for.', + description: _('Refs policy this job will be executed for.'), default: { refs: %w[branches tags] } entry :except, Entry::Policy, - description: 'Refs policy this job will be executed for.' + description: _('Refs policy this job will be executed for.') entry :variables, Entry::Variables, - description: 'Environment variables available for this job.' + description: _('Environment variables available for this job.') entry :artifacts, Entry::Artifacts, - description: 'Artifacts configuration for this job.' + description: _('Artifacts configuration for this job.') entry :environment, Entry::Environment, - description: 'Environment configuration for this job.' + description: _('Environment configuration for this job.') entry :coverage, Entry::Coverage, - description: 'Coverage configuration for this job.' + description: _('Coverage configuration for this job.') entry :retry, Entry::Retry, - description: 'Retry configuration for this job.' + description: _('Retry configuration for this job.') helpers :before_script, :script, :stage, :type, :after_script, :cache, :image, :services, :only, :except, :variables, diff --git a/lib/gitlab/ci/config/extendable/entry.rb b/lib/gitlab/ci/config/extendable/entry.rb index 7793db09d33..22d861788a8 100644 --- a/lib/gitlab/ci/config/extendable/entry.rb +++ b/lib/gitlab/ci/config/extendable/entry.rb @@ -19,7 +19,7 @@ module Gitlab @parent = parent unless @context.key?(@key) - raise StandardError, 'Invalid entry key!' + raise StandardError, _('Invalid entry key!') end end diff --git a/lib/gitlab/ci/config/external/file/base.rb b/lib/gitlab/ci/config/external/file/base.rb index a747886093c..c3679fe0dac 100644 --- a/lib/gitlab/ci/config/external/file/base.rb +++ b/lib/gitlab/ci/config/external/file/base.rb @@ -39,7 +39,7 @@ module Gitlab end def content - raise NotImplementedError, 'subclass must implement fetching raw content' + raise NotImplementedError, _('subclass must implement fetching raw content') end def to_hash diff --git a/lib/gitlab/ci/parsers/test/junit.rb b/lib/gitlab/ci/parsers/test/junit.rb index dca60eabc1c..a70faf30de9 100644 --- a/lib/gitlab/ci/parsers/test/junit.rb +++ b/lib/gitlab/ci/parsers/test/junit.rb @@ -15,9 +15,9 @@ module Gitlab test_suite.add_test_case(test_case) end rescue Nokogiri::XML::SyntaxError - raise JunitParserError, "XML parsing failed" + raise JunitParserError, _("XML parsing failed") rescue - raise JunitParserError, "JUnit parsing failed" + raise JunitParserError, _("JUnit parsing failed") end private diff --git a/lib/gitlab/ci/pipeline/chain/populate.rb b/lib/gitlab/ci/pipeline/chain/populate.rb index 0405292a25b..4be215aca8d 100644 --- a/lib/gitlab/ci/pipeline/chain/populate.rb +++ b/lib/gitlab/ci/pipeline/chain/populate.rb @@ -30,11 +30,11 @@ module Gitlab end if pipeline.stages.none? - return error('No stages / jobs for this pipeline.') + return error(_('No stages / jobs for this pipeline.')) end if pipeline.invalid? - return error('Failed to build the pipeline!') + return error(_('Failed to build the pipeline!')) end raise Populate::PopulateError if pipeline.persisted? diff --git a/lib/gitlab/ci/pipeline/chain/validate/abilities.rb b/lib/gitlab/ci/pipeline/chain/validate/abilities.rb index ebd7e6e8289..e713a45714c 100644 --- a/lib/gitlab/ci/pipeline/chain/validate/abilities.rb +++ b/lib/gitlab/ci/pipeline/chain/validate/abilities.rb @@ -11,7 +11,7 @@ module Gitlab def perform! unless project.builds_enabled? - return error('Pipelines are disabled!') + return error(_('Pipelines are disabled!')) end unless allowed_to_trigger_pipeline? diff --git a/lib/gitlab/ci/pipeline/expression/lexeme/pattern.rb b/lib/gitlab/ci/pipeline/expression/lexeme/pattern.rb index d7e6dacf068..12fc3e9b279 100644 --- a/lib/gitlab/ci/pipeline/expression/lexeme/pattern.rb +++ b/lib/gitlab/ci/pipeline/expression/lexeme/pattern.rb @@ -14,14 +14,14 @@ module Gitlab @value = regexp unless Gitlab::UntrustedRegexp.valid?(@value) - raise Lexer::SyntaxError, 'Invalid regular expression!' + raise Lexer::SyntaxError, _('Invalid regular expression!') end end def evaluate(variables = {}) Gitlab::UntrustedRegexp.fabricate(@value) rescue RegexpError - raise Expression::RuntimeError, 'Invalid regular expression!' + raise Expression::RuntimeError, _('Invalid regular expression!') end def self.build(string) diff --git a/lib/gitlab/ci/pipeline/expression/lexer.rb b/lib/gitlab/ci/pipeline/expression/lexer.rb index f26542361a2..38c2a11d5dd 100644 --- a/lib/gitlab/ci/pipeline/expression/lexer.rb +++ b/lib/gitlab/ci/pipeline/expression/lexer.rb @@ -50,11 +50,11 @@ module Gitlab end unless lexeme.present? - raise Lexer::SyntaxError, 'Unknown lexeme found!' + raise Lexer::SyntaxError, _('Unknown lexeme found!') end end - raise Lexer::SyntaxError, 'Too many tokens!' + raise Lexer::SyntaxError, _('Too many tokens!') end end end diff --git a/lib/gitlab/ci/pipeline/expression/statement.rb b/lib/gitlab/ci/pipeline/expression/statement.rb index b03611f756e..2f2a6470862 100644 --- a/lib/gitlab/ci/pipeline/expression/statement.rb +++ b/lib/gitlab/ci/pipeline/expression/statement.rb @@ -26,7 +26,7 @@ module Gitlab raise StatementError if @lexer.lexemes.empty? unless GRAMMAR.find { |syntax| syntax == @lexer.lexemes } - raise StatementError, 'Unknown pipeline expression!' + raise StatementError, _('Unknown pipeline expression!') end Expression::Parser.new(@lexer.tokens).tree diff --git a/lib/gitlab/ci/trace.rb b/lib/gitlab/ci/trace.rb index bf5f2a31f0e..d63f2ba633e 100644 --- a/lib/gitlab/ci/trace.rb +++ b/lib/gitlab/ci/trace.rb @@ -115,7 +115,7 @@ module Gitlab def unsafe_write!(mode, &blk) stream = Gitlab::Ci::Trace::Stream.new do if trace_artifact - raise AlreadyArchivedError, 'Could not write to the archived trace' + raise AlreadyArchivedError, _('Could not write to the archived trace') elsif current_path File.open(current_path, mode) elsif Feature.enabled?('ci_enable_live_trace') @@ -133,8 +133,8 @@ module Gitlab end def unsafe_archive! - raise AlreadyArchivedError, 'Could not archive again' if trace_artifact - raise ArchiveError, 'Job is not finished yet' unless job.complete? + raise AlreadyArchivedError, _('Could not archive again') if trace_artifact + raise ArchiveError, _('Job is not finished yet') unless job.complete? if job.trace_chunks.any? Gitlab::Ci::Trace::ChunkedIO.new(job) do |stream| @@ -171,7 +171,7 @@ module Gitlab temp_path = File.join(dir_path, "job.log") FileUtils.touch(temp_path) size = IO.copy_stream(src_stream, temp_path) - raise ArchiveError, 'Failed to copy stream' unless size == src_stream.size + raise ArchiveError, _('Failed to copy stream') unless size == src_stream.size yield(temp_path) end diff --git a/lib/gitlab/ci/trace/chunked_io.rb b/lib/gitlab/ci/trace/chunked_io.rb index 8c6fd56493f..be3442675d6 100644 --- a/lib/gitlab/ci/trace/chunked_io.rb +++ b/lib/gitlab/ci/trace/chunked_io.rb @@ -50,7 +50,7 @@ module Gitlab -1 end - raise ArgumentError, 'new position is outside of file' if new_pos < 0 || new_pos > size + raise ArgumentError, _('new position is outside of file') if new_pos < 0 || new_pos > size @tell = new_pos end @@ -141,7 +141,7 @@ module Gitlab # rubocop: disable CodeReuse/ActiveRecord def truncate(offset) - raise ArgumentError, 'Outside of file' if offset > size || offset < 0 + raise ArgumentError, _('Outside of file') if offset > size || offset < 0 return if offset == size # Skip the following process as it doesn't affect anything @tell = offset |