Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-01-31 00:09:38 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-01-31 00:09:38 +0300
commitdd8c199e989482245c58ee49b5f7169bdd9073eb (patch)
treef70b1255763d003e855f9ea3dd73a6c14e2010ff /app/models/ci
parentcd99e8611a6df11975c227517892606440ad3ff6 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/ci')
-rw-r--r--app/models/ci/application_record.rb2
-rw-r--r--app/models/ci/bridge.rb4
-rw-r--r--app/models/ci/build.rb28
-rw-r--r--app/models/ci/build_metadata.rb2
-rw-r--r--app/models/ci/build_runner_session.rb4
-rw-r--r--app/models/ci/build_trace_chunk.rb8
-rw-r--r--app/models/ci/deleted_object.rb2
7 files changed, 25 insertions, 25 deletions
diff --git a/app/models/ci/application_record.rb b/app/models/ci/application_record.rb
index ea7b1104e36..52f02bfb2fd 100644
--- a/app/models/ci/application_record.rb
+++ b/app/models/ci/application_record.rb
@@ -13,7 +13,7 @@ module Ci
end
def self.model_name
- @model_name ||= ActiveModel::Name.new(self, nil, self.name.demodulize)
+ @model_name ||= ActiveModel::Name.new(self, nil, name.demodulize)
end
end
end
diff --git a/app/models/ci/bridge.rb b/app/models/ci/bridge.rb
index 54daff7dbda..697f06fbffd 100644
--- a/app/models/ci/bridge.rb
+++ b/app/models/ci/bridge.rb
@@ -80,9 +80,9 @@ module Ci
def inherit_status_from_downstream!(pipeline)
case pipeline.status
when 'success'
- self.success!
+ success!
when 'failed', 'canceled', 'skipped'
- self.drop!
+ drop!
else
false
end
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index ec3aa9d70be..214880f5833 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -386,21 +386,21 @@ module Ci
def detailed_status(current_user)
Gitlab::Ci::Status::Build::Factory
- .new(self.present, current_user)
+ .new(present, current_user)
.fabricate!
end
def other_manual_actions
- pipeline.manual_actions.reject { |action| action.name == self.name }
+ pipeline.manual_actions.reject { |action| action.name == name }
end
def other_scheduled_actions
- pipeline.scheduled_actions.reject { |action| action.name == self.name }
+ pipeline.scheduled_actions.reject { |action| action.name == name }
end
def pages_generator?
Gitlab.config.pages.enabled &&
- self.name == 'pages'
+ name == 'pages'
end
def runnable?
@@ -456,7 +456,7 @@ module Ci
end
def retries_count
- pipeline.builds.retried.where(name: self.name).count
+ pipeline.builds.retried.where(name: name).count
end
override :all_met_to_become_pending?
@@ -529,19 +529,19 @@ module Ci
end
def deployment_job?
- has_environment_keyword? && self.environment_action == 'start'
+ has_environment_keyword? && environment_action == 'start'
end
def stops_environment?
- has_environment_keyword? && self.environment_action == 'stop'
+ has_environment_keyword? && environment_action == 'stop'
end
def environment_action
- self.options.fetch(:environment, {}).fetch(:action, 'start') if self.options
+ options.fetch(:environment, {}).fetch(:action, 'start') if options
end
def environment_tier_from_options
- self.options.dig(:environment, :deployment_tier) if self.options
+ options.dig(:environment, :deployment_tier) if options
end
def environment_tier
@@ -831,7 +831,7 @@ module Ci
end
def erased?
- !self.erased_at.nil?
+ !erased_at.nil?
end
def artifacts_expired?
@@ -864,8 +864,8 @@ module Ci
end
def keep_artifacts!
- self.update(artifacts_expire_at: nil)
- self.job_artifacts.update_all(expire_at: nil)
+ update(artifacts_expire_at: nil)
+ job_artifacts.update_all(expire_at: nil)
end
def artifacts_file_for_type(type)
@@ -1096,11 +1096,11 @@ module Ci
# without actually loading data.
#
def all_queuing_entries
- ::Ci::PendingBuild.where(build_id: self.id)
+ ::Ci::PendingBuild.where(build_id: id)
end
def all_runtime_metadata
- ::Ci::RunningBuild.where(build_id: self.id)
+ ::Ci::RunningBuild.where(build_id: id)
end
def shared_runner_build?
diff --git a/app/models/ci/build_metadata.rb b/app/models/ci/build_metadata.rb
index 5c8ac2adb8d..b294afd405d 100644
--- a/app/models/ci/build_metadata.rb
+++ b/app/models/ci/build_metadata.rb
@@ -68,7 +68,7 @@ module Ci
private
def set_build_project
- self.project_id ||= self.build.project_id
+ self.project_id ||= build.project_id
end
def timeout_with_highest_precedence
diff --git a/app/models/ci/build_runner_session.rb b/app/models/ci/build_runner_session.rb
index 20c0b04e228..5773b6132be 100644
--- a/app/models/ci/build_runner_session.rb
+++ b/app/models/ci/build_runner_session.rb
@@ -20,7 +20,7 @@ module Ci
validates :url, public_url: { schemes: %w(https) }
def terminal_specification
- wss_url = Gitlab::UrlHelpers.as_wss(Addressable::URI.escape(self.url))
+ wss_url = Gitlab::UrlHelpers.as_wss(Addressable::URI.escape(url))
return {} unless wss_url.present?
parsed_wss_url = URI.parse(wss_url)
@@ -33,7 +33,7 @@ module Ci
port = port.presence || DEFAULT_PORT_NAME
service = service.presence || DEFAULT_SERVICE_NAME
- parsed_url = URI.parse(Addressable::URI.escape(self.url))
+ parsed_url = URI.parse(Addressable::URI.escape(url))
parsed_url.path += "/proxy/#{service}/#{port}/#{path}"
subprotocols = subprotocols.presence || ::Ci::BuildRunnerSession::TERMINAL_SUBPROTOCOL
diff --git a/app/models/ci/build_trace_chunk.rb b/app/models/ci/build_trace_chunk.rb
index c5f6e54c336..541a8b5bffa 100644
--- a/app/models/ci/build_trace_chunk.rb
+++ b/app/models/ci/build_trace_chunk.rb
@@ -108,7 +108,7 @@ module Ci
raise ArgumentError, 'Offset is out of range' if offset > size || offset < 0
return if offset == size # Skip the following process as it doesn't affect anything
- self.append(+"", offset)
+ append(+"", offset)
end
def append(new_data, offset)
@@ -166,7 +166,7 @@ module Ci
raise FailedToPersistDataError, 'Modifed build trace chunk detected' if has_changes_to_save?
self.class.with_read_consistency(build) do
- self.reset.then(&:unsafe_persist_data!)
+ reset.then(&:unsafe_persist_data!)
end
end
rescue FailedToObtainLockError
@@ -205,9 +205,9 @@ module Ci
end
def <=>(other)
- return unless self.build_id == other.build_id
+ return unless build_id == other.build_id
- self.chunk_index <=> other.chunk_index
+ chunk_index <=> other.chunk_index
end
protected
diff --git a/app/models/ci/deleted_object.rb b/app/models/ci/deleted_object.rb
index d36646aba66..2b5452c803a 100644
--- a/app/models/ci/deleted_object.rb
+++ b/app/models/ci/deleted_object.rb
@@ -21,7 +21,7 @@ module Ci
accumulator << record if record[:store_dir] && record[:file]
end
- self.insert_all(attributes) if attributes.any?
+ insert_all(attributes) if attributes.any?
end
def delete_file_from_storage