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

Avoid Exceptions when AppConfigPath does not exist #1218

Merged
merged 3 commits into from
Dec 23, 2024

Conversation

FrankBakkerNl
Copy link
Contributor

Breaking change

Proposed change

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • The code compiles without warnings (code quality check)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration are added/changed:

Copy link

codecov bot commented Dec 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82%. Comparing base (fd051a4) to head (ff5d5ba).
Report is 1 commits behind head on main.

Additional details and impacted files
@@         Coverage Diff          @@
##           main   #1218   +/-   ##
====================================
- Coverage    82%     82%   -1%     
====================================
  Files       196     196           
  Lines      3845    3840    -5     
  Branches    425     426    +1     
====================================
- Hits       3164    3159    -5     
  Misses      516     516           
  Partials    165     165           
Flag Coverage Δ
unittests 82% <100%> (-1%) ⬇️

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.

@@ -115,13 +113,6 @@ private async Task LoadNewAppContextAsync(IHomeAssistantConnection haConnection,
var appModel = serviceProvider.GetService<IAppModel>();
if (appModel == null) return;

// this logging is a bit weird in this class
if (!string.IsNullOrEmpty(locationSettings.Value.ApplicationConfigurationFolder))
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this could be a good option to have as a debug log rather than default to be able to track down configuration issues. It is not as important when running it through a container but in other scenarios it can.


public IReadOnlyCollection<SyntaxTree> GetSyntaxTrees()
{
logger.LogDebug("Loading applications from folder {Path}", _settings.ApplicationConfigurationFolder);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ohh never mind the logging comment, you moved it here instead. Yea that is better!

@FrankBakkerNl FrankBakkerNl merged commit 1f40b3b into net-daemon:main Dec 23, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants