* Add support for activity output testing
Removed obsolete test workflows and updated the If activity tests to align with simplified testing practices. Introduced `GetActivityOutput` extension for retrieving activity outputs from workflow results. Refactored related APIs to simplify execution flow and unified cancellation token handling in service methods.
* Remove unused Parlot.Fluent namespace in IfTests.cs
This commit removes an unused "using" directive for the Parlot.Fluent namespace in the IfTests.cs file. Cleaning up unused references helps maintain code clarity and reduces potential confusion.
Updated `_linkedTokenSource` initialization to allow null values and improved string field handling by applying `NullIfEmpty()` for `CorrelationId`, `TriggerActivityId`, and `ParentWorkflowInstanceId`. These changes ensure proper null-state management and eliminate potential discrepancies in downstream operations.
Replaced `default` with `null` for optional parameters across several classes to improve clarity and consistency. This change aligns with typical .NET conventions and ensures more predictable behavior when handling optional arguments.
Include release candidate (rc/*) branches in the condition to assign the "preview" package prefix. This ensures consistent versioning for branches intended for pre-production releases.
* Enable DbContext pooling and refactor DI scopes
Added support for using DbContext pooling with a configurable option. Refactored to use scoped service providers for better isolation and lifecycle management. Updated persistence feature base to integrate sensitive data logging and warning configurations.
* Update package management and Elsa Studio version references
Centralized package versioning remains enabled, while unused package references and conditional groups for specific .NET targets are removed for simplification. Elsa Studio version is upgraded from 3.3.0-rc4 to 3.4.0-rc1.
* Simplify DbContextOptions setup logic
Removed conditional compilation and unused code to streamline the DbContextOptions configuration. This improves maintainability and ensures consistent behavior across frameworks. Sensitive data logging is no longer explicitly enabled here.
* Update workflow to check for patch version 3.3.3
Revised the GitHub Actions workflow to detect the correct patch branch, updating from version 3.3.2 to 3.3.3. This ensures compatibility with the latest release process.
* Refactor WebhooksFeature to streamline configuration.
Simplified the configuration of sinks, sources, and HTTP clients by using direct actions instead of service-level options. Updated Apply method to finalize configurations and added notification handlers for better extensibility. Improved code readability and maintainability by consolidating logic and removing unnecessary dependencies.
* Update base_version in GitHub Actions workflow
Bump the base_version from 3.3.2 to 3.3.4 in the packages workflow file. This ensures compatibility and uses the latest base version for package management.
* Update release branch check to target patch 3.3.4
Modified the GitHub Actions workflow to check for the `patch/3.3.4` branch instead of `patch/3.3.3` during release events. This ensures compatibility with the latest patch branch in the release process.
* Handle conversion of enumerables to arrays in ObjectConverter (#6508)
* Handle conversion of enumerables to arrays in ObjectConverter
Added functionality to convert enumerables to arrays when the target type is an array. The implementation ensures each item is properly cast to the target array's element type and then added to the resulting array.
* Add unit test for converting object array to double array
This commit introduces a new test ensuring the proper conversion of an object array of doubles to a double array. It verifies both the validity of the conversion and that the result is not null.
* Update base version to 3.3.5 in workflow configuration
Bump the `base_version` from 3.3.4 to 3.3.5 in the GitHub Actions workflow file. Adjust the matching branch reference to correspond with the updated version.
* Add V3.4 migration with schema updates and new column
Introduces Migration V3_4 to modify WorkflowInstances by adding the IsExecuting column. Updates Entity Framework migration to dynamically handle schema changes across tables. Ensures improved compatibility and extendability within the database layer.
* Refactor Dapper migration execution and update database schema. (#6519)
* Refactor migration execution and update database schema.
Replaced RunMigrationsHostedService with RunMigrationsStartupTask using IStartupTask for improved lifecycle management. Updated DapperMigrationsFeature to use the new startup task. Added a new "SerializedProperties" column to ActivityExecutionRecords and ensured proper schema adjustments during migrations.
* Add TenantId column to BookmarkQueueItems table
This commit introduces a nullable TenantId column to the BookmarkQueueItems table. The change ensures better multi-tenancy support by allowing tenant-specific data segregation.
The datadog compose file was removed from the solution as it is no longer needed. Additionally, the GitHub workflow was updated to reference the "rc/3.4.0" branch instead of "main" for the release process.
This update includes the 'rc/*' branch pattern to the workflow triggers in the packages.yml file. It ensures workflows are triggered for release candidate branches, aligning with the project's branching strategy.
* Catch exceptions and log instead of crashing
Modified both WorkflowInstance and WorkflowDefinition state loading to prevent throwing exceptions if the state fails to load successfully.
Also modified the CleanupJob to catch exceptions thrown by cleaning up and logging as errors and continuing instead of crashing.
Fixes 6473
* Use LogError instead of LogWarning for deserialization failure.
Updated the log level to LogError when workflow definition state deserialization fails. This change ensures better visibility and prioritization of critical issues during state handling.
---------
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
* Handle conversion of enumerables to arrays in ObjectConverter
Added functionality to convert enumerables to arrays when the target type is an array. The implementation ensures each item is properly cast to the target array's element type and then added to the resulting array.
* Add unit test for converting object array to double array
This commit introduces a new test ensuring the proper conversion of an object array of doubles to a double array. It verifies both the validity of the conversion and that the result is not null.
The tags "activity.incidents" and "workflow.incidents" were removed as they are unnecessary and provide no additional value. This change simplifies the middleware implementation while retaining essential telemetry data.
The `SetStatus(ActivityStatusCode.Ok)` calls were unnecessary as the default behavior already sets the appropriate status. This cleanup simplifies the code and avoids redundant operations, improving maintainability.
Replaced `default!` with `null` for input property initializations to improve clarity and consistency. Removed an unused namespace import from `IErrorSpanHandler.cs` to clean up the codebase.
Added explicit handling for null values in varbinary columns by applying a `CAST(NULL AS varbinary(max))` operation. This ensures proper value insertion and avoids potential type errors. Cleaned up unnecessary comments and minor whitespace inconsistencies for improved readability.
Added explicit handling for null values in varbinary columns by applying a `CAST(NULL AS varbinary(max))` operation. This ensures proper value insertion and avoids potential type errors. Cleaned up unnecessary comments and minor whitespace inconsistencies for improved readability.
Introduce a new docker-compose configuration to integrate Datadog and OpenTelemetry with services like PostgreSQL, RabbitMQ, Redis, and Elsa. Updated the Datadog API key in an existing compose file for security purposes. This setup enables detailed monitoring, tracing, and metrics collection for development environments.
Introduced `StartNewTrace` input to workflows and updated OpenTelemetry middleware to support initiating new trace contexts. This helps improve trace isolation and linking when desired, enhancing observability during workflow execution.
This commit eliminates unused status checks ("running" and "pending") from OpenTelemetry tracing middlewares. The changes simplify the codebase and improve maintainability by removing unnecessary logic.
Introduce `WorkflowExecutionState` to encapsulate execution state changes for workflows. This ensures proper handling of execution flags during the lifetime of the state object and resets them upon disposal.
Introduce `EnterExecution` method to manage activity execution state using a `using` block for cleaner and safer resource handling. Removed manual flags for tracking execution state, streamlining workflow logic and improving maintainability.
Introduced new span tags for activities and workflows to enhance trace analysis. Optimized error handling in activity tracing by selecting the first applicable handler. Removed unused manual tracing configuration and commented out console exporters in server setup.
Introduce `Order` property and `CanHandle` method in `IErrorSpanHandler` to enable prioritized and conditional processing of error spans. Update handler implementations to utilize these properties and streamline logic. This enhances flexibility and improves the extensibility of error span handling.
Enhanced error status to include detailed message when the workflow is faulted, providing better context in logs. Fixed the retrieval of exception type by replacing `GetType()` with `.Type` for improved accuracy in incident tagging.
Added and updated multiple package references, including OpenTelemetry, Datadog.Trace.Bundle, and various Microsoft.Extensions libraries. This ensures compatibility with the latest dependencies and introduces enhanced features for resilience and tracing.