Skip to content

Fix merge config file not available issue#1493

Merged
abhishekkumams merged 10 commits intomainfrom
abhishekkumams-patch-3
May 18, 2023
Merged

Fix merge config file not available issue#1493
abhishekkumams merged 10 commits intomainfrom
abhishekkumams-patch-3

Conversation

@abhishekkumams
Copy link
Copy Markdown
Contributor

@abhishekkumams abhishekkumams commented May 15, 2023

What is the issue?

  • This issue occurs specifically when the environment variable is set and environmentBasedConfigFile is not present and the user tries to do dab start. It will search for the merged file and fail directly if the merged file is not present. Ideally it should not and rather look for the default file.
  • Even though the merging was not happening and the method TryMergeConfigsIfAvailable was returning false, the out file was not empty and it was containing the name of expected mergeConfigFile.

Why make this change?

  • the merge config file name is generated and set as the config to be used even if the merged config file is not available.
  • This will make sure merge config file name is not used if it is not available

What is this change?

  • Moving the line which creates the merged file name inside the validation check for existence of the base and environment config.

How was this tested?

  • Unit Tests

@abhishekkumams abhishekkumams changed the title Update Utils.cs Fix merge config file not available issue May 15, 2023
@abhishekkumams abhishekkumams self-assigned this May 15, 2023
@abhishekkumams abhishekkumams added the bug Something isn't working label May 15, 2023
@abhishekkumams abhishekkumams added this to the 0.8 milestone May 15, 2023
Comment thread src/Cli.Tests/UtilsTests.cs
Copy link
Copy Markdown
Collaborator

@Aniruddh25 Aniruddh25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for catching this scenario!

Comment thread src/Cli/Utils.cs Outdated
Comment thread src/Cli/Utils.cs Outdated
Copy link
Copy Markdown
Contributor

@seantleonard seantleonard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some considerations

Comment thread src/Cli/Utils.cs
Comment thread src/Cli/Utils.cs Outdated
Comment thread src/Cli.Tests/UtilsTests.cs
Comment thread src/Cli.Tests/UtilsTests.cs
Comment thread src/Cli.Tests/UtilsTests.cs Outdated
Copy link
Copy Markdown
Contributor

@severussundar severussundar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for spotting this and pushing a fix

@abhishekkumams abhishekkumams merged commit c3b42ca into main May 18, 2023
@abhishekkumams abhishekkumams deleted the abhishekkumams-patch-3 branch May 18, 2023 06:01
abhishekkumams added a commit that referenced this pull request May 18, 2023
## What is the issue?
- This issue occurs specifically when the environment variable is set
and `environmentBasedConfigFile` is not present and the user tries to do
`dab start`. It will search for the merged file and fail directly if the
merged file is not present. Ideally it should not and rather look for
the default file.
- Even though the merging was not happening and the method
`TryMergeConfigsIfAvailable` was returning false, the out file was not
empty and it was containing the name of expected mergeConfigFile.
 
## Why make this change?
- the merge config file name is generated and set as the config to be
used even if the merged config file is not available.
- This will make sure merge config file name is not used if it is not
available

## What is this change?

- Moving the line which creates the merged file name inside the
validation check for existence of the base and environment config.

## How was this tested?

- [x] Unit Tests
abhishekkumams added a commit that referenced this pull request May 19, 2023
## Why make this change?

- To include the fix for the issue with merge config issue.
#1493
- Also include the fix for broken schema links/path in test configs

## What is this change?
- cherry-picking fix for bugs found in 0.7

---------

Co-authored-by: Shyam Sundar J  <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants