-
Notifications
You must be signed in to change notification settings - Fork 288
Adding Merge config capabilities #1446
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
|
Could I make a request that we be really cautious on this work as I'm getting close to completing #1402 which will see a major overhaul of the config type system in place, which may impact the way that merging needs to be undertaken. |
|
Please update the comment here: it is no longer only used for testing. Probably explicitly write what it is initialized with.
|
Aniruddh25
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.
Looking for few answers
… dev/abhishkkuma/merge_config_files
…om/Azure/data-api-builder into dev/abhishkkuma/merge_config_files
seantleonard
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.
last few nits and question based on latest changes
seantleonard
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.
Thank you for adding this capability!
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, thanks for clarifying my questions!
Why make this change?
dab-config.jsonanddab-config.<Environment>.json? #714 , Issues with multiple config files #722What is this change?
dab start.dab start. It will check ifDAB_ENVIRONMENTis set. if yes, then it will try to merge thedab-config.jsonwith thedab-config.{DAB_ENVIRONMENT}.jsonand use the generated merged filedab-config.{DAB_ENVIRONMENT}.merged.jsonto startup the engine.dab-config.json. if that is also not available, an error will be thrown.How the merge is performed?
How was this tested?
Sample Request(s)
DAB_ENVIRONMENTvariable in your environment settings. for ex: Development.dab-config.Development.json. It will have the connection string and other information that is for local development.dab-config.jsonwhich can act as base file.dab startthe merge will be performed, and the generated merged filedab-config.Development.merged.jsonwill be used to fire up the engine.Example Scenarios:
Case1:
Environment value: $env:DAB_ENVIROMENT=""
command:
dab startFiles in Directory:
Config Used for startup: dab-config.json
Reasoning: Environment value not setup
Case2:
Environment value: $env:DAB_ENVIROMENT="PRODUCTION"
command:
dab startFiles in Directory:
Config Used for startup: dab-config.json
Reasoning:
dab-config.PRODUCTION.jsonis not present in the directoryCase3:
Environment value: $env:DAB_ENVIROMENT="DEVELOPMENT"
command:
dab startFiles in Directory:
Config Used for startup: dab-config.json + dab-config.DEVELOPMENT.json (Merged)
Reasoning: both
dab-config.jsonanddab-config.DEVELOPMENT.jsonis present in the directoryCase4:
Environment value: $env:DAB_ENVIROMENT="DEVELOPMENT"
command:
dab start -c dab-config.jsonFiles in Directory:
Config Used for startup: dab-config.json
Reasoning: If config is provided by the user it will always get precedence irrespective of the ENVIRONMENT value.