-
Notifications
You must be signed in to change notification settings - Fork 2.8k
read version from env var during server build time (close #1398) #1897
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
Conversation
|
Deploy preview for hasura-docs ready! Built with commit 6f08de2 |
|
Deploy preview for hasura-docs ready! Built with commit ae0a6a4 |
|
Review app for commit 4eb0543 deployed to Heroku: https://hge-ci-pull-1897.herokuapp.com |
ecthiender
left a comment
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.
LGTM
|
Review app for commit b4414e0 deployed to Heroku: https://hge-ci-pull-1897.herokuapp.com |
|
The script is executed if env var is missing. |
|
Review app for commit 60fdcf9 deployed to Heroku: https://hge-ci-pull-1897.herokuapp.com |
nizar-m
left a comment
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.
LGTM
|
Review app https://hge-ci-pull-1897.herokuapp.com is deleted |
|
Review app for commit ae0a6a4 deployed to Heroku: https://hge-ci-pull-1897.herokuapp.com |
hasura#1897) * read version from env var at build time (close hasura#1398) * remove un-used imports, edit makefile * edit makefile to add new targets and export variables * only export VERSION in makefile * read version by executing the script if env var is absent
<!-- The PR description should answer 2 important questions: --> ### What The SQL tests checked whether skipping relational pushdown gave us the same result as using the NDC / DataFusion route. They only worked sometimes, now they should run always. As a result, more tests are running and we need to fix a few things. 1) the custom connector doesn't like missing fields, changes to use an explicit `null`. 2) we add an ability to explicitly skip these diff tests, as a few places they don't work. V3_GIT_ORIGIN_REV_ID: 3a720d09e37d497ea21e42f782ad651106113e0c
Description
This PR modifies the server code to read the version from an env var
VERSIONduring build time. Earlier it was done by executionscripts/get-version.sh. Also addsbuildandexecrules to the makefile.If the env var is not set, it defaults to the output of
scripts/get-version.sh.This makes it easier to build server with custom version during dev - especially when CLI/Server compatibility needs to be tested/worked upon.
Affected components
Related Issues
close #1398
Solution and Design
getValFromEnv :: String -> TH.Q TH.Expfunction is added toHasura.Server.Utilsmodule and this function is called fromHasura.Server.Versionmodule asversion = $(getValFromEnv "VERSION")Steps to test and verify
Build the server with a custom version:
Run the server:
HASURA_GRAPHQL_DATABASE_URL=postgres://postgres:@localhost:5432/postgres make execHit the
/v1/versionendpoint:curl http://localhost:8080/v1/version {"version":"my-custom-version"}Limitations, known bugs & workarounds
NA