Better config/version.rb handling and loading more variables from it

I run my discourse instance from an rpm instead of git. that means may parts of discourse that try to find out the version from git fail in my installation. while investigating this i noticed that there is already code to load the version information from a file. But that code had a lot of duplicates. So i moved the common code into a function and then added another function to return the full git describe string.

Would this patch be acceptable?

https://gist.github.com/darix/4c6ba244186a6634be1ac6f0adf77f0a

1 Like

Does the patch need any improvements or is it ok as is?

In principle I am ok with it just worried it may break CI or plugin UI

code flow should be the same still.i also tested without config/version.rb and only some values set i config/version.rb.

Send thorough a PR we can have a look

https://github.com/discourse/discourse/pull/5061

2 Likes