diff --git a/app/models/release_platform_run.rb b/app/models/release_platform_run.rb index eb1564224..1e6f0a679 100644 --- a/app/models/release_platform_run.rb +++ b/app/models/release_platform_run.rb @@ -42,7 +42,7 @@ class ReleasePlatformRun < ApplicationRecord scope :sequential, -> { order("release_platform_runs.created_at ASC") } scope :have_not_reached_production, -> { on_track.reject(&:production_release_happened?) } - STAMPABLE_REASONS = %w[version_changed tag_created version_corrected finished] + STAMPABLE_REASONS = %w[version_changed tag_created version_corrected finished stopped] STATES = { created: "created", @@ -61,7 +61,7 @@ class ReleasePlatformRun < ApplicationRecord transitions from: [:created, :on_track], to: :on_track end - event :stop do + event :stop, after_commit: -> { event_stamp!(reason: :stopped, kind: :notice, data: {version: release_version}) } do before { self.stopped_at = Time.current } transitions from: [:created, :on_track], to: :stopped end diff --git a/config/locales/passport/en.yml b/config/locales/passport/en.yml index baded1dec..1ccf6165f 100644 --- a/config/locales/passport/en.yml +++ b/config/locales/passport/en.yml @@ -19,6 +19,7 @@ en: version_changed_html: 'Updated the release version to %{version}' version_corrected_html: 'Updated the release version to %{version} since the ongoing release has moved on to %{ongoing_version}' finished_html: 'Finished the platform release with version %{version}' + stopped_html: 'Stopped the platform release with version %{version}' tag_created_html: 'Tag %{tag} was cut' step_run: created_html: 'Started the step %{name} for %{sha}'