Skip to content

Fix compliance findings in Frends.Regex.IsMatch (net8, metadata, Options/CancellationToken, Success/Error)#29

Merged
jefim merged 3 commits into
mainfrom
copilot/fix-compliance-findings
Jul 23, 2026
Merged

Fix compliance findings in Frends.Regex.IsMatch (net8, metadata, Options/CancellationToken, Success/Error)#29
jefim merged 3 commits into
mainfrom
copilot/fix-compliance-findings

Conversation

Copilot AI commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Resolves multiple compliance scanner findings (metadata, target framework, FT0007, FT0011) in Frends.Regex.IsMatch. Adding Options and CancellationToken parameters is a breaking change, hence the major version bump.

csproj metadata

  • TargetFramework: net6.0net8.0
  • Added <Company>Frends</Company>, <Product>Frends</Product>
  • PackageProjectUrlhttps://frends.com/
  • Version: 1.1.02.0.0

New definitions

  • OptionsThrowErrorOnFailure (default true), ErrorMessageOnFailure
  • ErrorMessage, AdditionalInfo

Task method (FT0007)

Added required Options and CancellationToken parameters:

public static Result IsMatch([PropertyTab] Input input, [PropertyTab] Options options, CancellationToken cancellationToken)

Result class (FT0011)

Added Success (bool) and Error properties. On success: Success=true, Error=null. On handled failure (ThrowErrorOnFailure=false): Success=false, Error populated.

Error handling

Input null-checks still throw ArgumentNullException directly. The regex execution is wrapped in try/catch — cancellation always rethrows; other exceptions either throw or return an error result based on Options.ThrowErrorOnFailure.

…uct/PackageProjectUrl metadata, Options/CancellationToken params, Success/Error result properties
Copilot AI changed the title [WIP] Fix compliance findings in Frends.Regex.IsMatch Fix compliance findings in Frends.Regex.IsMatch (net8, metadata, Options/CancellationToken, Success/Error) Jul 23, 2026
Copilot finished work on behalf of jefim July 23, 2026 05:39
Copilot AI requested a review from jefim July 23, 2026 05:39
InputText = "not empty",
RegularExpression = ""
});
}, DefaultOptions, CancellationToken.None);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use default instead of cancelationtoken.none across these tests

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done — replaced all CancellationToken.None with default across the tests.

@jefim jefim left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot address review comments

/// Custom error message used when ThrowErrorOnFailure is enabled or an error result is returned.
/// Leave empty to use the original exception message.
/// </summary>
/// <example></example>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs better example

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the example to Regex match failed.

/// <summary>
/// Error information, populated when Success is false.
/// </summary>
public Error Error { get; private set; }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs example

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added <example>null</example> to the Error property (it's null on a successful result).

@jefim
jefim marked this pull request as ready for review July 23, 2026 10:54
Copilot finished work on behalf of jefim July 23, 2026 10:56
Copilot AI requested a review from jefim July 23, 2026 10:56
@jefim
jefim merged commit 5dc9487 into main Jul 23, 2026
5 checks passed
@jefim
jefim deleted the copilot/fix-compliance-findings branch July 23, 2026 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants