Skip to content

Replace archived Blazored.FluentValidation with Blazilla - #935

Open
sfmskywalker with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-blazored-fluentvalidation-dependency
Open

Replace archived Blazored.FluentValidation with Blazilla#935
sfmskywalker with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-blazored-fluentvalidation-dependency

Conversation

Copilot AI commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Purpose

Remove the archived, unlisted Blazored.FluentValidation dependency from Studio core and migrate the affected forms to a maintained FluentValidation Blazor wrapper. This also resolves the transitive restore risk for downstream consumers.


Scope

Select one primary concern:

  • Bug fix (behavior change)
  • Refactor (no behavior change)
  • Documentation update
  • Formatting / code cleanup
  • Dependency / build update
  • New feature

If this PR includes multiple unrelated concerns, please split it before requesting review.


Description

Problem

Elsa.Studio.Core exposed Blazored.FluentValidation transitively even though the package is unlisted and upstream is archived. Consumers inherit an effectively unfixable deprecated dependency and may fail restore in environments that disallow unlisted packages.

Solution

  • Dependency swap

    • Replace Blazored.FluentValidation with Blazilla in core package references.
    • Keep FluentValidation-based form behavior without carrying the abandoned package.
  • Form integration update

    • Migrate Labels and Workflows forms from FluentValidationValidator to FluentValidator.
    • Switch submit-time validation to EditContext.ValidateAsync().
  • Async validator correctness

    • Enable AsyncMode="true" on forms backed by validators with async rules so existing uniqueness checks continue to run asynchronously.
  • Central package alignment

    • Bump Microsoft.AspNetCore.Components* and Microsoft.JSInterop patch versions to satisfy the new wrapper’s minimum requirements and avoid NU1605 downgrades.
  • Focused coverage

    • Add integration-style tests around form validation message population and clearing.

Example migration:

<FluentValidator Validator="_validator" AsyncMode="true" />
if (!await _editContext.ValidateAsync())
    return;

Verification

Steps:

  1. Inspect Directory.Packages.props and src/framework/Elsa.Studio.Core/Elsa.Studio.Core.csproj to confirm Blazored.FluentValidation is removed and Blazilla is used instead.
  2. Review the updated Labels/Workflows dialogs to confirm they use FluentValidator and EditContext.ValidateAsync(), with AsyncMode="true" only where async rules exist.
  3. Review src/modules/Elsa.Studio.Workflows.Tests/FluentValidationValidatorTests.cs for coverage of validation message behavior.

Expected outcome:
No project in the change set references Blazored.FluentValidation; affected forms continue using FluentValidation through Blazilla; central package versions remain restore-compatible.


Screenshots / Recordings (if applicable)


Commit Convention

We recommend using conventional commit prefixes:

  • fix: – Bug fixes (behavior change)
  • feat: – New features
  • refactor: – Code changes without behavior change
  • docs: – Documentation updates
  • chore: – Maintenance, tooling, or dependency updates
  • test: – Test additions or modifications

Clear commit messages make reviews easier and history more meaningful.


Checklist

  • The PR is focused on a single concern
  • Commit messages follow the recommended convention
  • Tests added or updated (if applicable)
  • Documentation updated (if applicable)
  • No unrelated cleanup included
  • All tests pass

Copilot AI review requested due to automatic review settings August 3, 2026 19:22

Copilot AI 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 was unable to review this pull request because there is no eligible user to bill. To allow Copilot reviews on bot-authored pull requests, enable direct organization billing in your organization's Copilot settings.

Copilot AI review requested due to automatic review settings August 3, 2026 19:32

Copilot AI 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 was unable to review this pull request because there is no eligible user to bill. To allow Copilot reviews on bot-authored pull requests, enable direct organization billing in your organization's Copilot settings.

Copilot AI changed the title [WIP] Fix Blazored.FluentValidation dependency issue Replace archived Blazored.FluentValidation with Blazilla Aug 3, 2026
Copilot AI requested a review from sfmskywalker August 3, 2026 19:38
@sfmskywalker
sfmskywalker marked this pull request as ready for review August 20, 2026 23:22
@greptile-apps

greptile-apps Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

PR author is not in the allowed authors list.

@sfmskywalker
sfmskywalker requested a balanced review from Copilot August 20, 2026 23:23

Copilot AI 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.

Pull request overview

Copilot reviewed 19 out of 19 changed files in this pull request and generated 4 comments.

Suppressed comments (1)

src/modules/Elsa.Studio.Workflows/Components/WorkflowDefinitionEditor/Components/WorkflowProperties/Tabs/Properties/Sections/Metadata/Metadata.razor:10

  • Once this component supplies its validator, AsyncMode still cannot be paired with the existing OnValidSubmit: Blazor decides to invoke that callback before Blazilla's async uniqueness task completes. A native submit can then update WorkflowDefinition before the duplicate-name result arrives. Route the form through OnSubmit="ValidateForm" (or an equivalent handler that awaits ValidateAsync) instead.
        <FluentValidator Validator="_validator" AsyncMode="true"/>

<DialogContent>
<EditForm EditContext="_editContext" OnValidSubmit="OnValidSubmit">
<FluentValidationValidator @ref="_fluentValidationValidator" Validator="_validator" DisableAssemblyScanning="true"/>
<FluentValidator Validator="_validator" AsyncMode="true"/>
<DialogContent>
<EditForm EditContext="_editContext" OnValidSubmit="OnValidSubmit">
<FluentValidationValidator @ref="_fluentValidationValidator" Validator="_validator" DisableAssemblyScanning="true"/>
<FluentValidator Validator="_validator" AsyncMode="true"/>
<MudText Typo="Typo.overline">@Localizer["Metadata"]</MudText>
<EditForm EditContext="@_editContext" OnValidSubmit="OnValidSubmit">
<FluentValidationValidator @ref="_fluentValidationValidator" Validator="_validator"/>
<FluentValidator Validator="_validator" AsyncMode="true"/>
private async Task ValidateForm()
{
if (!await _fluentValidationValidator.ValidateAsync())
if (!await _editContext.ValidateAsync())
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.

Blazored.FluentValidation dependency (v2.2.0) is unlisted on NuGet and its source repo is archived

3 participants