Skip to content
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

Refactor configuration handling #971

Merged
merged 9 commits into from
Nov 26, 2023
Merged

Refactor configuration handling #971

merged 9 commits into from
Nov 26, 2023

Conversation

martincostello
Copy link
Owner

@martincostello martincostello commented Nov 26, 2023

  • Use appsettings.json to configure logging instead of code.
  • Use IConfiguration and remove manual configuration.
  • Use the configuration binding source generator.
  • Refactor workflows to get Lambda settings from aws-lambda-tools-defaults.json.

Specify `function-architecture` in the AWS Lambda tools defaults and sort the `function-*` properties.
Use appsettings.json to configure logging instead of code.
Missed from previous commit.
@martincostello martincostello added enhancement dependencies Pull requests that update a dependency file .NET Pull requests that update .net code labels Nov 26, 2023
Copy link

codecov bot commented Nov 26, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4655865) 96.97% compared to head (3dfd6c9) 96.91%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #971      +/-   ##
==========================================
- Coverage   96.97%   96.91%   -0.07%     
==========================================
  Files          24       24              
  Lines         496      486      -10     
  Branches       57       53       -4     
==========================================
- Hits          481      471      -10     
  Misses          5        5              
  Partials       10       10              
Flag Coverage Δ
linux 95.88% <100.00%> (-0.09%) ⬇️
macos 96.91% <100.00%> (-0.07%) ⬇️
windows 96.91% <100.00%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Enable the configuration binding source generator.
Apply logging configuration from `IConfiguration`.
For some reason on Linux, the code coverage is 1% less.
Include the `aws-lambda-tools-defaults.json` file in publish so it is included in the Lambda ZIP file so it can be used to configure the Lambda when deployed.
@martincostello
Copy link
Owner Author

/deploy dev

Read the Lambda settings from `aws-lambda-tools-defaults.json`, rather than multiple copies in the different workflow files.
Fix shellcheck warnings setting up the Lambda settings.
@martincostello martincostello marked this pull request as ready for review November 26, 2023 15:56
@martincostello martincostello merged commit 2b7a6fe into main Nov 26, 2023
13 checks passed
@martincostello martincostello deleted the refactor-config branch November 26, 2023 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement .NET Pull requests that update .net code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant