Skip to content

refactor(docs): replace ASPNETCORE_ENVIRONMENT with DOTNET_ENVIRONMENT#216

Merged
j-d-ha merged 8 commits into
mainfrom
fix/remove-aspnetcore-env-ref
Dec 4, 2025
Merged

refactor(docs): replace ASPNETCORE_ENVIRONMENT with DOTNET_ENVIRONMENT#216
j-d-ha merged 8 commits into
mainfrom
fix/remove-aspnetcore-env-ref

Conversation

@j-d-ha

@j-d-ha j-d-ha commented Dec 4, 2025

Copy link
Copy Markdown
Collaborator

🚀 Pull Request

📋 Summary

This PR refactors the codebase to use the standard DOTNET_ENVIRONMENT environment variable instead of ASPNETCORE_ENVIRONMENT. The change includes:

  • Replaced all ASPNETCORE_ENVIRONMENT references in launchSettings.json files with DOTNET_ENVIRONMENT
  • Added documentation clarifying how CreateBuilder() handles ASPNETCORE_ prefixed environment variables
  • Added examples showing the proper usage of DOTNET_ENVIRONMENT
  • Enabled MkDocs TOC section heading permalinks for better documentation navigation
  • Added run-docs task for local documentation development

This aligns with modern .NET practices and reduces confusion around environment variable naming.


✅ Checklist

  • My changes build cleanly
  • I've added/updated relevant tests
  • I've added/updated documentation or README
  • I've followed the coding style for this project
  • I've tested the changes locally (if applicable)

🧪 Related Issues or PRs

N/A - Internal code quality improvement


💬 Notes for Reviewers

The change is primarily about standardizing on DOTNET_ENVIRONMENT instead of the legacy ASPNETCORE_ENVIRONMENT variable. The new documentation explains that while CreateBuilder() automatically maps ASPNETCORE_ prefixed variables to configuration keys, developers should use the standard DOTNET_ENVIRONMENT variable for environment detection.

…Builder()`

- Updated configuration documentation to specify the exclusion of `ASPNETCORE_` prefixed variables.
- Added warning about manually handling `ASPNETCORE_ENVIRONMENT` when using `CreateBuilder()`.
- Introduced a new `run-docs` task in LocalDevTasks.yml for running MKDocs with live reload.
- Ensured compatibility with the existing developer workflow.
…ENVIRONMENT`

- Updated `launchSettings.json` across multiple examples to use `DOTNET_ENVIRONMENT` instead.
- Ensures consistency with modern .NET environment variable standards.
- Added `permalink` and `permalink_title` configuration to `toc` extension in `mkdocs.yml`.
- Allows users to easily reference specific sections with anchor links.
… environment variables

- Included code snippets for loading `ASPNETCORE_` prefixed environment variables after `CreateBuilder()`.
- Added guidance for using `ASPNETCORE_` variables when creating `LambdaApplicationBuilder`.
@github-actions github-actions Bot added the type: refactor Code refactoring label Dec 4, 2025
@j-d-ha j-d-ha changed the title refactor(environment): replace ASPNETCORE_ENVIRONMENT with DOTNET_ENVIRONMENT refactor(docs): replace ASPNETCORE_ENVIRONMENT with DOTNET_ENVIRONMENT Dec 4, 2025
@codecov

codecov Bot commented Dec 4, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #216   +/-   ##
=======================================
  Coverage   90.92%   90.92%           
=======================================
  Files         102      102           
  Lines        2227     2227           
  Branches      252      252           
=======================================
  Hits         2025     2025           
  Misses        109      109           
  Partials       93       93           

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2849719...3217516. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

- Updated `validate-pr-title.yaml` to include `docs` in the list of valid PR title scopes.
- Ensures consistency with recent documentation-related contributions.
…ilder()` docs

- Clarified the order in which configuration providers are added when defaults are enabled.
- Added details about disabling defaults with `LambdaApplicationOptions.DisableDefaults`.
- Expanded provider list to include all relevant environment variable categories.
- Added YAML front matter to `index.md` to define metadata like `title`.
- Prepares `index.md` for compatibility with static site generators like MkDocs.
@sonarqubecloud

sonarqubecloud Bot commented Dec 4, 2025

Copy link
Copy Markdown

@j-d-ha
j-d-ha merged commit f3f5cbd into main Dec 4, 2025
10 checks passed
@j-d-ha
j-d-ha deleted the fix/remove-aspnetcore-env-ref branch December 4, 2025 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: refactor Code refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant