From 89c9c73632772fb4862891d513ae2f4d89335406 Mon Sep 17 00:00:00 2001 From: Taylor Downs Date: Wed, 2 Aug 2023 10:32:11 +0100 Subject: [PATCH] closes #1010 --- CHANGELOG.md | 2 ++ config/runtime.exs | 2 +- lib/lightning_web/live/components/common.ex | 2 +- test/lightning_web/live/components/common_test.exs | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc0e2f8638..d96c3362e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,8 @@ and this project adheres to first click. [#976](https://github.com/OpenFn/Lightning/issues/976) - Return the pre-filled workflow names [#971](https://github.com/OpenFn/Lightning/issues/971) +- Fix version reporting and external reset_demo() call via + Application.spec()[#1010](https://github.com/OpenFn/Lightning/issues/1010) ## [v0.7.0-pre5] - 2023-07-28 diff --git a/config/runtime.exs b/config/runtime.exs index b085b3b5b1..9ec05c5a9b 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -250,7 +250,7 @@ release = else: image_tag _other -> - "mix-v#{elem(:application.get_key(:lightning, :vsn), 1)}" + "mix-v#{Application.spec(:lightning, :vsn)}" end config :sentry, diff --git a/lib/lightning_web/live/components/common.ex b/lib/lightning_web/live/components/common.ex index 291c10974f..e72bf748a6 100644 --- a/lib/lightning_web/live/components/common.ex +++ b/lib/lightning_web/live/components/common.ex @@ -9,7 +9,7 @@ defmodule LightningWeb.Components.Common do image = image_info[:image_tag] branch = image_info[:branch] commit = image_info[:commit] - vsn = "v#{elem(:application.get_key(:lightning, :vsn), 1)}" + vsn = "v#{Application.spec(:lightning, :vsn)}" {display, message, type} = cond do diff --git a/test/lightning_web/live/components/common_test.exs b/test/lightning_web/live/components/common_test.exs index 623ef03891..95a836c40e 100644 --- a/test/lightning_web/live/components/common_test.exs +++ b/test/lightning_web/live/components/common_test.exs @@ -8,7 +8,7 @@ defmodule LightningWeb.Components.CommonTest do prev = Application.get_env(:lightning, :image_info) Application.put_env(:lightning, :image_info, - image_tag: "v#{elem(:application.get_key(:lightning, :vsn), 1)}", + image_tag: "v#{Application.spec(:lightning, :vsn)}", branch: "main", commit: "abcdef7" ) @@ -27,7 +27,7 @@ defmodule LightningWeb.Components.CommonTest do assert html =~ "Docker image tag found" assert html =~ "tagged release build" - assert html =~ "v#{elem(:application.get_key(:lightning, :vsn), 1)}" + assert html =~ "v#{Application.spec(:lightning, :vsn)}" end end