Skip to content

Commit

Permalink
Move finalization out of the transition lock
Browse files Browse the repository at this point in the history
  • Loading branch information
kitallis committed Oct 31, 2024
1 parent 388527a commit 5eb8bde
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/models/step_run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,7 @@ class StepRun < ApplicationRecord
transitions from: [:deployment_started, :deployment_restarted], to: :failed_with_action_required
end

event(:finish) do
after { event_stamp!(reason: :finished, kind: :success, data: stamp_data) }
after { finalize_release }
event(:finish, after_commit: :finalize_release) do
transitions from: [:deployment_started, :deployment_restarted], to: :success
end

Expand Down Expand Up @@ -515,6 +513,7 @@ def after_finish_ci
end

def finalize_release
event_stamp!(reason: :finished, kind: :success, data: stamp_data)
Coordinators::FinishPlatformRun.call(release_platform_run) if release_platform_run.finalizable?
end
end

0 comments on commit 5eb8bde

Please # to comment.