Repository navigation
Test that Disabled() reports the environment when it opts out - #36
Merged
dmccoystephenson merged 1 commit intoNov 13, 2026
Merged
Conversation
TraceClient.Disabled() goes through the same constructor as any other client, and the environment is checked before enabled: false. Under DO_NOT_TRACK=1 its DisabledReason is therefore "environment", not "config". The only existing assertion ran with a clean environment, so pin the other case and say so in the factory's XML doc. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Self-review rubric (Phase 4, scored against the diff and CI run 43354680542):
Judgment calls:
Summary: a characterization test plus a doc comment. No contract surface is touched, the anchor is green on all three target legs, and no do-not-auto-merge path matches. This comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
dmccoystephenson
deleted the
feature/disabled-factory-environment-reason
branch
November 13, 2026 02:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stage B (unit-test expansion) cycle covering the
TraceClient.Disabled()factory.Disabled()builds its client through the same constructor as any other, and the constructor checks the environment beforeenabled: false. UnderDO_NOT_TRACK=1orTRACE_USAGE_REPORTING=off, itsDisabledReasonis thereforeenvironment, notconfig. The only existing assertion (DisabledReason_NamesTheConfigFlagOrTheMissingKey) ran with a clean environment, so the other case was untested.Disabled_SaysEnvironmentRatherThanConfigWhenTheEnvironmentOptsOut, is added. It also asserts that such a client is not enabled and has noInstallId.Disabled()XML doc now names both possible reasons. No behaviour, wire format, reason string or public signature is changed.No tracking issue: the gap was found during triage. All three open issues were deferred because each one needs a maintainer's decision on the behaviour contract:
Drain/Closedesign change that depends on parity with the Java client.User-Agent): a wire-format change, and the issue lists options for the maintainer to choose from.Test plan
Buildpasses on ubuntu-latest (net8.0) and windows-latest (net8.0 + net48), including the new test.src/TraceClient/TraceClient.cs(XML doc comment only) andtests/TraceClient.Tests/TraceClientTest.csare changed.No .NET SDK could run in the dispatch sandbox, so local tests are UNVERIFIED. The CI matrix on the PR head is the test gate.
This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
🤖 Generated with Claude Code
drafted by Claude on behalf of Daniel Stephenson