Skip logging obfuscation when no secrets exist - #3875
Conversation
|
@claude review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5d89529a98
ℹ️ 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".
| if (!_secretObfuscator.HasSecrets) | ||
| { | ||
| return state; |
There was a problem hiding this comment.
Preserve structured-log guards without secrets
When a run has no registered secrets, this early return bypasses the existing defensive traversal for structured log states. In that context, a custom IReadOnlyList<KeyValuePair<string, object?>> state whose Count/indexer or formatter throws now reaches BufferedLogEvent.WriteTo unchanged, so the formatter exception can bubble out of PipelineLevelLogger.Log instead of being converted to SecretMask as the current guarded path does. The fast path should avoid value scans without skipping the malformed-state fallback.
Useful? React with 👍 / 👎.
| => exception is null || !secretObfuscator.HasSecrets | ||
| ? exception |
There was a problem hiding this comment.
Keep exception diagnostics safe without secrets
For logs emitted before any secrets are registered, this returns the original exception instead of the sanitized wrapper. In that no-secret context, exceptions with hostile diagnostic properties or a throwing ToString() can now make fallback/direct rendering fail when FormatException() or a provider renders the exception, whereas the wrapper path catches those diagnostics and substitutes safe text. Consider preserving the wrapper for exception-safety even when masking can be skipped.
Useful? React with 👍 / 👎.
Code reviewI ran the existing unit test suite against this branch (build + 🔴 Regression:
|
|
CI diagnosis: Ubuntu is not failing in the logging fast-path changes. |
|
Refreshed onto current main in 3243c5b after the required Ubuntu pipeline hit the known core-test host failure (no failed-test summary; exit 2/134 after 15m40s). Local validation: ModuleOutputBufferTests 30/30, obfuscator tests 25/25, PipelineLevelLoggerTests 16/16; core Release build 0 warnings/errors. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3243c5b7b4
ℹ️ 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".
| if (!_secretObfuscator.HasSecrets) | ||
| { | ||
| return state; |
There was a problem hiding this comment.
Unwrap pre-obfuscated values before fast-pathing
When a run has no registered secrets, CommandLogger still wraps command output and hidden arguments in PreObfuscatedLogValue before logging. Returning the original structured state here means structured log providers now receive those wrapper records instead of the string values this obfuscator previously substituted, so command Input/CommandOutput fields can serialize as wrapper objects rather than plain strings or masks whenever no secrets are registered. The fast path should still unwrap PreObfuscatedLogValue entries before skipping secret scans.
Useful? React with 👍 / 👎.
Code reviewI re-ran the test suite against the current head ( 🔴 Previously-flagged regression is still present and unfixedEarlier I flagged that ModularPipelines/test/ModularPipelines.UnitTests/Logging/ModuleLoggerTests.cs Lines 139 to 142 in 3243c5b I ran it directly (TUnit, via Worth noting: the PR description's validation list ( Architectural concern:
|
Summary
HasSecretscapability backed by the versioned secret cacheValidation
FormattedLogValuesObfuscatorTests: 8 passedSecretObfuscatorCachingTests: 14 passedPipelineLevelLoggerTests: 16 passedModuleOutputBufferTests: 30 passedModularPipelines.slnxRelease build: 0 warnings, 0 errorsgit diff --checkCloses #3756