Adding Merge config capabilities#1446
Merged
abhishekkumams merged 33 commits intomainfrom May 5, 2023
Merged
Conversation
Contributor
|
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. |
Contributor
|
Please update the comment here: it is no longer only used for testing. Probably explicitly write what it is initialized with. |
ayush3797
reviewed
Apr 27, 2023
ayush3797
reviewed
Apr 27, 2023
Aniruddh25
reviewed
May 3, 2023
Aniruddh25
reviewed
May 3, 2023
Aniruddh25
reviewed
May 3, 2023
Aniruddh25
requested changes
May 3, 2023
Collaborator
Aniruddh25
left a comment
There was a problem hiding this comment.
Looking for few answers
… dev/abhishkkuma/merge_config_files
…om/Azure/data-api-builder into dev/abhishkkuma/merge_config_files
seantleonard
reviewed
May 4, 2023
Contributor
seantleonard
left a comment
There was a problem hiding this comment.
last few nits and question based on latest changes
seantleonard
approved these changes
May 5, 2023
Contributor
seantleonard
left a comment
There was a problem hiding this comment.
Thank you for adding this capability!
Aniruddh25
approved these changes
May 5, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.