The revision information cannot be loaded the way it is implemented right now. At the moment the code assumes that it is being built from a Git repository. This assumption is wrong. The CI system does not clone the repository. It is using a different API to access the code and download it. So there is no .git folder and there is no git status or revision information available via the git CLI tool. The current implementation does not work properly to find out the revision the tool is being built from.
Solution:
Change the code to be note calling any git commands. This is an elegant solution, but this does not work. Instead of this the settings backend should simply return the value of an environment variable: CI_REVISION.
There should be a fallback. In case the CI_REVISION environment variable is not present, the settings endpoint should return a string like UNKNOWN_REVISION, so it would be obvious that the revision could not be determined.
Please remove all the calls that are calling git commands build time. At the moment there seems to be a solution in place that is calling git commands build time, but this is not a viable option due to the properties of the build system. Please load the version information runtime from an environment variable
Relevant code:
Please use the CI_REVISION env var to load the git revision:
Problem:
.git
folder and there is no git status or revision information available via the git CLI tool. The current implementation does not work properly to find out the revision the tool is being built from.Solution:
CI_REVISION
.CI_REVISION
environment variable is not present, the settings endpoint should return a string likeUNKNOWN_REVISION
, so it would be obvious that the revision could not be determined.Relevant code:
Please use the CI_REVISION env var to load the git revision:
https://github.com/geniusyield/dex-contracts-api/blob/68ffafffb066238fc1f69d41f27a1e5ad97b8052/geniusyield-server-lib/src/GeniusYield/Server/Api.hs#L271
To be removed:
https://github.com/geniusyield/dex-contracts-api/blob/68ffafffb066238fc1f69d41f27a1e5ad97b8052/geniusyield-server-lib/src/GeniusYield/Server/Constants.hs#L37-L38