Skip to content

Commit

Permalink
Finished class
Browse files Browse the repository at this point in the history
Fixing update last test

Signed-off-by: Rodrigo Nardi <[email protected]>
  • Loading branch information
RodrigoMNardi committed May 31, 2024
1 parent c628d7d commit 8597974
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lib/github/plan_execution/finished.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,15 @@ def in_progress?(build_status)
private

def update_all_stages
@check_suite.stages.each do |stage|
build_summary(stage.jobs.last)
end
last_stage =
Stage
.joins(:configuration)
.where(check_suite: @check_suite)
.max_by { |stage| stage.configuration.position }

return if last_stage.nil? or last_stage.jobs.last.nil?

build_summary(last_stage.jobs.last)
end

# This method will move all tests that no longer exist in BambooCI to the skipped state,
Expand Down Expand Up @@ -150,6 +156,8 @@ def slack_notify_cancelled(job)
def check_stages
github_check = Github::Check.new(@check_suite)
@logger.info ">>> @result: #{@result.inspect}"
return if @result.nil? or @result.empty? or @result['status-code'] == 404

@result.dig('stages', 'stage').each do |stage|
stage.dig('results', 'result').each do |result|
ci_job = CiJob.find_by(job_ref: result['buildResultKey'], check_suite_id: @check_suite.id)
Expand Down

0 comments on commit 8597974

Please sign in to comment.