-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add endpoint showing the currently-deployed version #2549
Conversation
joshlarson
commented
Apr 22, 2024
•
edited
Loading
edited
- To see the specific tasks where the Asana app for GitHub is being used, see below:
- https://app.asana.com/0/0/1207101804432602
use SkateWeb, :controller | ||
|
||
def version(conn, _params) do | ||
send_resp(conn, 200, Application.get_env(:skate, :version)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion(non-blocking): IMO it's more useful to get this at compile time than runtime. I dunno about testing here though...
send_resp(conn, 200, Application.get_env(:skate, :version)) | |
send_resp(conn, :ok, Application.compile_env(:skate, :version)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got 👇 error 😭
(RuntimeError) Application.compile_env/3 cannot be called inside functions, only in the module body
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use SkateWeb, :controller | ||
|
||
def version(conn, _params) do | ||
send_resp(conn, 200, Application.get_env(:skate, :version)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
send_resp(conn, 200, Application.get_env(:skate, :version)) | |
send_resp(conn, :ok, Application.get_env(:skate, :version)) |
Seems to work - that's cool! |
Coverage of commit
|
|
||
def version(conn, _params) do | ||
send_resp(conn, 200, Application.get_env(:skate, :version)) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def version(conn, _params) do | |
send_resp(conn, 200, Application.get_env(:skate, :version)) | |
end | |
@version Application.compile_env(:skate, :version) | |
def version(conn, _params) do | |
send_resp(conn, :ok, @version) | |
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah... that does mess up the tests though. I guess the value of testing this endpoint at all is pretty minimal though 🙃
Coverage of commit
|
Co-authored-by: Kayla Firestack <firestack@users.noreply.github.com>
Coverage of commit
|