Skip to content

Handling missing environment variables cleaner for SWA#1825

Merged
seantleonard merged 11 commits intomainfrom
aaronpowell/issue/1820
Oct 20, 2023
Merged

Handling missing environment variables cleaner for SWA#1825
seantleonard merged 11 commits intomainfrom
aaronpowell/issue/1820

Conversation

@aaronpowell
Copy link
Copy Markdown
Contributor

Why make this change?

What is this change?

How was this tested?

  • Integration Tests
  • Unit Tests

Test isn't implementing logic of #1820 yet, just replicating an existing test to ensure the test runner passes initially.

Created in a new test class to reduce changes of merge conflicts, but extracted out shared logic from existing test class.
… in deserialization

- New enum that controls the handling of the missing envrionment var
- Default behaviour left unchanged to throw when encountered
- New behaviour to ignore only implemented in the callsite of the config controller
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.

Thanks for quick fix! Left some questions..

Comment thread src/Service.Tests/Configuration/LoadConfigViaEndpoint.cs
Comment thread src/Service.Tests/Configuration/LoadConfigViaEndpoint.cs
Left the updated code paths in so if the decision is changed we are perpared for it. Also left test in, but ignored, for future
@Aniruddh25 Aniruddh25 added this to the 0.9 milestone Oct 19, 2023
Comment thread src/Service.Tests/Configuration/LoadConfigViaEndpoint.cs Outdated
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 addressing this.

Comment thread src/Core/Configurations/RuntimeConfigProvider.cs
Comment thread src/Config/Converters/StringJsonConverterFactory.cs
Comment thread src/Service.Tests/Configuration/LoadConfigViaEndpoint.cs Outdated
Comment thread src/Service.Tests/Configuration/LoadConfigViaEndpoint.cs
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.

thanks for updating to ensure we have this functionality for Prod V1 config endpoint! and updating tests accordingly

@seantleonard seantleonard merged commit a12f39f into main Oct 20, 2023
@seantleonard seantleonard deleted the aaronpowell/issue/1820 branch October 20, 2023 15:37
seantleonard pushed a commit that referenced this pull request Oct 20, 2023
## Why make this change?

- Fixes #1820 

## What is this change?

- New test coverage for #1820
- Added a way to control error handling when env vars aren't set -
default is left to throw, override to ignore

## How was this tested?

- [x] Integration Tests
- [ ] Unit Tests
Aniruddh25 pushed a commit that referenced this pull request Oct 21, 2023
…1825) (#1834)

Cherry pick #1825 to 0.9

## Why make this change?

- Fixes #1820 

## What is this change?

- New test coverage for #1820
- Added a way to control error handling when env vars aren't set -
default is left to throw, override to ignore

## How was this tested?

- [x] Integration Tests
- [ ] Unit Tests

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: DAB shouldn't throw exceptions for scenarios that are ONLY applicable to file based configs

3 participants