Commit graph

6403 commits

Author SHA1 Message Date
lukhipolito-nexxbiz c02484fd4d
Update src/modules/Elsa.Workflows.Core/Activities/SetVariable.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-09 09:40:01 +02:00
lukhipolito-nexxbiz abfaad85cb
Update test/unit/Elsa.Activities.UnitTests/Helpers/ActivityTestHelper.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-09 09:39:07 +02:00
lukhipolito-nexxbiz 2cbfa279c7
Merge pull request #6952 from elsa-workflows/feature/unit-test-suite-suggestions
PR suggestions from Sipke
2025-10-09 08:44:16 +02:00
Sipke Schoorstra b3c1defd3d
Fix incorrect test method name to reflect expected throwing behavior when variable is null in SetVariableTests. 2025-10-08 20:27:18 +02:00
Sipke Schoorstra 8eb2b11f6e
Refactor SetVariable activity: add null safety checks, update variable property to nullable type, and enhance unit tests for edge cases. 2025-10-08 20:23:25 +02:00
lucas.hipolito e6df8ea954 More unit tests for set variable 2025-10-08 14:59:59 +02:00
lucas.hipolito 5bd037928c Helper for isolated activity testing + few SetVariable tests 2025-10-08 14:38:19 +02:00
lucas.hipolito 2fde7ef048 Merge branch 'develop/3.6.0' into feature/unit-test-suite 2025-10-08 09:07:53 +02:00
Sipke Schoorstra bbbf13c58c
Allow tests to run on all events
Remove condition to run tests only on pull requests.
2025-10-07 20:10:38 +02:00
Sipke Schoorstra fe4d74189a
Add coverage enforcement for test projects (#6950)
* Add coverage enforcement for test projects

* Expand GitHub Actions triggers to include additional branch patterns

* Update `coverlet.msbuild` configuration and centralize dependency version management

- Removed inline version specification for `coverlet.msbuild` in `test/Directory.Build.props`.
- Centralized `coverlet.msbuild` version definition in `Directory.Packages.props` for consistency and maintainability.

* Remove `Elsa.Common.Core` unit test project and related test files

* Add Directory.Build.props for test project organization and update property configurations

- Introduced `Directory.Build.props` files for `test/unit` and `test/integration` to define project-specific properties.
- Updated `test/Directory.Build.props` to include new coverage formats and an exclusion for `Elsa.Testing.Shared`.
- Adjusted solution file to link new `Directory.Build.props` files.
- Configured threshold properties for `unit`, `integration`, and `component` test directories.

* Disable coverage collection for performance tests in project file

* Expand GitHub Actions workflow triggers and add PR-specific condition for test job
2025-10-07 19:59:53 +02:00
lucas.hipolito 4a26819ed7 (WIP) Initial context helper + provisional unit tests for setvariable 2025-10-07 15:56:08 +02:00
Sipke Schoorstra fcdb6f5499 Refactor WorkflowDefinitionManager: streamline constructor, remove unused field, and improve consistency in method calls. 2025-10-06 10:33:09 +02:00
Sipke Schoorstra 95b17135a9
Add support for reverting workflow definitions to a specific version and refactor WorkflowDefinitionFilter initialization for consistency 2025-10-05 15:08:42 +02:00
Sipke Schoorstra b52a07f46a
Refactor FlowchartNextActivity tests: reduce unused cases, update switch behaviors, and improve consistency. 2025-10-05 10:51:29 +02:00
Sipke Schoorstra d1051f3194
Remove unused connection definition in FlowchartNextActivity integration test. 2025-10-05 10:41:51 +02:00
Sipke Schoorstra 6847ce5f55
Merge remote-tracking branch 'origin/develop/3.6.0' into develop/3.6.0 2025-10-04 19:34:31 +02:00
Sipke Schoorstra 1ef057068d
Fix typo in AddTriggerPaylodValidator method name across Scheduling, Http, and Runtime modules 2025-10-04 19:34:19 +02:00
Matt 5daff43cac Resolve FlowChart merge errors. 2025-10-03 23:40:23 +01:00
Matt 60d01f8892 Merge remote-tracking branch 'origin/patch/3.5.2' into develop/3.6.0 2025-10-03 22:17:01 +01:00
Sipke Schoorstra c586c690d3
Refactor scheduling feature: remove unused CronParser, improve error handling in ScheduledRecurringTask. 2025-10-03 20:46:29 +02:00
Sipke Schoorstra a375e5613a
Update bookmark payloads to public records for broader accessibility 2025-10-03 20:03:28 +02:00
Matt 32d6f903c5
Resolves Workflow Execution Bodiless Requests Issue. (#6944)
* Resolves workflow execution bodiless requests issue.

Removed content length check when processing JSON requests, relying solely on content type validation. Added a null-check for deserialized requests to handle cases where the request body is missing or invalid, providing a specific error message.

* Refactor JSON request handling in PostEndpoint

Updated to get unit tests to pass.
2025-10-03 19:44:38 +02:00
Sipke Schoorstra eb7a76a8c0
Refactor flowchart token handling and enhance merge mode behavior (#6937)
* Refactor flowchart token handling and enhance merge mode behavior

- Improve token emission, consumption, and scheduling logic.
- Add support for distinct merge modes: None, Converge, Stream, and Race.
- Update `MergeMode` enum documentation to clarify behavior.
- Adjust default merge mode from `Converge` to `None`.

* Add integration tests for implicit join behaviors with None and Converge merge modes

- Added workflows `fork-decision-join-none.json` and `fork-decision-join-converge.json` to test scenarios.
- Implemented `ForkDecisionJoinTests` to validate execution logic based on merge modes.
- Updated project file to include new workflows for testing.

* Refactor `ImplicitJoins` tests to `JoinBehaviors` and add test for `WaitAll` join mode

- Renamed `ImplicitJoins` test namespace and workflows to `JoinBehaviors`.
- Added `fork-decision-join-waitall.json` workflow to test the `WaitAll` merge mode.
- Refactored `ForkDecisionJoinTests` with reusable logic for execution and assertions.
- Updated project file to include the new workflow for testing.

* Refactor flowchart token handling for improved clarity and efficiency

- Simplified token consumption and filtering logic.
- Removed default port fallback for active outbound connections.
- Improved readability and maintainability of token handling in merge mode scenarios.

* Refactor tests and workflows for `JoinBehaviors`

- Transitioned connections to inline object initializers for simplicity.
- Updated workflow paths in `ParallelJoinCompletesTests` and `JoinRunsOnceTests` to match `JoinBehaviors`.
- Adjusted connection definitions in `ImplicitLoopWorkflow` for consistency.

* Format JSON workflow files

* Add ADR for explicit merge modes in flowchart joins

- Introduced `MergeMode` enum with modes: None, Converge, Stream, and Race.
- Documented motivation, decision, and implementation details.
- Updated solution to include new ADR file.
2025-10-01 15:01:33 +02:00
Sipke Schoorstra c6974a4e34
Improves Flowchart activity robustness (#6938)
* Bump workflow base version and branch references to `3.5.2`.

* Refactor flowchart tests and `Flowchart` activity for improved readability and consistency, alongside minor code cleanup.

* Adds comment for clarity.

Adds a comment to explain the continue statement within the flowchart execution logic.
This improves code readability and maintainability.

* Refactor flowchart test to remove unused cases, update switch behavior, and adjust expected output for improved consistency and clarity.
2025-10-01 15:01:22 +02:00
Sipke Schoorstra d18809baa1
Bump workflow base version and branch references to 3.5.2. 2025-09-30 20:12:48 +02:00
Sipke Schoorstra 425e8fed3d
Add necessary using statements in VariableTypeDefinitionProvider.cs to support workflow management options and annotations 2025-09-29 19:27:19 +02:00
Sipke Schoorstra 767c3018c4
Merge remote-tracking branch 'origin/patch/3.5.1' into develop/3.6.0 2025-09-29 10:22:43 +02:00
Sipke Schoorstra 3895f029da
Update dependency versions across multiple project files
Upgraded various dependencies including Elsa, ElsaStudio, ElsaExtensions, MicrosoftVersion, and Resilience to their latest preview versions. These changes ensure the project stays up-to-date with the latest improvements and bug fixes.
2025-09-28 20:51:34 +02:00
Sipke Schoorstra d56e9cd852
Add integration tests for migration in Elsa.Alterations module
- Created a new `Elsa.Alterations.IntegrationTests` project.
- Added `MigrationTests` to validate workflows migration from version 1 to 2.
- Updated solution file to include the new integration tests project.
2025-09-28 20:44:55 +02:00
Sipke Schoorstra 8573f93d81
Update workflow names and Docker image tags in GitHub Actions YAML files 2025-09-27 20:41:42 +02:00
Sipke Schoorstra ff1f0833ad
Restore EF Core persistence layer (#6931)
* Restore EF Core persistence layer

Originally, we had moved EF Core to the extensions repo, but in practice this turned out to be rather impractical when debugging elsa-core, given that we would lose all of the state (workflow definitions, instances, etc.) across application restarts.

* Integrate PostgreSQL support into EF Core persistence and enhance BlobStorage workflows provider setup.
2025-09-27 20:39:18 +02:00
Sipke Schoorstra d0e7657998
Update nullable argument defaults and enhance ForEach tests with additional edge cases. (#6928)
* Update nullable argument defaults and enhance ForEach tests with additional edge cases.

* Refactor input evaluation and JavaScript evaluator for clarity and consistency.

* Update src/modules/Elsa.Workflows.Core/Extensions/ActivityExecutionContextExtensions.InputEvaluation.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-09-27 17:55:40 +02:00
Sipke Schoorstra 003e88c4da
Update nullable argument defaults and enhance ForEach tests with additional edge cases. (#6928)
* Update nullable argument defaults and enhance ForEach tests with additional edge cases.

* Refactor input evaluation and JavaScript evaluator for clarity and consistency.

* Update src/modules/Elsa.Workflows.Core/Extensions/ActivityExecutionContextExtensions.InputEvaluation.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-09-27 17:50:19 +02:00
Sipke Schoorstra bc4e4d60ee
Bump ElsaExtensionsVersion to 3.5.1-preview.148. 2025-09-27 11:42:04 +02:00
Sipke Schoorstra 806bb65640
Bump Elsa Studio version to 3.5.1-preview.1231 and introduce ElsaExtensionsVersion property. Adjust package references and update Elastic.Clients.Elasticsearch version. 2025-09-27 11:10:52 +02:00
Sipke Schoorstra b2231b5c20
Update Docker image references in GitHub workflows to use unified versioning scheme (v3-5). 2025-09-27 10:43:17 +02:00
Sipke Schoorstra 56884a132a
Simplify GitHub workflow names for consistency and clarity. 2025-09-27 10:41:20 +02:00
Sipke Schoorstra 7b84bc8237
Add initial appsettings.json configuration for logging and Elsa server setup
- Introduced logging configuration with default, system, and Microsoft log levels.
- Added Elsa server URL and hosting base path settings.
2025-09-27 10:39:23 +02:00
Sipke Schoorstra bcf19ab23f
Bump Elsa Studio version to 3.5.1 and update Docker image/tag references. 2025-09-27 10:33:10 +02:00
Sipke Schoorstra 1bf51d7f82
Remove unused docker-compose-datadog+otel-collector.yml reference from solution file. 2025-09-25 22:52:19 +02:00
Sipke Schoorstra e5f52402ed
Add Elsa.Scheduling module and enable scheduling support in Elsa.Server.Web. 2025-09-25 22:49:32 +02:00
Sipke Schoorstra 918caaa09a
Removed unused ForEach activity namespace from WorkflowServer. 2025-09-25 21:01:28 +02:00
Sipke Schoorstra f24b4394cf
Add WorkflowStateCommitted notification support and update state handling logic
- Introduced `WorkflowStateCommitted` notification to encapsulate workflow execution context, state, and instance details.
- Updated `DefaultCommitStateHandler` to publish `WorkflowStateCommitted` via `IMediator`.
- Adjusted `DispatchWorkflowExtensions` to use `WorkflowStateCommitted` for workflow completion.

Updates KubernetesClient and Microsoft packages (#6917)

* Remove Proto.Cluster.Kubernetes dependency due to vulnerability

- Temporarily removed `Proto.Cluster.Kubernetes` package and provider integration because of a vulnerability in its dependency (https://avd.aquasec.com/nvd/2025/cve-2025-9708).
- Adjusted related cluster provider and remote configuration logic.
- Updated `PortAttribute` default parameter for clarity.

* Revert "Remove Proto.Cluster.Kubernetes dependency due to vulnerability"

This reverts commit 0720d970968e4f7338825407258b34ddffb1d2a4.

* Add KubernetesClient package and update MicrosoftVersion to 9.0.9

- Added `KubernetesClient` package to the project dependencies.
- Updated `MicrosoftVersion` to `9.0.9` in `Directory.Packages.props`.
Update Polly packages

- Bump Polly and Polly.Extensions package versions to 8.6.3.

Update `Microsoft.AspNetCore.Authorization` to use `MicrosoftVersion` property

Ensure Docker images ship CA trust and add TLS smoke tests (#6918)

Remove TlsSmoke project and related solution references

- Deleted `TlsSmoke` project files (`Program.cs` and `TlsSmoke.csproj`).
- Removed `TlsSmoke` project reference from the solution file (`Elsa.sln`).

Add comprehensive Copilot coding agent instructions for repository onboarding (#6920)

* Initial plan

* Add comprehensive .github/copilot-instructions.md with validated build instructions

Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>
Add ForEach tests, introduce asynchronous workflow runner and enhance workflow events. (#6926)

* Introduce asynchronous workflow runner and enhance workflow events.

- Added `AsyncWorkflowRunner` to enable asynchronous workflow execution and result tracking.
- Introduced new event arguments, such as `ActivityExecutedEventArgs` and `WorkflowStateCommittedEventArgs`.
- Expanded `WorkflowEvents` class to include `ActivityExecuted`, `ActivityExecutedLogUpdated`, and `WorkflowStateCommitted` events.
- Refactored event arguments into the `Elsa.Testing.Shared.EventArgs` namespace.
- Enhanced tests with `AsyncWorkflowRunner` and new event-driven workflow scenarios.

* Refactor event argument classes to unify namespace and simplify inheritance

* Add shared component DotSettings file to support namespace exclusions
Refactor `WaitAsync` call in `DispatchWorkflowsTests` to remove unnecessary generic type.
2025-09-25 20:58:21 +02:00
Sipke Schoorstra 1beb5822ca
Merge remote-tracking branch 'origin/patch/3.5.1' into patch/3.5.1 2025-09-25 20:54:58 +02:00
Sipke Schoorstra 6e6a66e3f5
Add WorkflowStateCommitted notification support and update state handling logic
- Introduced `WorkflowStateCommitted` notification to encapsulate workflow execution context, state, and instance details.
- Updated `DefaultCommitStateHandler` to publish `WorkflowStateCommitted` via `IMediator`.
- Adjusted `DispatchWorkflowExtensions` to use `WorkflowStateCommitted` for workflow completion.

Updates KubernetesClient and Microsoft packages (#6917)

* Remove Proto.Cluster.Kubernetes dependency due to vulnerability

- Temporarily removed `Proto.Cluster.Kubernetes` package and provider integration because of a vulnerability in its dependency (https://avd.aquasec.com/nvd/2025/cve-2025-9708).
- Adjusted related cluster provider and remote configuration logic.
- Updated `PortAttribute` default parameter for clarity.

* Revert "Remove Proto.Cluster.Kubernetes dependency due to vulnerability"

This reverts commit 0720d970968e4f7338825407258b34ddffb1d2a4.

* Add KubernetesClient package and update MicrosoftVersion to 9.0.9

- Added `KubernetesClient` package to the project dependencies.
- Updated `MicrosoftVersion` to `9.0.9` in `Directory.Packages.props`.
Update Polly packages

- Bump Polly and Polly.Extensions package versions to 8.6.3.

Update `Microsoft.AspNetCore.Authorization` to use `MicrosoftVersion` property

Ensure Docker images ship CA trust and add TLS smoke tests (#6918)


Remove TlsSmoke project and related solution references

- Deleted `TlsSmoke` project files (`Program.cs` and `TlsSmoke.csproj`).
- Removed `TlsSmoke` project reference from the solution file (`Elsa.sln`).

Add comprehensive Copilot coding agent instructions for repository onboarding (#6920)

* Initial plan

* Add comprehensive .github/copilot-instructions.md with validated build instructions

Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>
Add ForEach tests, introduce asynchronous workflow runner and enhance workflow events. (#6926)

* Introduce asynchronous workflow runner and enhance workflow events.

- Added `AsyncWorkflowRunner` to enable asynchronous workflow execution and result tracking.
- Introduced new event arguments, such as `ActivityExecutedEventArgs` and `WorkflowStateCommittedEventArgs`.
- Expanded `WorkflowEvents` class to include `ActivityExecuted`, `ActivityExecutedLogUpdated`, and `WorkflowStateCommitted` events.
- Refactored event arguments into the `Elsa.Testing.Shared.EventArgs` namespace.
- Enhanced tests with `AsyncWorkflowRunner` and new event-driven workflow scenarios.

* Refactor event argument classes to unify namespace and simplify inheritance

* Add shared component DotSettings file to support namespace exclusions
Refactor `WaitAsync` call in `DispatchWorkflowsTests` to remove unnecessary generic type.
2025-09-25 20:54:38 +02:00
Sipke Schoorstra 431e175d45
Refactor WaitAsync call in DispatchWorkflowsTests to remove unnecessary generic type. 2025-09-24 20:39:31 +02:00
Sipke Schoorstra bdfbd0886f
Add ForEach tests, introduce asynchronous workflow runner and enhance workflow events. (#6926)
* Introduce asynchronous workflow runner and enhance workflow events.

- Added `AsyncWorkflowRunner` to enable asynchronous workflow execution and result tracking.
- Introduced new event arguments, such as `ActivityExecutedEventArgs` and `WorkflowStateCommittedEventArgs`.
- Expanded `WorkflowEvents` class to include `ActivityExecuted`, `ActivityExecutedLogUpdated`, and `WorkflowStateCommitted` events.
- Refactored event arguments into the `Elsa.Testing.Shared.EventArgs` namespace.
- Enhanced tests with `AsyncWorkflowRunner` and new event-driven workflow scenarios.

* Refactor event argument classes to unify namespace and simplify inheritance

* Add shared component DotSettings file to support namespace exclusions
2025-09-24 20:06:00 +02:00
Copilot 54c8a010fe
Add comprehensive Copilot coding agent instructions for repository onboarding (#6920)
* Initial plan

* Add comprehensive .github/copilot-instructions.md with validated build instructions

Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>
2025-09-19 21:08:54 +02:00
Sipke Schoorstra 67fb43e0ba
Remove TlsSmoke project and related solution references
- Deleted `TlsSmoke` project files (`Program.cs` and `TlsSmoke.csproj`).
- Removed `TlsSmoke` project reference from the solution file (`Elsa.sln`).
2025-09-19 12:07:13 +02:00
Sipke Schoorstra 42ac08c575
Ensure Docker images ship CA trust and add TLS smoke tests (#6918) 2025-09-19 11:57:30 +02:00