Skip to content

Commit

Permalink
Enhance release ended notification for cross platform releases
Browse files Browse the repository at this point in the history
- add platform specific versions to notify of version drift, if any
  • Loading branch information
nid90 committed Jan 21, 2025
1 parent 8a96728 commit 629b149
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
20 changes: 20 additions & 0 deletions app/libs/notifiers/slack/renderers/release_ended.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,26 @@ def total_run_time
return "N/A" if @release_completed_at.blank? || @release_started_at.blank?
distance_of_time_in_words(@release_started_at, @release_completed_at)
end

def cross_platform?
@app_platform == App.platforms[:cross_platform]
end

def android_finished_text
if @final_android_release_version.present?
":white_check_mark: The Android release finished with the final version of *#{@final_android_release_version}*"
else
":large_yellow_circle: The Android release did not finish"
end
end

def ios_finished_text
if @final_ios_release_version.present?
":white_check_mark: The iOS release finished with the final version of *#{@final_ios_release_version}*"
else
":large_yellow_circle: The iOS release did not finish"
end
end
end
end
end
4 changes: 3 additions & 1 deletion app/models/release.rb
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,9 @@ def notification_params
release_version: release_version,
is_release_unhealthy: unhealthy?,
release_completed_at: completed_at,
release_started_at: scheduled_at
release_started_at: scheduled_at,
final_android_release_version: (android_release_platform_run.release_version if android_release_platform_run&.finished?),
final_ios_release_version: (ios_release_platform_run.release_version if ios_release_platform_run&.finished?)
}
)
end
Expand Down
18 changes: 17 additions & 1 deletion app/views/notifiers/slack/release_ended.json.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,25 @@
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Release <%= @release_version %>* is complete! :confetti_ball:"
"text": "Release *<%= @release_version %>* is complete! :confetti_ball:"
}
},
<% if cross_platform? %>
{
"type": "context",
"elements": [{
"type": "mrkdwn",
"text": "<%= android_finished_text %>"
}]
},
{
"type": "context",
"elements": [{
"type": "mrkdwn",
"text": "<%= ios_finished_text %>"
}]
},
<% end %>
{
"type": "section",
"text": {
Expand Down

0 comments on commit 629b149

Please sign in to comment.