Switch workflows from tracking 'patch/3.2.x' branch to 'main', and update Docker image tags from 'v3-2-0-rc3' to 'v3-3-0-preview'. This ensures the latest changes are correctly integrated and deployed.
Updated Dockerfile paths to reflect 'apps' directory structure, removed redundant XML comments, and modified methods in WorkflowDefinitionExtensions to use FindWorkflowGraphAsync for consistent workflow retrieval.
Changed the target branch from 'main' to 'patch/3.2.x' in the workflow YAML files. Updated Docker image tags to specific version '3.2.0-rc3' for both elsa-server and elsa-studio.
Switched ElsaStudio package versions to use a property variable for easier management and consistency. Also, adjusted the YAML workflow to tag Docker images with the specific version 3.2.0-rc3.
Changed the fallback version in the GitHub actions workflow from 3.2.0-rc2 to 3.2.0-rc3 to ensure the appropriate versioning reflects the latest release candidate. This keeps the versioning consistent and up-to-date.
Changed the grep pattern from 'main' to 'origin/patch/3.2.x' in the release workflow. This ensures the script correctly identifies the relevant branch during the release process.
A new environment variable `base_version` has been added to set the base version for packages in the GitHub workflow. This change allows for more flexible versioning of packages as it replaces the previously hardcoded `3.2.0` base version.
The commit modifies the branch name reference for the specific condition in the GitHub Actions workflow defined in packages.yml. Instead of checking for the presence of '3.1.3', the script now looks for the 'main' branch.
Uncommented the lines related to setting up JDK 17, installing SonarScanner for .NET and Coverlet, and beginning and ending SonarCloud analysis. This change reinstates these necessary tools and processes in our Github Actions package workflow.
This commit disabled the setup of JDK 17, installation of SonarScanner for .NET and Coverlet, and the start and end of SonarCloud analysis in the .github/workflows/packages.yml workflow. These changes would allow the workflow to compile, test, and pack without performing the SonarCloud analysis.
* bumped versions to fix dependency vulnerabilities (#5256)
* Update patch version in GitHub workflows
The version number used in the branch checking step of the GitHub workflows has been updated. Instead of scanning for the branch containing the patch version 3.1.2, it now scans for the branch that contains version 3.1.3. This change is aligned with the updated product version.
* Update git branch grep pattern in workflow file
The git grep pattern has been corrected to properly identify tagged versions in the GitHub Actions workflow. The correction ensures that the workflow script fetches the right branches as per the release tag instead of patch.
* Update grep command in packages workflow
The grep command used in the 'packages.yml' GitHub workflow was previously looking for the exact 'refs/tags/3.1.3' string. This commit simplifies the command by making it only look for '3.1.3'. This adjustment will streamline the process and potentially prevent issues with branch recognition.
* Update package versions and refactor code for Elasticsearch and JavaScript modules
Updated versions of numerous packages in the Directory.Packages.props file to their latest stable releases. This includes updates to Elasticsearch, JavaScript, and MongoDB packages among others. Additionally, refactored parts of the code in the WorkflowInstanceConfiguration and JintJavaScriptEvaluator within the Elasticsearch and JavaScript modules, respectively, to improve index management and script preparation. The WorkflowInstanceStore also saw a minor adjustment.
---------
Co-authored-by: Steve Taylor <stevetayloruk@users.noreply.github.com>
* Add conditional index triggers in workflow populator
The trigger indexing in the workflow populator is now conditional. A boolean parameter has been added to the PopulateStoreAsync and AddAsync methods to determine whether to index triggers or not. Additionally, some code cleanups and refactoring have been made for efficient and cleaner code.
* Update method call in DefaultWorkflowRegistry
The method `AddAsync` in `DefaultWorkflowRegistry` has been updated to include a new first parameter set to true. This change aligns with recent modifications to the `AddAsync` method signature, ensuring proper function execution.
* Add new branch triggers to GitHub workflow
The updated GitHub workflow now includes triggers for branches with 'feat/*', 'enh/*', 'perf/*', 'hotfix/*', and 'chore/*' prefixes. This is to ensure that the workflow runs not only for the main, feature, issue, bug, enhancement, patch, and fix branches, but also on all new branches, improving coverage and visibility on all changes.
* Add FindByIdAsync method to WorkflowInstanceManager
This commit introduces a new method, FindByIdAsync, to the WorkflowInstanceManager service. This method fetches a WorkflowInstance using its Id. Also, an interface declaration for the new method is added to IWorkflowInstanceManager.
* Refactor workflow definitions and add indexTriggers parameter
The code for creating workflow definition filters has been refactored for brevity. Additionally, two sets of overloaded methods named `PopulateStoreAsync` and `AddAsync` were added to "IWorkflowDefinitionStorePopulator" and implemented in "DefaultWorkflowDefinitionStorePopulator". These methods allow specifying whether triggers should be indexed.
* Refactor WorkflowDefinitionActivity code
The refactoring is focused on an improved way of finding and passing ActivityDescriptor within WorkflowDefinitionActivity class. Previously, the service provider was passed to the DeclareInputAsVariables and DeclareOutputAsVariables methods, leading to a less readable and harder to maintain code. Now, we pass the ActivityDescriptor directly, making the code easier to understand and modify.
* Update PolymorphicObjectConverter exception handling
Fixes have been applied to the PolymorphicObjectConverter by adding the handling of TargetException. Additionally, the System.Reflection namespace has been included, and the addSetMethod invocation for the HashSet has been streamlined for better readability and performance.
* Remove unnecessary whitespace in PersistWorkflowExecutionLogMiddleware
This change simply removes an unneeded line of whitespace in the corresponding Middleware file. This change is consistent with the goal of maintaining clean and easy-to-read code.
* Refactor MassTransitWorkflowDispatcher and add new methods
Systematic refactor of the MassTransitWorkflowDispatcher class which initially focused on restructuring the DispatchAsync methods. New methods have been added that deal specifically with triggering and bookmarking workflows thus enhancing the readability of the code while also improving its autonomous function. The logging for non-found workflows has been improved as well.
* Update event handler names in Workflow cache eviction
Evicting the cache prior to triggers being indexed fixes a bug where publishing workflow changes would not result in new triggers being found.
* Update Async calls and mark obsolete messages
The commit adjusts calls to AddAsync in DefaultWorkflowRegistry and DispatchAsync in DefaultWorkflowInbox to improve readability. Also, it marks DispatchResumeWorkflows and DispatchTriggerWorkflows in the Elsa.MassTransit.Messages namespace as obsolete, indicating their pending removal in future releases.
* Refactor workflow dispatch code to a separate method
The changes remove duplication and improve readability by extracting the code responsible for dispatching a workflow into a separate method called DispatchWorkflowAsync. This method creates a workflow instance, gets the send endpoint, and then sends the message.
* Refactor exception handling in PolymorphicObjectConverter
This commit simplifies the two separate catch blocks for NotSupportedException and TargetException into a single block using the new 'or' pattern in C#. It also makes minor adjustments to improve the clarity and readability of the code relating to the 'addSetMethod' invocation.
* Update src/modules/Elsa.MassTransit/Services/MassTransitWorkflowDispatcher.cs
Co-authored-by: raymonddenhaan <155616759+raymonddenhaan@users.noreply.github.com>
* Fix an attempt to dispatch bookmark ID instead of workflow instance ID
The MassTransitWorkflowDispatcher.cs file is updated to improve readability and clarity. This includes changing the way bookmark and trigger filter objects are initialized, by breaking down the single-line initialization into multiple lines. Additionally, some logic has been updated in the DispatchBookmarksAsync function for better handling of workflow instance properties and input merging.
* Add logging to SendHttpRequestBase
The SendHttpRequestBase activity in the Elsa.Http module is updated to utilize the ILogger service. This extension enables the capture of HttpRequestException and TaskCanceledException events and logs their warnings, providing insight into potential issues during HTTP request sending.
---------
Co-authored-by: raymonddenhaan <155616759+raymonddenhaan@users.noreply.github.com>
* Replace IServiceScopeFactory with IServiceProvider in WorkflowRunner
Unused dependencies were removed from the workflow runner service. The IServiceScopeFactory was replaced with IServiceProvider to better handle the creation and deletion of service scopes, resulting in cleaner code with less manual scope management. Microsoft.Extensions.DependencyInjection and System.Diagnostics.CodeAnalysis were removed as they were no longer necessary.
* Refactor WorkflowDefinitionActivity to use WorkflowDefinitionService
The WorkflowDefinitionActivity class has been refactored to make use of the WorkflowDefinitionService instead of the WorkflowDefinitionStore. This fixes#5222 by ensuring the same activity instances are used in the graph model of the workflow execution context.
* Add workflow filtering and caching functionality
Added methods to `WorkflowDefinitionService` to find workflow definitions and workflows using filter criteria. A key generation method for caching filtered workflows was also added to `WorkflowDefinitionCacheManager`. The implementation includes generating a hash of the filter parameters and using this hash as a cache key, providing efficient caching functionality for filtered searches.
* Refactor TriggerIndexer to handle only ITrigger activities
The code in TriggerIndexer has been refactored to deal specifically with ITrigger activities, streamlining its behavior. Removed code related to handling non-ITrigger activities and simplified the workflow creation process. The extraction of "startable" nodes now directly filters and casts to ITrigger, reducing complexity and increasing readability.
* Update caching service to support filter-based search
The CachingWorkflowDefinitionService has been updated to support workflow definition and workflow search based on filter criteria. The update also includes change of class scope from public to internal. Further, it resolves the missing reference by switching from Elsa.Caching.Contracts to Elsa.Caching.
* Optimize Elsa project imports and use explicit cache variable names
This commit removes superfluous import references, relocates the 'IChangeTokenSignaler' contract into the 'Elsa.Caching' namespace, and replaces ambiguous 'cache' variable names with more explicit 'memoryCache' across several files. Additionally, new package references have been added and access modifiers have been changed to improve encapsulation. Cleanup enhances readability and maintainability of the codebase.
* Add .DotSettings file to Elsa.Caching module
A new .DotSettings file has been added to the Elsa.Caching module. This file is used for namespace configuration, specifically to skip the "contracts" folder in code inspections.
* Update workflow interfaces to support filter queries
The update extends `IWorkflowDefinitionCacheManager` and `IWorkflowDefinitionService` interfaces. Functions are added to allow creating filter cache keys and finding workflow definitions and workflows using a new `WorkflowDefinitionFilter`. This enhances querying flexibility by enabling filtered searches.
* Add WorkflowDefinitionVersionId to WorkflowTriggerEqualityComparer
A new property, WorkflowDefinitionVersionId, has been added to the object being serialized in WorkflowTriggerEqualityComparer. This change allows for a more accurate comparison between workflow triggers, considering not just the workflow definition ID but also its version.
* Update service registration types in WorkflowsFeature
Changed the registration type for both IHasher and IBookmarkHasher services from Scoped to Singleton in the workflows feature configuration. This alteration aims to improve application performance and manage service lifetimes more efficiently.
* Remove Open.Linq.AsyncExtensions dependency
The Open.Linq.AsyncExtensions package reference was removed across the project. The usage within the CachingWorkflowDefinitionStore was updated accordingly to maintain functionality.
* Move System.Linq.Dynamic.Core package reference
The System.Linq.Dynamic.Core package reference was moved from the Directory.Build.props file to the Elsa.Workflows.Management.csproj file. This change reflects the specific dependency of the Elsa.Workflows.Management module on System.Linq.Dynamic.Core, without impacting other modules.
* Implement caching for HTTP workflows
This update introduces caching mechanisms for HTTP workflows, which significantly improves their performance. The changes involve creating a `CacheManager` and `CachingHttpWorkflowLookupService`, and modifying some existing components to use the new caching mechanism. Additionally, the `HttpWorkflowsCacheManager` was renamed to `HttpWorkflowsCacheInvalidationManager` to better reflect its role.
* Refactor cache management across modules
This commit refactor the cache management across various modules. The 'ICacheManager' interface now includes methods for triggering and getting change tokens, and the 'HttpWorkflowsCacheInvalidationManager' has been renamed to 'HttpWorkflowsCacheManager'. The caching functionality in 'WorkflowDefinitionService' and other similar services have been updated to use these new methods, improving consistency and maintainability.
* Enable caching in Elsa.Server.Web
The "useCaching" variable has been set to true to enable caching. Simultaneously, the method name "UseCachingStores" has been refactored to "UseCache". Conditional statements have been added to check the "useCaching" variable before invoking caching.
* Rename method UseCaching to UseCache
In the Elsa.Server.Web and Elsa.Http project files, the method UseCaching has been renamed to UseCache. This modification is aimed at bridging naming inconsistencies and maintaining naming standards across the application.
* Update HttpCacheFeature class description
The class summary for HttpCacheFeature has been revised. Originally, it stated that the class was used for installing services related to HTTP services and activities, but it actually focuses more on HTTP caching.
* Remove unused Configure method from HttpCacheFeature
The Configure method in HttpCacheFeature was found to be redundant as it wasn't doing any significant work or contributing to any functionality. It has therefore been removed to clean up the code and avoid confusion.
* Add 'bug/*' to workflow triggers
This commit includes 'bug/*' to the list of triggers in our GitHub Actions workflow. Now, any push or pull request under a 'bug/*' branch will trigger the workflow.
Changed the string interpolation syntax in bounty.yml. This subtle change from double quotes ("") to backticks (``) ensures proper parsing of the dynamic content, specifically under the 'script' section for 'issueComment'.
The read file action in the bounty workflow has been updated, replacing the previous manual method with a more efficient GitHub action. This action greatly simplifies the code, improving readability and ease of maintenance. The file path has also been corrected.
The bounty.yml workflow has been updated to correctly read and process the bounty footer content. This change replaces the simple cat command with a jq command that correctly reads and outputs the content of the markdown file, ensuring it is properly formatted and ready for appending to the issue.
The modification adds the 'await' keyword to the 'createComment' function in the bounty workflow file. This ensures that the function execution is completed before moving on to the subsequent operations, preventing any possible asynchronous issues.
The parameter in the bounty workflow has been changed from 'name' to 'repo'. This change will make the workflow refer to the correct repository parameter when creating comments on issues.
The commit upgrades the 'github-script' action to version 7 and modifies the method for creating issue comments. This change accommodates updates in the 'github-script' action and aligns with newer API usage for creating issue comments.
A new GitHub Actions workflow has been introduced for appending a footer to issues that have been tagged with a 'bounty' label. The text for this footer is taken from a newly added "bounty-footer.md" file in the "docs" folder. The workflow is triggered whenever an issue is labeled, and it checks out the repository, reads the footer content, and appends it to the labeled issue. The "bounty-footer.md" and the workflow itself are also added to the solution file.
* Remove unused BulkExtensions (#5160)
* Remove unnecessary whitespace in packages.yml
The whitespace after the if conditional in packages.yml was unused and unnecessary. This commit ensures to remove those to promote cleaner, more efficient code.
* Update default package version in GitHub workflows
The package version in the GitHub workflows configuration (.github/workflows/packages.yml) has been updated from 3.1.0 to 3.2.0. This change reflects version updates in the package management system.
* Remove unused BulkExtensions
---------
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
* Use PolySharp for automatic polyfilling (#5161)
* Remove unnecessary whitespace in packages.yml
The whitespace after the if conditional in packages.yml was unused and unnecessary. This commit ensures to remove those to promote cleaner, more efficient code.
* Update default package version in GitHub workflows
The package version in the GitHub workflows configuration (.github/workflows/packages.yml) has been updated from 3.1.0 to 3.2.0. This change reflects version updates in the package management system.
* Use PolySharp for automatic polyfilling
PolySharp is a design time only dependency which will analyze which polyfills are needed for the currently building target framework and will then source generate only the needed polyfills. Also they're internal by default so they don't conflict.
fixes#5157
---------
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
* Update patch version in packages workflow
The packages.yml workflow has been updated to reference patch version 3.1.2 instead of 3.1.1. This ensures the workflow correctly identifies and handles updates tagged with this new version.
---------
Co-authored-by: Robin Sue <robinsue@live.de>
* Move DynamicActivity.cs to Activities directory
The DynamicActivity.cs file has been moved from the Models directory to the Activities directory. This reorganization aims to ensure that the file's location correctly reflects its namespace.
* Add GetOutput method in ActivityExtensions
A new GetOutput method has been added to the ActivityExtensions.cs file. This method allows the retrieval of output with a specific name from an activity. Useful for handling complex types in workflow activities.
* Add feature check and refactor dependencies in Elsa
The commit introduces a new feature check in the `Module` class and refactors the dependencies in MassTransit features. Specifically, it enables querying for a specific feature before configuring the dispatcher endpoints, increasing flexibility and control. In addition, the responsibility for creating `IEndpointChannelFormatter` has been shifted from `MassTransitWorkflowDispatcherFeature` to `MassTransitFeature`, aligning with responsibility distribution.
Fixes#5165
* Add HasFeature method to IModule interface
The IModule interface has been updated to include two methods, HasFeature<T>() and HasFeature(Type featureType). These methods are designed to check if a specific type of feature has been configured, enhancing the functionality provided by the interface.
* Add WorkflowRuntimeFeature dependency
Removed unused namespaces from WorkflowsApiFeature class and added a new dependency on WorkflowRuntimeFeature. This change enhances the code cleanliness and ensures all required dependencies are correctly linked.
* Add activity completion functionality to multiple contexts
This commit introduces multiple methods to handle activity completion across various contexts, including ActivityExecutionContext and ActivityCompletedContext. It also includes updates to bookmark serialization and the WorkflowRuntime. The resulting changes should improve handling of activity outcomes and status updates in the application flow.
* Handle null options in DefaultWorkflowRuntime
Added null-conditional operators to prevent potential NullReferenceExceptions in DefaultWorkflowRuntime. This change ensures that even if the 'options' object is null, the code will not throw an exception and will instead use default values where applicable.
* Add ElsaDbContextOptions to DbContextOptionsBuilder
A line of code is added to enable applying ElsaDbContextOptions as default in DbContextOptionsBuilder within PersistenceFeatureBase. This change specifies the use of ElsaDbContextOptions when configuring the context options, enhancing the database context setup in the EntityFrameworkCore.Common module.
* Remove whitespace in Elsa.Server.Web.csproj
This commit removes unnecessary whitespaces at the end of the ProjectReference and PackageReference elements, in the Elsa.Server.Web.csproj file. This improves the readability and alignment of the code and follows the best practice for XML file format.
* Add MongoDB to docker-compose.yml
A MongoDB service has been added to the docker-compose file. The configuration includes port mapping and volume mapping for MongoDB data storage. This allows more flexibility in our environment setup with MongoDB now being spun up automatically.
* Add collection check in MongoDbStore before bulk save
Adjusted code structure, and divided longer lines of code into smaller, multi-line chunks for better readability. This refactoring makes the underlying operations and structuring of the code more apparent, aiding in future code maintenance and understanding.
* Change target branch in packages.yml workflow
This commit modifies the Github actions workflow for packaging. The branch from which to fetch changes is now specified explicitly as 'origin/patch/3.1.1' instead of the default 'origin/main'. This adjustment is specific for package creation under certain conditions.
The package version in the GitHub workflows configuration (.github/workflows/packages.yml) has been updated from 3.1.0 to 3.2.0. This change reflects version updates in the package management system.
The whitespace after the if conditional in packages.yml was unused and unnecessary. This commit ensures to remove those to promote cleaner, more efficient code.
This commit modifies the branch verification procedure in the GitHub workflows file. The code now includes a condition that checks if the event is a release that has been published before proceeding with fetching from the main branch. For other cases, the procedure remains the same, with fetching taking place from the referenced branch.
* Refactor search filtering and move ListWorkflowDefinitionsRequest file
Updated the searching mechanism in `WorkflowDefinitionFilter.cs` by validating that Name and Description are not null before performing the search. In `ListWorkflowDefinitionsRequest.cs`, the file was moved from the Responses namespace to Requests and a new property `SearchTerm` was added, allowing filtering of workflow definitions by their name, ID or description.
* Update code style settings for csproj
The .DotSettings file for the project has been adjusted with changes to code naming rules and settings migration. These modifications adjust policies for naming conventions of Instance and Static fields, enhancing code style conformance. Also, an additional settings migration rule has been applied.
* Add 'issue/*' branch to GitHub actions workflow
The GitHub actions workflow has been updated to include the 'issue/*' branch. This ensures that any changes made in the 'issue/*' branches will trigger the workflow and any associated tests or builds, improving the overall continuous integration process.
* Remove Skip and Take methods from SqlServerDialect
The mentioned functions have been removed from SqlServerDialect class in the Elsa.Dapper module. The base class provides the correct default implementation for the SQL Server dialect.
The GitHub Actions configuration has been updated to also trigger on Push events and Workflow Dispatch events. OnPushBranches and OnPullRequestBranches now also include branches prefixed with 'feature', 'patch', 'fix', and 'enhancement'. This is reflected in both the Build.CI.GitHubActions.cs file and the packages.yml GitHub workflow.
The updates in this commit refine the way branch names and package prefixes are determined in the GitHub workflow for package building. Moreover, the workflow now recognizes and supports additional branch patterns, including 'patch/*' and 'preview/*', extending the existing support for 'main' and 'feature/*' branches.
The commit message updates the branch names in the packages.yml GitHub workflows file by enclosing them in single quotes. The change is done on both 'main' and 'feature/*' branches.
This update modifies the GitHub packages workflow. 'issue/*' and 'bug/*' branches were removed from the workflow trigger, and branch name handling logic updated. Now, if the branch name is 'main', the version is labeled as 'preview'. Otherwise, the branch name is used.
This update modifies the GitHub workflow in packages.yml for improved branch name extraction and more accurate commit verification. It provides more feedback by outputting the extracted branch name, and checks for commits in the specific branch rather than in 'origin/dispatch-channels'.
Expanded GitHub action to now trigger on push events for feature/*, issue/*, and bug/* branches. The workflow has been modified to fetch the name of the current working branch, check if the commit exists on that branch, and append it to version number. This will effectively allow isolated workflows for each specific branch.
* Improve Elsa workflow expression serialization
Added serialization support for expressions in Elsa workflows, enabling serialization and deserialization to maintain consistent types across sessions. Updated relevant test cases for validation.
* Remove PR workflow from GitHub actions
The PR workflow has been removed from GitHub actions.
The GitHub Actions workflow has been updated to focus on the v3.0.2 branch instead of the main branch. As part of this change, the verification step and VERSION setting have been adjusted to reflect the new branch name.