This instance will be upgraded to Heptapod 0.31.0 (final) on 2022-05-24 at 14:00 UTC+2 (a few minutes of down time)

Commit 5cd504ed authored by Kamil Trzcinski's avatar Kamil Trzcinski
Browse files

Rename builds_without_retry to latest_builds

parent 53d64dfebcbe
......@@ -48,7 +48,7 @@ def last_build
end
def retry
builds_without_retry.each do |build|
latest_builds.each do |build|
Ci::Build.retry(build)
end
end
......@@ -113,12 +113,12 @@ def latest_statuses
@latest_statuses ||= statuses.latest.to_a
end
def builds_without_retry
@builds_without_retry ||= builds.latest.to_a
def latest_builds
@latest_builds ||= builds.latest.to_a
end
def builds_without_retry_for_ref(ref)
builds_without_retry.select { |build| build.ref == ref }
def latest_builds_for_ref(ref)
latest_builds.select { |build| build.ref == ref }
end
def retried
......@@ -181,7 +181,7 @@ def finished_at
def coverage
if project.coverage_enabled?
coverage_array = builds_without_retry.map(&:coverage).compact
coverage_array = latest_builds.map(&:coverage).compact
if coverage_array.size >= 1
'%.2f' % (coverage_array.reduce(:+) / coverage_array.size)
end
......@@ -189,7 +189,7 @@ def coverage
end
def matrix_for_ref?(ref)
builds_without_retry_for_ref(ref).size > 1
latest_builds_for_ref(ref).size > 1
end
def config_processor
......
......@@ -49,7 +49,7 @@ def can_execute?(build)
commit = build.commit
return unless commit
return unless commit.builds_without_retry.include? build
return unless commit.latest_builds.include? build
case commit.status.to_sym
when :failed
......
......@@ -48,7 +48,7 @@ def can_execute?(build)
# it doesn't make sense to send emails for retried builds
commit = build.commit
return unless commit
return unless commit.builds_without_retry.include?(build)
return unless commit.latest_builds.include?(build)
case build.status.to_sym
when :failed
......
......@@ -23,7 +23,7 @@ def fallback
def attachments
fields = []
commit.builds_without_retry.each do |build|
commit.latest_builds.each do |build|
next if build.allow_failure?
next unless build.failed?
fields << {
......
......@@ -48,7 +48,7 @@ def can_execute?(build)
commit = build.commit
return unless commit
return unless commit.builds_without_retry.include?(build)
return unless commit.latest_builds.include?(build)
case commit.status.to_sym
when :failed
......
......@@ -21,7 +21,7 @@ def execute(project, user, params)
commit.update_committed!
commit.create_builds(ref, tag, user)
end
commit
end
end
......
......@@ -9,7 +9,7 @@
#up-build-trace
- if @commit.matrix_for_ref?(@build.ref)
%ul.center-top-menu.build-top-menu
- @commit.builds_without_retry_for_ref(@build.ref).each do |build|
- @commit.latest_builds_for_ref(@build.ref).each do |build|
%li{class: ('active' if build == @build) }
= link_to namespace_project_build_path(@project.namespace, @project, build) do
= ci_icon_for_status(build.status)
......@@ -20,7 +20,7 @@
= build.id
- unless @commit.builds_without_retry_for_ref(@build.ref).include?(@build)
- unless @commit.latest_builds_for_ref(@build.ref).include?(@build)
%li.active
%a
Build ##{@build.id}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment