Skip to content

closes #24/support env cascade loading - #75

Merged
bolorundurowb merged 5 commits into
masterfrom
ft/#24/support-env-cascade-loading
Sep 8, 2026
Merged

bolorundurowb merged 5 commits into
masterfrom
ft/#24/support-env-cascade-loading

Conversation

@bolorundurowb

Copy link
Copy Markdown
Owner

No description provided.

- Add `EnvFileCascade` class to manage environment file resolution
- Implement environment name resolution with fallback to predefined variables
- Add file path validation for safe environment names
- Generate candidate file names based on environment and file hierarchy
- Resolve existing file paths and handle missing files with configurable exceptions
- Add comprehensive unit tests for all `EnvFileCascade` functionality
- Include an `EnvironmentVariableScope` helper class for test isolation
- Add tests for default `EnvironmentCascade` and `EnvironmentName` values
- Add tests for setting `EnvironmentCascade` with and without environment name
- Add validation tests disallowing cascade with custom files and streams
- Add tests ensuring file and stream set methods throw when cascade is enabled
- Add tests allowing cascading with probe-based file resolution
- Extend `DotEnvOptions` with cascade-related properties and methods
- Implement cascade state validation in relevant methods
- Add `Reader.GetProbedEnvDirectory` method for directory-based cascade file resolution
- Update `DotEnv.Read` to integrate cascade file path resolution logic
- Extend `ResolveCascadeFilePaths` to probe directories and handle fallback
- Modify exception messages in `Reader.cs` for candidate file name support
- Add unit tests for directory-based probing with cascade files
- Add unit tests for cascade file fallback and exception handling scenarios
- Add `environmentCascade` and `environmentName` descriptions
- Document cascading behaviour and hierarchical file overrides
- Update notes on option conflicts with `envFilePaths` and `envStreams`
- Extend Fluent API table with cascade-related methods
- Add examples for default and explicit environment name usage
- Explain environment variable resolution for cascading
@codecov

codecov Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.90722% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.73%. Comparing base (927650c) to head (5c59aeb).

Files with missing lines Patch % Lines
src/dotenv.net/DotEnv.cs 87.50% 0 Missing and 2 partials ⚠️
src/dotenv.net/DotEnvOptions.cs 96.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #75      +/-   ##
==========================================
+ Coverage   95.62%   95.73%   +0.11%     
==========================================
  Files           7        8       +1     
  Lines         434      516      +82     
  Branches      120      141      +21     
==========================================
+ Hits          415      494      +79     
  Misses          9        9              
- Partials       10       13       +3     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- Add tests for `EnvironmentCascade` and `EnvironmentName` combinations
- Add directory-based probing tests in `EnvFileCascade`
- Validate unsafe names and conflicting options for cascade
- Extend `Reader` tests to handle cascade probing and exceptions
- Add support for layered file reading with cascade
@bolorundurowb
bolorundurowb merged commit e4bedb4 into master Sep 8, 2026
4 checks passed
@bolorundurowb
bolorundurowb deleted the ft/#24/support-env-cascade-loading branch September 8, 2026 13:49
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.

1 participant