Skip to content

Add deployment environments to events - #371

Open
ejsmith wants to merge 9 commits into
mainfrom
feature/event-environments
Open

Add deployment environments to events#371
ejsmith wants to merge 9 commits into
mainfrom
feature/event-environments

Conversation

@ejsmith

@ejsmith ejsmith commented Sep 10, 2026

Copy link
Copy Markdown
Member

Adds Configuration.Environment, fluent SetEnvironment(...) helpers, and configuration/environment-variable support for deployment environments. Hosting integration falls back to IHostEnvironment.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.

Copilot AI lite review requested due to automatic review settings September 10, 2026 03:32
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-10T05:22:47.327902Z 1e984cd Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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) and Event.Environment (per-event override) with consistent normalization/validation.
  • Add fluent helpers (SetEnvironment(...)) and support reading the environment from IConfiguration and 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.

Comment thread src/Platforms/Exceptionless.Extensions.Hosting/ExceptionlessExtensions.cs Outdated
Comment thread src/Exceptionless/Utility/DeploymentEnvironment.cs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread src/Exceptionless/Plugins/Default/015_ConfigurationDefaultsPlugin.cs Outdated
@ejsmith

ejsmith commented Sep 10, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread src/Platforms/Exceptionless.Extensions.Hosting/ExceptionlessExtensions.cs Outdated
@ejsmith

ejsmith commented Sep 10, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread src/Platforms/Exceptionless.Extensions.Hosting/ExceptionlessExtensions.cs Outdated
@ejsmith

ejsmith commented Sep 10, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread src/Exceptionless/Models/Client/Event.cs Outdated
@ejsmith

ejsmith commented Sep 10, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread src/Exceptionless/Plugins/Default/015_ConfigurationDefaultsPlugin.cs Outdated
@ejsmith

ejsmith commented Sep 10, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 609fe96b8d

ℹ️ 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".

@ejsmith

ejsmith commented Sep 10, 2026

Copy link
Copy Markdown
Member Author

@codex review

@ejsmith

ejsmith commented Sep 10, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

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.

2 participants