From c1058ac536d0acc0777cdcae5af076fea1b5fb64 Mon Sep 17 00:00:00 2001 From: D Chua Date: Mon, 25 Sep 2023 12:12:58 +0100 Subject: [PATCH] Fix release version in footer This has been broken since we moved to EKS and the SHA is no longer provided. We can use the [SENTRY_RELEASE](https://github.com/alphagov/govuk-helm-charts/blob/077117e7f40c096a958f9e0b853a2bd76cf43f26/charts/generic-govuk-app/templates/deployment.yaml#L92C1-L92C1) environment variable which is defined for every app and takes its value from the container image's tag. If for whatever reason the image tag is not defined it will display `null`, which should make it clearer (instead of displaying `development`) that this data is not being pulled in successfully. --- app/views/layouts/application.html.erb | 2 +- config/initializers/current_release_sha.rb | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) delete mode 100644 config/initializers/current_release_sha.rb diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 74bbdd6eb..2a52ec020 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -47,7 +47,7 @@ <% if content_for?(:thin_form) %><% end %> <% end %> -<% content_for :footer_version, CURRENT_RELEASE_SHA %> +<% content_for :footer_version, ENV.fetch("SENTRY_RELEASE", "null") %> <%# use the govuk_admin_template layout %> <%= render :template => 'layouts/govuk_admin_template' %> diff --git a/config/initializers/current_release_sha.rb b/config/initializers/current_release_sha.rb deleted file mode 100644 index e68ebecc3..000000000 --- a/config/initializers/current_release_sha.rb +++ /dev/null @@ -1,6 +0,0 @@ -if File.exist?(Rails.root.join("REVISION")) - revision = `cat #{Rails.root}/REVISION`.chomp - CURRENT_RELEASE_SHA = revision[0..10] # Just get the short SHA -else - CURRENT_RELEASE_SHA = "development".freeze -end