Repository navigation
[Images] Read a non-object .NET release index as invalid response - #589
Merged
Merged
Conversation
|
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.



Pull Request
📖 Description
A .NET release index whose root is not a JSON object (an array, string, number,
true,falseornull) madeDotNetReleaseMetadataServicethrowInvalidOperationException, which was reported asunexpected error, while the Docker Engine, registry and Docker Hub clients answerinvalid responsefor the same body. The index is now parsed withRemoteJsonDocument.ParseObjectAsync, so a non-object root and a string that does not decode both readinvalid response. An entry ofreleases-indexthat is not a JSON object is left out, as every other client does, instead of failing the whole index. This is a bug fix; no message, log event or API member is added.🎫 Issues
unexpected error#587💬 Reviewer Notes
The production change is two statements in
LoadIndexAsync(src/DockerUpdateGuard/Images/DotNetReleaseMetadataService.cs). One trade-off is recorded in 0076: a string that does not decode in a field the service never reads now fails the whole index, where before it was harmless. Area documentsintegration-failures.md,base-images.mdandtelemetry.mdare updated.📑 Test Plan
Unit tests in
DotNetReleaseMetadataServiceTests.cs: a non-object root (six kinds) answersinvalid responseand logs the fixed refusal (AC1), an undecodable string in a read and an unread field answersinvalid response(AC2), and a non-object entry is left out beside a valid one (AC3). The new tests failed on the old code. Coverage of the changed lines is 100 % (3/3 lines, 2/2 conditions).✅ Checklist
.squad/stack.md, and the Analyzer gate reports no diagnostic in a changed file..squad/stack.mdpasses (new or changed production code with the branch conditions its report records, line coverage overall).README.md,ARCHITECTURE.md) and the area document of every changed behavior to reflect my changes..squad/stack.mdprescribes.breaking-changeand says so in the Description.csharp.instructions.mdare followed.⏭ Next Steps
None.