Add deployment environments to events - #371
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
🟡 Changes recommended
The DI registration change for externally provided ExceptionlessClient may alter disposal/ownership semantics in a potentially breaking way and should be clarified/adjusted before approval.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR introduces first-class “deployment environment” support in the Exceptionless .NET client so events can be tagged (and deduplicated) by environment while keeping existing runtime/environment diagnostics separate.
Changes:
- Add
ExceptionlessConfiguration.Environment(default) andEvent.Environment(per-event override) with consistent normalization/validation. - Add fluent helpers (
SetEnvironment(...)) and support reading the environment fromIConfigurationand environment variables. - Update hosting integration to fall back to
IHostEnvironment.EnvironmentName, and extend tests to cover serialization, defaults, hosting, and duplicate detection behavior.
File summaries
| File | Description |
|---|---|
| test/Exceptionless.Tests/Serializer/Models/EventSerializerTests.cs | Adds JSON round-trip coverage ensuring top-level environment is distinct from data.@environment. |
| test/Exceptionless.Tests/Plugins/910_DuplicateCheckerPluginTests.cs | Verifies duplicate detection behavior is scoped to environment. |
| test/Exceptionless.Tests/Plugins/015_ConfigurationDefaultsPluginTests.cs | Ensures default environment applies only when the event doesn’t override it. |
| test/Exceptionless.Tests/Platforms/HostingExtensionsTests.cs | Validates hosting fallback to IHostEnvironment.EnvironmentName when not explicitly configured. |
| test/Exceptionless.TestHarness/Serializer/StorageSerializerTestBase.cs | Includes environment in harness event creation for storage serialization coverage. |
| src/Platforms/Exceptionless.Extensions.Hosting/ExceptionlessExtensions.cs | Applies hosting fallback for environment during DI registration/resolution. |
| src/Exceptionless/Utility/DeploymentEnvironment.cs | Introduces centralized environment normalization/validation logic. |
| src/Exceptionless/Plugins/Default/015_ConfigurationDefaultsPlugin.cs | Applies default configuration environment to events when unspecified. |
| src/Exceptionless/Models/Client/Event.cs | Adds Event.Environment, includes it in equality/hash, and serializes it as top-level environment. |
| src/Exceptionless/Extensions/ExceptionlessConfigurationExtensions.cs | Adds configuration helper and reads environment from config/env vars. |
| src/Exceptionless/Extensions/EventBuilderExtensions.cs | Adds EventBuilder.SetEnvironment(...) for per-event overrides. |
| src/Exceptionless/Configuration/ExceptionlessConfiguration.cs | Adds ExceptionlessConfiguration.Environment with normalization/validation. |
| README.md | Documents environment configuration, overrides, normalization rules, and separation from runtime metadata. |
Review details
- Files reviewed: 14/14 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6f4f13670b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2ac945eb94
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5f875dcdd6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fca9d0e0b3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cb3f2150ef
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1e984cd781
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Adds
Configuration.Environment, fluentSetEnvironment(...)helpers, and configuration/environment-variable support for deployment environments. Hosting integration falls back toIHostEnvironment.EnvironmentName; per-event settings override the default.Environment values retain their supplied casing after trimming. Search and aggregation normalization happens on the server, which continues grouping the same error into one stack. Duplicate detection preserves distinct event payloads.
Validation: Linux, macOS, and Windows CI passed, including net472 configuration tests. Focused regressions cover invalid overrides, host defaults, reuse, caller-owned clients, aggregate exceptions, and exclusion callbacks. No breaking public APIs.
Updates the private SourceLink build dependency from 10.0.300 to 10.0.303 to unblock CI restore and address CVE-2026-62900. The patch was published August 11; it changes build tooling only and requires no application migration.
Deploy the server support before adopting the new SDK setting.
Related PRs: Exceptionless #2570, Exceptionless.JavaScript #193.