Repository navigation
STJ.Observer 2.0 on Observer.Core - #10
Merged
Merged
Conversation
- DragoAntObserverLocal=true swaps the DragoAnt.Observer.Core package for a ProjectReference into ../Observer (DragoAntObserverRoot) - CI checks out DragoAnt/Observer (same branch, else main) and builds with the switch on until Core 1.0.0 is published
- moved types come from Core under their final names: MaskTag, MaskKind (Omit is Null), MaskResult, MaskStatus (NotJson is Unrecognized), PathExplanation, PathOutcome, UnknownMemberPolicy, NoContext, DataPath, NameMatch and Names - JsonObserverOptions derives from ObserverOptions; JsonShapeOptions and JsonBodyLoggingContext have init properties; JsonShapeOptions.UnknownTag - strategies are ValueMaskStrategy writing to a MaskValueWriter - one custom rule delegate, JsonValueRule<TContext>, and JsonValuePolicy accepting ValuePolicy for any context; LegacyAllowList removed - one masking verb Mask(tag | replacement | strategy) with MaskNulls; Relative is AnyDepth, multi-name Match is Path - Explain takes a ValueKind; FindMember and the case flag are internal - the package imports DragoAnt.Observer (DragoAntObserverImplicitUsing) - net8.0 and net10.0 only
- InputTruncated, OutputCapped, ValueCut, TrailingData (data after the root, which used to read as Masked), InvalidUtf8Replaced, Depth - Masked now means no flag: trailing data and replaced UTF-8 report Truncated with the whole document written
- the reader allows comments when the policy or a rule may keep one, and skips them otherwise at no cost - Before / Inline / After ownership by line, rules via .Comment(kinds, rule) after any path rule, masked owners write kept comments masked - kept comments are written as block comments and count toward MaxOutputBytes; shape observers follow the policy - the HTTP body logger drops every comment (CommentPolicy.DropAll)
- Mask(ReadOnlySpan<char>, IBufferWriter<byte> | IBufferWriter<char>)
and Read(ReadOnlySpan<char>) for both observer types
- JsonObserver.Read(...) reports status and flags without a context
- Explain rejects wildcards and tags, and declares the
DragoAnt.ObserverPath string syntax
- tests pin that existing Mask(null) / Mask("...") calls stay unambiguous
- package validation baseline 1.0.2 (the unlisted 9.0.0 / 9999.0.0 are stray uploads, not baselines) - CompatibilitySuppressions.xml lists every intended 1.0.2 -> 2.0 break, so any other break fails the pack - the buildTransitive props are packed by MSBuildKit
- CHANGELOG: changed-breaking items 13-27 for the Core move, the hash, flags, renames and TFMs, plus the missing IgnoreNullsJsonTokenType line - docs/migrating-to-2.0.md: rename table, hash and comment changes, the .NET 10 SDK requirement coming with Observer 1.1 / 1.2; doc-tested
- AllocationTests add a Last4 + keyed Hash observer to the 0 B budgets - CI packs the solution, which runs package validation against 1.0.2
The picker looked only for an Observer branch named like this one, so a PR whose Observer branch has a different name built against main. An 'Observer-Ref:' line in the PR body now wins, then the same branch name, then main.
A forced 0.0.0-ci version made the assembly 0.0.0.0, so package validation rejected it against the 1.0.2 baseline. The kit derives the CI version from VersionPrefix, as the shared workflow does.
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.
DragoAnt.System.Text.Json.Observer2.0, rebuilt onDragoAnt.Observer.Core1.0 (DragoAnt/Observer#2). Migration:docs/migrating-to-2.0.md.What CI uses: the inline job checks out DragoAnt/Observer at the
Observer-Ref:line below (else the same branch name, elsemain) and builds with-p:DragoAntObserverLocal=true. Once Core 1.0.0 is on nuget.org, switch back to the shared caller.Breaking changes
DragoAnt.Observer. The package adds an implicitusing; turn it off withDragoAntObserverImplicitUsing=false.JsonValuePolicyBuilder→JsonAnyDepthBuilder,Match(a, b)→Path(a, b),ObserveResult→MaskResult.JsonObserverOptionsis a record derived fromObserverOptions.Added
MaskFlags(K9).Mask(MaskTag)with the HMAC hash.Span<char>overloads.Explain.JsonValueRule<TContext>.Deviations from plan 01
release.ymlcannot pass until Core is published.Span<char>allocation budget, and the Http re-audit.Depthflag is set atMaxDepth - 1.Tests: 1228 (net8 + net10). Allocation gate: 0 B, including the tag and hash rules.
Observer-Ref: feat/r1-core