Frends.JSON.Query: fix compliance findings (net8, static class, CancellationToken, error handling) - #40
Open
MichalFrends1 with Copilot wants to merge 5 commits into
Open
Frends.JSON.Query: fix compliance findings (net8, static class, CancellationToken, error handling)#40MichalFrends1 with Copilot wants to merge 5 commits into
MichalFrends1 with Copilot wants to merge 5 commits into
Conversation
…lationToken, error handling, csproj properties
Copilot
AI
changed the title
[WIP] Fix compliance findings in Frends.JSON.Query
Frends.JSON.Query: fix compliance findings (net8, static class, CancellationToken, error handling)
Jul 31, 2026
Comment on lines
+121
to
+140
| [TestMethod] | ||
| public void QueryShouldReturnErrorResultWhenThrowErrorOnFailureIsFalse() | ||
| { | ||
| var input = new Input() | ||
| { | ||
| Json = jsonString, | ||
| Query = "$..Products[?(@.Price >= 1000)].Name" | ||
| }; | ||
|
|
||
| var options = new Options() | ||
| { | ||
| ErrorWhenNotMatched = true, | ||
| ThrowErrorOnFailure = false, | ||
| }; | ||
|
|
||
| var result = JSON.Query(input, options, CancellationToken.None); | ||
| Assert.IsFalse(result.Success); | ||
| Assert.IsNotNull(result.Error); | ||
| Assert.IsFalse(string.IsNullOrEmpty(result.Error.Message)); | ||
| Assert.IsNotNull(result.Error.AdditionalInfo); |
Contributor
There was a problem hiding this comment.
@copliot instead of this test please create new error handler class same like this one: https://github.com/FrendsPlatform/Frends.Smb/blob/main/Frends.Smb.WriteFile/Frends.Smb.WriteFile.Tests/ErrorHandlerTest.cs
| @@ -0,0 +1,49 @@ | |||
| using Frends.JSON.Query.Definitions; | |||
| using Microsoft.VisualStudio.TestTools.UnitTesting; | |||
Contributor
There was a problem hiding this comment.
use nunit for new tests
Contributor
Author
There was a problem hiding this comment.
Done — ErrorHandlerTests.cs now uses NUnit ([TestFixture]/[Test]/Assert.That). Added NUnit 4.3.2 and NUnit3TestAdapter 5.0.0 packages to the test csproj.
|
|
||
| ## [1.3.0] - 2026-07-31 | ||
| ### Changed | ||
| - The task class is now properly declared as static, as required by Frends task standards. |
Contributor
There was a problem hiding this comment.
remove this note, not important for a user
Contributor
Author
There was a problem hiding this comment.
Removed that line from the CHANGELOG.
MatteoDelOmbra
requested changes
Aug 6, 2026
MatteoDelOmbra
left a comment
Contributor
There was a problem hiding this comment.
@copilot resolve review comments
…GELOG Co-authored-by: MatteoDelOmbra <44415151+MatteoDelOmbra@users.noreply.github.com>
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.
Resolves five task-analyzer findings (FT0004, FT0007, FT0011, FT0015 ×2) plus csproj compliance gaps in
Frends.JSON.Query. Bumps target framework to net8 and version to 1.3.0.csproj
Frends.JSON.Query.csproj:net6.0→net8.0, version1.2.0→1.3.0Frends.JSON.Query.UnitTests.csproj:net6.0→net8.0, added<PackageProjectUrl>and<Product>Frends</Product>(theUnitTestssuffix is not matched by the*.Test*.csprojexclude pattern)Definitions
Options: addedThrowErrorOnFailure(bool, defaulttrue) andErrorMessageOnFailure(string, default"") — FT0015Error(new):Message+AdditionalInfo(Exception)Result: addedErrorproperty; added internal constructor for the failure path — FT0011Task class (
Query.cs)JSONmadestatic— FT0004Querygains aCancellationTokenparameter — FT0007OperationCanceledExceptionis always rethrownThrowErrorOnFailure = true(default, preserves existing behaviour); returned asResult { Success=false, Error=… }whenfalseTests
CancellationToken.NoneQueryShouldThrowIfOptionSetAndFilterMatchesNothingupdated to assertException(error handler wraps the originalJsonException)QueryShouldReturnErrorResultWhenThrowErrorOnFailureIsFalse