Commit graph

179 commits

Author SHA1 Message Date
Sipke Schoorstra 4f6347b8b2 Update branch name reference in packages.yml workflow
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.
2024-06-10 15:48:09 +02:00
Sipke Schoorstra afa806cfd2 Enable SonarCloud analysis and tools in package workflow
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.
2024-06-07 18:05:14 +02:00
Sipke Schoorstra 92a60aa931 Disable SonarCloud analysis in packages 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.
2024-06-03 15:06:57 +02:00
Sipke Schoorstra e966f62f29
Update packages (#5286)
* 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>
2024-04-26 20:07:34 +02:00
cristinamudura 9fa1b4685e
Feature/sonar cloud (#5224)
* Update packages.yml

* Added sonar cloud properties

* Update packages.yml

* Update packages.yml

* Update packages.yml

* Update packages.yml

* Updated nuke Build to produce test coverage output

* Updated project key

* Fix organization key

* Versioning fix

* Removed sonar properties

* Added jdk17

* Changed build configuration for nuke

* Added opencover paths

* Added the coverlet collector NuGet package

* Added exclusions

* Updated workflow

* Modified exclusions

* Updated packages.yml to contain sonar cloud integration

* Removed test github action

* Updated for test coverage

* Updated MergeWith property for the tests

* Add verbose to check for code coverage issue

* Updated reportPaths

* Added --collect parameter

* Updates

* Updated packages workflow

* Updated exclusions

* Added sonar exclusions

* Updated exclusions

---------

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
2024-04-26 15:46:34 +02:00
Sipke Schoorstra 568cefa629
Optimize Workflow Execution and Messaging (#5243)
* 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>
2024-04-19 01:06:52 +02:00
Sipke Schoorstra 21c54f583e
Fix WorkflowActivity to Use Cached Workflow Definitions for Consistent Behavior (#5223)
* 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.
2024-04-15 10:06:27 +02:00
Sipke Schoorstra 4b5e10629b Update string formatting in bounty.yml
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'.
2024-04-10 19:52:43 +02:00
Sipke Schoorstra 593edd54a9 Update read file action in bounty workflow
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.
2024-04-10 19:47:18 +02:00
Sipke Schoorstra 1db8cc91f6 Update bounty workflow to properly read footer content
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.
2024-04-10 19:43:14 +02:00
Sipke Schoorstra 5013ecba3d Add 'await' to 'createComment' function in bounty workflow
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.
2024-04-10 19:36:46 +02:00
Sipke Schoorstra c117dd7234 Update parameter in bounty workflow
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.
2024-04-10 19:30:58 +02:00
Sipke Schoorstra a44b8901ea Update GitHub Actions script in bounty workflow
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.
2024-04-10 19:24:14 +02:00
Sipke Schoorstra b421b00e16 Add Bounty Label Workflow and Documentation
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.
2024-04-10 19:18:59 +02:00
Sipke Schoorstra d943a0e8bd
Patch 3.1.2 (#5172)
* 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>
2024-04-02 18:52:49 +02:00
Sipke Schoorstra 9b9454403b
Minor improvements and bug fixes following the 3.1 release (#5168)
* 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.
2024-04-02 07:41:46 +02:00
Sipke Schoorstra 5ae6d5918a 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.
2024-03-30 19:24:54 +01:00
Sipke Schoorstra 1a5a73136d 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.
2024-03-30 19:24:12 +01:00
Sipke Schoorstra 7c9f9f5d38 Update branch verification in GitHub workflows
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.
2024-03-29 22:22:33 +01:00
Sipke Schoorstra 0eb01c01f3
Add SearchTerm to Workflow Definitions List API client (#5035)
* 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.
2024-03-05 07:31:59 +01:00
Sipke Schoorstra f37b3c424b Expand triggers and branches for GitHub Actions
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.
2024-02-21 11:26:09 +01:00
Marko Lahma 01c34e6b13
Add PR workflow (#4956) 2024-02-18 23:36:24 +01:00
Raymond den Haan fd45171068 Update package prefix extraction logic in workflow 2024-02-16 11:58:26 +01:00
Raymond den Haan 4f20a8d5b4 Added fix path to package list 2024-02-16 11:58:26 +01:00
Sipke Schoorstra ff7c5dce1e Refine package building workflow in GitHub Actions
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.
2024-02-14 18:35:38 +01:00
Sipke Schoorstra 67feaab876 Enclose branch names in quotes in packages.yml
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.
2024-02-14 18:13:51 +01:00
Sipke Schoorstra 68b26576a3 Update branch name handling in GitHub workflow
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.
2024-02-14 18:09:39 +01:00
Sipke Schoorstra ceee982198 Update GitHub workflow for better branch handling
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'.
2024-02-14 18:06:51 +01:00
Sipke Schoorstra 2f05eae1d5 Update GitHub action for branch-specific workflows
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.
2024-02-14 18:03:31 +01:00
Sipke Schoorstra 3bad8a5b1b
Improve Elsa workflow expression serialization (#4930)
* 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.
2024-02-12 18:47:25 +01:00
Marko Lahma bc3d6d9bbc Convert to use Central Package Management
* Add GitHubActionsTestLogger
2024-02-04 13:49:54 +02:00
Marko Lahma 832fac4db1
Add NUKE build support (#4815) 2024-01-21 10:53:07 +01:00
Sipke Schoorstra 0c6d5fefb3 Update GitHub Actions workflow to target main branch
The GitHub Actions workflow was previously targeted at the v3.0.2 branch. This
2024-01-08 12:06:24 +01:00
Sipke Schoorstra 704d2207e2 Merge branch 'v3.0.2' into main 2024-01-07 17:16:59 +01:00
Sipke Schoorstra 57920fc5c5 Update GitHub workflow to target v3.0.2 branch
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.
2024-01-07 16:49:59 +01:00
Sipke Schoorstra 8e37ad9bd2 Correct typographical error in workflow name
The previous text had a typographical error in the workflow name in the Elsa Studio GitHub workflow configuration. The updated version has the proper spelling for the Elsa Studio reference application.
2024-01-06 18:22:44 +01:00
Sipke Schoorstra 4fa0d42f83 Update GitHub actions workflow branch reference
The branch reference in the packages.yml workflow file has been updated. We are no longer verifying commits against origin/v3.1.0, and instead verifying them against origin/main. This change aligns with the latest naming convention
2024-01-06 17:51:44 +01:00
Sipke Schoorstra 2fc1701a08 Merge branch 'v3.1.0' into main 2024-01-06 17:49:10 +01:00
Sipke Schoorstra f068b01856 Update workflow to track 'main' branch instead of 'v3.0.1'
This commit updates the Github Actions CI/CD workflow to track changes from the main branch instead of branch v3.0.1. It changes actions in package.yml to fetch, verify commits, and grep in the 'main' branch.
2024-01-06 17:27:31 +01:00
Sipke Schoorstra 71690a2903
Merge 3.0.1 (#4759)
* Update packages.yml for version 3.0.1

The packages.yml workflow file has been updated to target the v3.0.1 branch instead of main. The version also has been updated from 3.0.0 to 3.0.1 in the version prediction logic. Hotfix tags usage has been removed.

* Update git branch for commit verification in workflow

The Github workflow's step for verifying commits' existence has been updated. Instead of searching in the 'origin/main' branch, the workflow now checks in the 'origin/v3.0.1' branch. This modification ensures compatibility and consistency with the version being used.

* Update Elsa.Studio package versions

The Elsa.Studio and Elsa.Studio.Login.BlazorWasm packages in the Elsa.ServerAndStudio.Web and Elsa.Studio.Web projects have been updated from version 3.0.0-preview.177 to the stable version 3.0.0. This is to ensure we're using the stable and reliable versions of these packages in our projects.

* Add background execution to activities and update HTTP requests

Significantly enhanced the capabilities of background execution of activities. Included a change in activity type of "SendHttpRequest" from 'Task' to 'Action'. Introduced new classes for handling outcomes of context in background execution. Made some necessary adjustments to HTTP Request Task to handle sending HTTP requests from a background task. Updated several middleware classes to align with these modifications.

* Add background execution handling to activity context

This commit adds the ability to manage the background execution state directly within the activity execution context. This includes adding methods to set and verify the background execution state, and modifying the existing code to use these new methods. A method for handling activity scheduling during background execution has also been started, but its implementation is not finished yet. The HTTP Request activities were updated accordingly to reflect these changes.

* Add scheduling function for background activities

This commit achieves two main goals. Firstly, it introduces two new classes called ScheduledActivity and ScheduledActivityOptions to store scheduled activities' information. Secondly, it modifies how activities are executed in the background by capturing the scheduling information as a serializable format and storing it in the workflow execution context properties dictionary. This change allows the workflow execution context to resume the activity execution context.

* Refactor HTTP request handling by removing SendHttpRequestTask

SendHttpRequestTask was deleted and its functionality was merged into SendHttpRequestBase. This consolidation led to the addition of StatusCode and ResponseHeaders output fields in SendHttpRequestBase. Another change includes the update in FlowSendHttpRequest to indicate that it's no longer deprecated. Also, HttpHeaders class was extended to accommodate HttpResponseHeaders objects. The consolidation was done to streamline the HTTP request handling process.

* Update GitHub Actions workflow for new release

The GitHub Actions workflow configuration has been updated to target the '3.0.1' branch instead of 'main'. Furthermore, the preview version set in the workflow has been updated to '3.0.1-preview', changing from the previous '3.0.0-preview'.

* Update branch verification in GitHub workflow

The GitHub workflow configuration has been updated to verify that the commit exists in the branch 'origin/3.0.1' instead of 'origin/main'. This is done during the automated package generation process.

* New options to control retry logic for transient failures (#4750)

* Add an option to control the number of automatic retries for transient failures.

* Add SleepDurationProvider option for ElsaClientBuilderOptions

---------

Co-authored-by: admin <admin@admin.com>

* Add IExecuteWorkflowApi interface and refine retry policy configuration

A new interface, IExecuteWorkflowApi, was created to handle execution and dispatch of workflow definitions. This breaks down functionalities previously present in IWorkflowDefinitionsApi. Also, the retry policy configuration for HTTP requests has been refactored. Instead of hardcoding retry settings, now a delegate method can be optionally passed to customize the behavior. This makes it more flexible and shifts the responsibility of configuring retry policies to the client.

* Add option for synchronous broadcast in WorkflowInbox

This update introduces a new option to control synchronicity when broadcasting messages in the WorkflowInbox. The 'BroadcastWorkflowInboxMessageOptions' class allows the developer to specify whether the broadcasting will occur synchronously or asynchronously. The update also includes a new Endpoint and Workflow for demonstration and testing of this functionality.

* Update FastEndpoints packages to version 5.21.2

The current commit updates the version of all FastEndpoints packages from 5.20.1.7-beta to 5.21.2 in the 'Elsa.Api.Common' project. This ensures we are using the most recent stable release of these packages.

#4747

* Add decimal check in PolymorphicObjectConverter

In the PolymorphicObjectConverter class, the check for primitive types and specific object types was updated to include decimal.

Fixes #4714

* Refactor Dapper workflow and update migrations

Modified the store service to optimize the SaveManyAsync method by converting input to list only once. Also, enhanced deletion query in the store service to enable usage of different primary keys. Made changes in the Dapper migrations, replacing "NodeId" with "ActivityNodeId".

* Update workflow to use main branch and version 3.1.0

The workflow has been updated to work with updates on the 'main' branch rather than the 'v3.0.1' branch. Also, the version number for the 'VERSION' variable in preview mode has been updated to 3.1.0 from 3.0.1.

* Remove unnecessary Elsa Server activities

Deleted sample files: DataSourceActivity, MyEndpoint, and MyEventWorkflow from the Elsa Server Web bundle as part of our ongoing codebase optimization strategy. These files were no longer required and their removal simplifies our code structure.

* Update package workflow to reference v3.0.1

The GitHub actions workflow has been updated to pull from branch v3.0.1 instead of main. This change affects the commit verification and version setting steps, now using version 3.0.1-preview in the workflow process.

* Update Elsa.Studio packages to version 3.0.1-preview.196

This commit involves updating the versions of `Elsa.Studio`, `Elsa.Studio.Core.BlazorWasm`, and `Elsa.Studio.Login.BlazorWasm` packages in `Elsa.ServerAndStudio.Web.csproj` and `ElsaStudioWebAssembly.csproj` files to 3.0.1-preview.196. This update will incorporate the new changes and improvements included in this newer version.

* Update Elsa.Studio package versions

The Elsa.Studio and Elsa.Studio.Login.BlazorWasm package versions have been updated in the Elsa.Studio.Web project. Both package versions have been upgraded from 3.0.0 to 3.0.1-preview.196.

* Remove unused Workflow models and simplify AddStorageDriver method

The commit removes BackgroundExecutionOutcome and BackgroundExecutionResult models from Elsa.Workflows.Core, as they are no longer in use. Additionally, it simplifies the AddStorageDriver extension method in ModuleExtensions.cs, now it directly adds the service as an implementation of the IStorageDriver interface.

* Remove unnecessary dependencies in DefaultBackgroundActivityInvoker

Dependencies on IBookmarksPersister and IWorkflowStateExtractor have been removed in the DefaultBackgroundActivityInvoker.cs file. Additionally, an unused `using` statement for Elsa.Workflows.Helpers has been eliminated. This commit aims to declutter the code and increase its maintainability by eliminating unnecessary dependencies.

---------

Co-authored-by: Night Wu <lofrank@outlook.com>
Co-authored-by: admin <admin@admin.com>
2024-01-06 17:26:25 +01:00
Sipke Schoorstra 9e9b122c6e Merge branch 'v3.0.1' into v3.1.0 2024-01-06 17:13:58 +01:00
Sipke Schoorstra 530d6a7a6d Update package workflow to reference v3.0.1
The GitHub actions workflow has been updated to pull from branch v3.0.1 instead of main. This change affects the commit verification and version setting steps, now using version 3.0.1-preview in the workflow process.
2024-01-06 17:10:59 +01:00
Sipke Schoorstra c135e1ec91 Update workflow to use main branch and version 3.1.0
The workflow has been updated to work with updates on the 'main' branch rather than the 'v3.0.1' branch. Also, the version number for the 'VERSION' variable in preview mode has been updated to 3.1.0 from 3.0.1.
2024-01-06 15:20:38 +01:00
Sipke Schoorstra 4c783ec84d Update git branch for commit verification in workflow
The Github workflow's step for verifying commits' existence has been updated. Instead of searching in the 'origin/main' branch, the workflow now checks in the 'origin/v3.0.1' branch. This modification ensures compatibility and consistency with the version being used.
2024-01-03 20:25:54 +01:00
Sipke Schoorstra f89641df9d Update packages.yml for version 3.0.1
The packages.yml workflow file has been updated to target the v3.0.1 branch instead of main. The version also has been updated from 3.0.0 to 3.0.1 in the version prediction logic. Hotfix tags usage has been removed.
2024-01-03 20:23:35 +01:00
Sipke Schoorstra 1d366a5dea
Merge scope change into main (#4738)
* Feature/change singleton to scope (#4635)

* feat(scoped): move dependencies to scoped instead of singleton if possible.

* fix(scoped): Timer and LiveTest

* fix(scoped): change scope of python and csharp features

* fix(scoped): remove FireAndForgetStrategy and replace if by BackgroundStrategy

* fix(scoped): add .editorconfig to avoid changing the sort order of using (system.* first) and fix the scope in BackgroundEventPublisher

* Update title in README.md

The README.md file has been updated to reflect the new version of Elsa - Elsa 3.0.

* Remove npm-packages workflow, adjust branch triggers in workflows

The npm-packages.yml workflow has been removed. The branch triggers in the workflows npm-packages.yml, packages.yml, and all-in-one-web.yml have been changed from 'v3' to 'main'. An unnecessary reference to the deleted workflow file npm-packages.yml is also removed from Elsa.sln.

* Remove obsolete files from designer packages

Numerous unused and obsolete files have been removed from various designer packages including angular-workspace, elsa-workflows-designer, react-workspace, and others. This cleanup enhances the maintainability of the project by eliminating unnecessary files and reducing clutter.

* Add badges to README.md

The README.md file has been updated to include badges for packages, continuous delivery, and discussions related to Elsa workflows. These badges provide quick access to key information and resources like Nuget, npm, GitHub Actions, feedz.io, Docker, Discord, Stack Overflow, and subreddit subscribers.

* Update README with enhanced instructions for Elsa server and studio

The README updates include specific instructions for running the Elsa server on port 5001 and the Elsa studio application on port 6001. These enhanced guidelines provide comprehensive steps for configuring the applications regarding authentication, module usage, and use of API endpoints.

* Add IsWorkflowDefinitionActivity method to ActivityExtensions

A new method, GetIsWorkflowDefinitionActivity, has been added to the ActivityExtensions class. This method checks a given JsonObject representing an activity to determine if it's a workflow definition activity. It returns true if the activity indeed is; otherwise, it returns false.

* Refactor MassTransit & AzureServiceBus configuration and delete unnecessary options

AzureServiceBusOption.cs and RabbitMqOptions.cs files were removed as they're no longer needed. The system now defers the configuration of MassTransit and AzureServiceBus to the application layer (Program.cs). The configuration for PrefetchCount is also allowed at the transport-level. A new abstraction, ConsumerTypeDefinition, collects all the consumer types with their respective definitions if provided. Adjustments have been made in related extension methods and classes to reflect these changes.

* Enhance configuration options for MassTransit

This commit enhances the configuration options for the MassTransit integration, providing additional settings for both Azure Service Bus and RabbitMq. It also refines the MassTransit workflow dispatcher configuration by allowing for custom dispatcher options. A default RabbitMq connection string has been added to the appsettings.json.

* Renamed AI file

* Update Elsa.Studio package versions

The package references for Elsa.Studio, Elsa.Studio.Core.BlazorWasm, and Elsa.Studio.Login.BlazorWasm in Elsa.AllInOne.Web and ElsaStudioWebAssembly projects were updated. The version has been changed from 3.0.0-preview.160 to 3.0.0-preview.164 to incorporate the latest features and bug fixes.

* Reorganize README and add Docker instructions

The README file was reorganized to make it more readable by grouping related badges together. Additionally, instructions on how to start the Elsa Docker container were appended for users who want to quickly try out the Elsa Studio and Elsa Server.

* Update description in README.md

The current diff modifies the description of the Docker image in the README file. The revised description consolidates information about the image, its reference ASP.NET application nature, and its non-production intention into a single, more succinct sentence.

* Add tests for implicit joins and fix duplicate activity scheduling

This commit includes new integration tests for implicit join scenarios. The tests ensure that join and parallel join activities execute correctly and complete as expected. Additionally, a change has been made to the workflow execution context to prevent duplicate activity scheduling. Now, aside from checking if the activity is already scheduled, it also checks if the activity is scheduled for the specified owner.

Fixes #4703

* Add ExpressionEvaluatorOptions to JavaScriptEvaluator

The JavaScriptEvaluator now accepts an options parameter of type ExpressionEvaluatorOptions. This allows adding custom arguments to the evaluation context. An 'Empty' static instance of ExpressionEvaluatorOptions is added for convenience. Additionally, the usage of MassTransitAzureServiceBus in Program.cs is turned off by setting the flag to 'false'.

* Update README to add access information when user tried to run elsa with docker (#4708)

* [no ci] add link to Elsa 2 in README

* Remove Console and ASP.NET examples, simplify README.md

Simplified README.md by removing in-depth Console and ASP.NET Core examples, as well as mentions about building from source, serving overall clarity and readability. Added descriptions for coded and visual workflow design possibilities.

* Implement batch processing in BulkDispatchWorkflows

The changes introduce a batch processing mechanism in the BulkDispatchWorkflows activity. Previously, each workflow was dispatched individually. Now, the process groups the workflows in batches, processes each batch concurrently, and handles errors. This change improves performance, particularly for large data sources.

* Refactor workflow methods for async execution

Modified methods in the WorkflowInstance.cs to implement re-entrant approach for asynchronous execution. This is achieved by replacing 'await' with task-based calls passed through the Context.ReenterAfter method, providing more efficient non-blocking operations. Minor changes were also made in ClusterExtensions.cs and ProtoActorWorkflowRuntime.cs, including code clean up and slight modifications to maintain consistency.

* Refactor background activities scheduling

Background activities scheduling was moved to its own middleware where the actual scheduling happens instead of in the invoking middleware. Removed ScheduleBackgroundActivities.cs handler and added ScheduleBackgroundActivitiesMiddleware.cs instead. As a part of this change, restructured BackgroundActivityInvokerMiddleware to BackgroundActivityCollectorMiddleware, and updated all relevant references.

Minor modifications to a few other files include changes in their package dependencies and activity kind settings.

* Change ActivityKind from Job to Task in BulkDispatchWorkflows

The ActivityKind property in BulkDispatchWorkflows class has been changed from Job to Task. This updates the type of activity associated with the BulkDispatchWorkflows process within the Elsa workflow runtime module.

* Update BulkDispatchWorkflows activity

The BulkDispatchWorkflows.cs activity in Elsa.Workflows.Runtime module has been updated with some key changes: Added detailed description to the input element, introduced the dispatchedInstancesCount to accurately track the number of instances dispatched, and removed some unnecessary white spaces for improved readability.

* Add methods to handle activity run asynchronously flag

New methods have been added to handle the custom property 'runAsynchronously' on a JsonObject activity. These methods will help in getting and setting a value that indicates whether a specified activity can trigger a workflow asynchronously. This additional level of control can enhance workflow execution based on specific requirements.

* Add 'Persister' to UserDictionary in DotSettings

The new dictionary entry for 'Persister' has been added to Elsa.sln.DotSettings. This expands the vocabulary of the solution's user dictionary and ensures that 'Persister' is recognized as a valid term within the project context.

* Add Bookmark Persister and Bookmark Updater

The code introduces BookmarkPersister for processing bookmarks as part of the workflow runtime. This refactoring improves readability and maintainability by separating the bookmark persisting logic from the PersistBookmarkMiddleware class. A new class, BookmarkUpdater, is also added to handle updating of bookmarks. Changes also include adjustments to several other classes for improved functionality and code consistency.

* Add bookmarks processing to DefaultBackgroundActivityInvoker

The code addition includes two dependencies, IBookmarksPersister and IWorkflowStateExtractor, in the DefaultBackgroundActivityInvoker service. With these changes, during the workflow execution phase, bookmarks are captured and processed for any state changes. These modifications provide more control and efficiency over handling workflow states during the system's background operations.

* Update workflow handling and simplify codebase

Refactored the workflow handling logic and simplified numerous components in the codebase. Major changes include the enhancement of the Workflow Runtime handler, altering the broadcast and deliver functions in the Default Workflow Inbox, and the removal of unnecessary details in the Workflow Runtime feature. Also, unnecessary services and requests were removed for better code efficiency and readability.

* Add conversion support for long type in ObjectConverter

The ObjectConverter file has been updated to support conversion of 'long' type. This is done by adding an additional conditional statement for checking the underlying source type for 'long', then returning the converted value.

* Add 'Noop' method to WorkflowExecutionContext

A Noop method has been added to the WorkflowExecutionContext, and is now assigned to the ExecuteDelegate field when no resumption point is specified. The change, will prevent the invocation of the regular "ExecuteAsync" method, closing the activity without additional operations.

* Add AutoComplete option to workflow bookmarks

The AutoComplete option has been added to the workflow bookmarks, which determines whether the activity should automatically be completed if no callback is specified. This change improves the flexibility of bookmark creation and impacts various workflow elements and procedures. The corresponding adjustments have been made at functions where bookmarks are used or created.

* Refactor object initialization in ActivityExecutionContext

Refactoring was performed in the ActivityExecutionContext class to use object initializers for readability and clarity. This modification mainly targets the CreateBookmark and ScheduleActivityAsync methods, making their code more explicit and thus easier to understand.

* Refactor code for readability and improved logging

Code in several activity files and Worker.cs that involve creating bookmarks and handling messages received was refactored to improve readability and clarity. The instantiated "CreateBookmarkArgs" parameter was split into its individual arguments for improved readability. Logging in the Worker.cs file was also fine-tuned, with explicit count of workflows triggered by service bus messages being included in the debug log.

* Refactor code structure for ServiceBus Integration tests

Refactored the ServiceBus Integration tests for improved readability and maintenance. The changes included reducing the number of lines by removing unnecessary curly braces, removing unnecessary use of 'this' qualifier, replacing null checks with null-conditional operators, and organizing various code blocks for better understanding.

* Remove specific activity instance bookmarks

The change clears specific activity instance bookmarks in the context from the WorkflowExecutionContext. This is an extra step in the process of clearing bookmarks, which assists in managing and cleaning up workflow state effectively.

* Update Elsa.Studio.Login.BlazorWasm version

The version number of Elsa.Studio.Login.BlazorWasm has been updated in the Elsa.AllInOne.Web.csproj file. This change reflects the newest release, moving from version 3.0.0-preview.164 to 3.0.0-preview.167.

* Update artwork

* Implement pagination for activity descriptor fetching

Updated the WorkflowDefinitionActivityProvider code to fetch activity descriptors in a paginated manner. This change will be useful to avoid overloading system resources when interacting with large amounts of data. It retrieves a limited number of descriptors per request, looping until all are fetched.

Closes #4689

* Refactor task payload extraction and update workflow builder

Modified the way task payload is extracted in the OrderFoodTaskHandler.cs for more robustness. The input parameter of the workflow builder in the HungryWorkflow.cs file has also been refactored for efficiency. Making these tweaks streamlines management of values within the tasks.

* Update localhost port for workflow sample

The localhost port for the Elsa.Samples.AspNet.RunTaskIntegration has been updated from 7211 to 5001 in both the run-workflow.http and launchSettings.json files. This adjustment ensures that the workflow sample correctly points to the new localhost port, maintaining synchronization within the application.

* Refactor ExpressionExecutionContextExtensions module

Modified the GetInput methods to consider the case where the method is called within a composite activity, ensuring that only local variables have precedence over workflow input when executing within a composite activity.

* Feature HTTP Activity : Allow adding Authorization Header without validation (#4721)

* Add capability to add Authorization Header without validation

* Refactor authorization header handling in HTTP requests

This commit simplifies the syntax for input attributes in the SendHttpRequestBase.cs module. It also renames the boolean value `AddAuthorizatonHeaderWithoutValidation` to `DisableAuthorizationHeaderValidation` for more clarity. This change improves code readability and understanding in relation to handling authorization headers in HTTP requests.

---------

Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>

* Add a more generic UIHandler to customize how inputAttributes can be handle by UI (#4688)

* add a more generic UIHandler to customize how inputAttributes can be handle by the ui

* Add IPropertyUIHandlerResolver and update PropertyUIHandlerResolver

Introduced a new interface, IPropertyUIHandlerResolver, to resolve UI options for a property. Refactored PropertyUIHandlerResolver to implement this interface and removed the unnecessary partial class structure. Also, cleaned up some unnecessary usings in various files for better code organization.

* Refactor variable name and description in InputDescriptor

The 'uISpecifications' variable in the InputDescriptor model is renamed to 'uiSpecifications' for better readability. Additionally, the associated comment was revised to explain that the dictionary is used by the UI.

* "Refactor codebase for improved organization and cleaner architecture"

The codebase has been significantly refactored, moving several classes to more appropriate namespaces for improved organization and cleaner architecture. This includes shifting UI hint handlers, activities, and memory-related components, amongst others. The changes should improve code readability and maintainability, but as this is a broad refactoring effort, thorough regression testing is advised.

* Add CheckList UIHint with associated handler and provider

This update introduces a new UIHint called CheckList to the Elsa.Workflows.Core. This includes the necessary handler and provider classes. The handler is registered in the WorkflowsFeature.cs, and the CheckList UIHint key has been added to the InputUIHints.cs. Various associated files have been created in both the Elsa.Api.Client and Elsa.Workflows.Core project to support this new UIHint.

---------

Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>

* Update GitHub actions for packages publishing

This update changes the trigger for the package publishing action to only 'published' releases and prereleases. It also segregates the publishing mechanism into two separate actions: one for publishing preview packages to nuget.org, and another for publishing release packages. This change provides better clarity and control over the publishing process.

* Update FastEndpoints package and enable JWT Bearer Auth

The FastEndpoints package was updated to '5.20.1.7-beta' from '5.20.0-rc1'. Enabling JWT Bearer Authentication was also set from 'false' to 'true' in the SwaggerExtensions file. Removed conditions that were limiting the addition and usage of Swagger to .NET 6.0 or 7.0, which allows the Swagger to be used in any environment.

* Refactor input output assignment and JSON converter

The code has been updated to provide clear and meaningful block reference names using the Humanizer library in the IdentityGraphService. The redundancy in assigning input/output Id's in both IdentityGraphService and InputJsonConverter has also been removed, resulting in cleaner, less convoluted code.

* Enhanced script language support in Elsa.AllInOne.Web

This update introduces expanded language support in Elsa.AllInOne.Web. The changes allow CLR access in JavaScript, and also introduce the ability to use both C# and Python. The changes also include adding project references for the C# and Python modules.

* Add logging to PythonGlobalInterpreterManager

Implemented logging in the PythonGlobalInterpreterManager class to ensure visibility during Python engine initialization and shutdown. These changes are important for spotting errors, troubleshooting issues, and understanding potential failures in Python engine initialization.

* Refactor project structure and Docker configurations

The changes included in this commit are made to refactor the project structure and Docker configurations. Previously, the application was structured around the AllInOneWeb solution, but it has been split into Server.Web and ServerAndStudio.Web solutions for better separation of concerns. Additionally, the Docker configurations have been updated to reflect the new structure, which should streamline the build and deployment process.

* Add GitHub Actions workflows for Elsa Docker images

This commit introduces two new GitHub Actions workflows: one for building and deploying the Elsa Server + Studio Docker image, and another for the Elsa Server Docker image. Both processes automate the build and push actions to Docker Hub using the latest ubuntu version and buildx for multi-platform support.

* Update Dockerfiles and add Python 3.11

Working directories in both ElsaServer.Dockerfile and ElsaServerAndStudio.Dockerfile have been updated for better consistency. Additionally, Python 3.11 has been installed in the ElsaServer.Dockerfile, accompanied by relevant environment variables and symbolic links to improve interoperability.

* Update Dockerfiles for Python 3.11 installation

Added lines in Dockerfiles to install Python 3.11 and set the PYTHONNET_PYDLL environment variable. This enhancement helps to ensure compatibility with recent Python updates and improves general performance.

* Add Elsa.Studio.Web project to the solution

A new project, Elsa.Studio.Web, was added to the solution which included adding appropriate configuration files, host pages, project settings and important dependencies. Necessary adjustments were also made in Elsa.ServerAndStudio.Web.csproj to match with the latest updates.

* Add Docker build script for Elsa Studio

This commit introduces a Dockerfile for the Elsa Studio application and a corresponding GitHub workflow for building and deploying the Docker image. These make it possible to automatically build and deploy Elsa Studio as a Docker image.

* Update Elsa.Studio package versions

Updated the version of Elsa.Studio and Elsa.Studio.Login.BlazorWasm from '3.0.0-preview.169' to '3.0.0-preview.170' in Elsa.Studio.Web and Elsa.ServerAndStudio.Web projects. This is to keep the dependencies up to date and leverage any enhancements or bug fixes in the new version.

* Update Elsa.Studio packages to version 3.0.0-preview.171

The Elsa.Studio and Elsa.Studio.Login.BlazorWasm packages are updated from version 3.0.0-preview.170 to 3.0.0-preview.171 in both Elsa.Studio.Web and Elsa.ServerAndStudio.Web projects. The updated packages include satisfying the latest enhancements and bug fixes.

* Update Elsa.Studio package versions

The Elsa.Studio package versions in ElsaStudioWebAssembly project have been updated from "3.0.0-preview.164" to "3.0.0-preview.171". The packages include Elsa.Studio, Elsa.Studio.Core.BlazorWasm, and Elsa.Studio.Login.BlazorWasm.

* Add CodeEditorOptions, EditorHeight, and MultiLineOptions classes

This commit introduces three new classes to the CodeEditor namespace. CodeEditorOptions provides various configuration options for the code editor while EditorHeight defines available height options. MultiLineOptions is specifically built for managing multi-line editor settings.

* Update Elsa.Studio packages to version 3.0.0-preview.172

The packages Elsa.Studio, Elsa.Studio.Login.BlazorWasm and Elsa.Studio.Core.BlazorWasm have been updated to version 3.0.0-preview.172 in the Elsa.Studio.Web, Elsa.ServerAndStudio.Web, and ElsaStudioWebAssembly projects.

* Add non-generic GetVariable method and Python accessors

A non-generic version of GetVariable method has been added to the ExecutionContextProxy.cs, allowing direct access to variables without specifying a type. To leverage this, Python accessors for getting and setting workflow variables have been added to GenerateWorkflowVariableAccessors.cs. This enhances the interaction between the Python scripts and the context variables.

* Add UI hints to input fields in workflow core modules

Changed a number of instances in both activities and UI Hints classes across multiple modules in the workflow core to utilize UIHints. The UI hint "DropDown" has been added to relevant input fields to improve the user interface. Special handling for Enum properties in the drop-down options provider has also been created.

* Update HTTP endpoint authorization handler

The default authorization handler for HTTP endpoints is now the AuthenticationBasedHttpEndpointAuthorizationHandler instead of the AllowAnonymousHttpEndpointAuthorizationHandler. The configuration was updated in HttpFeature.cs and the override in Program.cs was removed. This provides more security to HTTP endpoints by requiring authentication.

* Add JSON editor UI hint to HTTP activities

This commit introduces a JSON editor UI hint to HTTP activities within Elsa Workflow. It includes creating new classes for a JSON editor options provider and a handler for this UI hint. Also, these additions are registered within the Elsa Workflow. The hint is applied to the 'RequestHeaders' and 'ResponseHeaders' input fields found in HTTP-related activity classes.

* Add UI hints for HTTP endpoint and single line fields

Introduced HttpEndpointPathUIHandler to provide additional UI options for the Path input field in the HTTP Endpoint activity. This commits also adds SingleLineProps to offer more options for SingleLine input fields across different modules. The implementation improves UI component interactions.

* Update Elsa.Studio packages to version 3.0.0-preview.174

The Elsa.Studio, Elsa.Studio.Login.BlazorWasm, and Elsa.Studio.Core.BlazorWasm packages have been updated to version 3.0.0-preview.174 across multiple projects. The updated packages should provide the latest functionalities and fixes from the Elsa framework.

* Add API key authentication for Elsa client

Introduced an `ApiKeyHttpMessageHandler` to use an API key as the authorization header for Elsa API client. This ensures secure interaction with the Elsa server. Also made updates to the `ElsaClientOptions` class to include the API key. An `AddElsaClient` method is added with the API key parameter in `DependencyInjectionExtensions` class for convenience.

* add sample CustomUIHandler

* Fix Httpendpoint Path

* Refactor parameter in AddElsaClient method

The parameter "configureOptions" in the AddElsaClient method has been renamed and refactored to allow direct HTTP client configuration. This change enables the actions for configuring the HTTP client to be passed directly, providing greater flexibility for customization.

* Add extension method to get workflow instance ID

This adds a new extension method in HttpResponseMessageExtensions class which retrieves the workflow instance ID from the response. It also includes a HeaderNames class to maintain the consistency of header names used by the Elsa API.

* Remove ElsaClient and related interfaces

Files ElsaClient.cs, IElsaClient.cs and IElsaClientFactory.cs have been deleted from the Elsa.Api.Client project. The commit also includes an update in the DependencyInjectionExtensions.cs file where IElsaClient service registration is removed, reflecting these changes.

* Add condition to return json as string

A condition has been added to check if the returnType is of type 'string'. If so, the json is returned as string directly without converting. This is particularly useful to avoid unnecessary conversion when the returnType is already a string.

* Disable PythonEngine Shutdown to prevent deadlock

* Improve variable resolution in workflow activity

Added a reference to Variable.Id in the SetVariable activity within the Elsa.Workflows.Core module to ensure the correct variable scope is utilized. This change enhances the precision of the variable resolution process by ensuring the correct variable is identified and updated.

* Refactor Elsa API client to use API key authentication

The Elsa API client configuration has been refactored to use API key for authentication instead of HTTP handlers. Besides, the configuration method name was changed to 'AddElsaApiKeyClient' and its parameters were simplified for ease of use. Object 'ElsaClientBuilderOptions' has also been extended with additional properties for further customization.

* Add workflow result variable to context scope

In the ExpressionExecutionContextExtensions module, an additional check and yield operation has been implemented. This allows the inclusion of the workflow result variable, if it exists, to the current context scope.

* Refactor code by renaming and moving classes

Renamed 'VehiculeActivity', 'VehiculeUIHandler' to 'VehicleActivity', 'VehicleUIHandler' and moved them to their separate files. A debouncer was added to InputsTab in the WorkflowDefinitionEditor to limit the rate of firing refresh requests. Optimized codes by reducing unnecessary lines and improved consistency in the 'Program.cs' file.

* Add sample CustomUIHandler (#4729)

* add sample CustomUIHandler

* Refactor code by renaming and moving classes

Renamed 'VehiculeActivity', 'VehiculeUIHandler' to 'VehicleActivity', 'VehicleUIHandler' and moved them to their separate files. A debouncer was added to InputsTab in the WorkflowDefinitionEditor to limit the rate of firing refresh requests. Optimized codes by reducing unnecessary lines and improved consistency in the 'Program.cs' file.

---------

Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>

* Update Elsa.Studio packages and modify authentication setup

The Elsa.Studio packages have been updated to version "3.0.0-preview.177" from "3.0.0-preview.174" in several project files. Additionally, in the "Program.cs" of ElsaStudioWebAssembly, the way the authentication handler is set up for the remote backend has been simplified and made more straightforward.

* Add System.Runtime to CSharpOptions

The System.Runtime assembly and namespace has been added to CSharpOptions. This extends the functionality capabilities within the Elsa.CSharp module by providing access to the Guid class and its related methods and properties.

* Improve handling of non-HTTP context in HttpEndpoint

Updated the HttpEndpoint class to handle non-HTTP contexts better. Instead of throwing an exception when it finds itself in a non-HTTP context, it now creates a bookmark that allows the invoker to save the state and resume execution from there. A callback has also been added to the bookmarks creation process to prepare for resumption actions.

* Add non-generic variable accessor method

Added a non-generic version of the GetVariable method to the ExecutionContextProxy and GenerateWorkflowVariableAccessors classes in Elsa.CSharp module. Also, extended the CSharpOptions class to include additional namespaces and assemblies related to System.Text.Json. These adjustments provide a more flexible way to access workflow variables and extend the usability of JSON serialization within workflows.

* Add UIHint for FlowJoin activity

The FlowJoin activity's join mode now includes a UIHint, which indicates its input is a dropdown. This improves user interface interaction by allowing the selection of join mode from a dropdown menu rather than manual input.

* Add Parser for Form data 'application/x-www-form-urlencoded' (#4733)

* Update version naming in GitHub Actions

The convention for naming versions in GitHub Actions was modified. Previously, all tags were assigned just a sequential version, even if they were already marked as a release by a tag. Now, if they are tagged and marked as a published release, they use the tag as the version. The change should provide more accurate version information.

* Fix conditional formatting in GitHub workflow

A change has been made to correct the formatting in the conditional statement within the GitHub workflow file. This rectification ensures the proper assignment of the VERSION variable when a new release is published, through proper syntax adherence.

* Refactor variable names and update notification strategy

The variable names '_hosted' and '_backgroundEventService' in ServiceBusTests class have been refactored for clarity. They have been changed to '_backgroundCommandSenderHostedService' and '_backgroundEventPublisherHostedService' respectively to accurately depict the services they are hosting. Also, the notification strategy in the 'BackgroundEventPublisherHostedService' was changed from 'Background' to 'Sequential', fixing the process of sending notifications.

---------

Co-authored-by: Jean-Baptiste Dalle <jean-baptiste.dalle@stereograph.fr>
Co-authored-by: Vincent Doreau <vincent.doreau@stereograph.fr>
Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
Co-authored-by: zergmk2 <zergmk2@users.noreply.github.com>
Co-authored-by: Mohamed Ali <antivirus.cs@gmail.com>
Co-authored-by: jdevillard <djay93@hotmail.com>
Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>

* Update service lifetimes and use IServiceScopeFactory for runtime activities

This commit introduces several modifications targeting the adjustment of service lifetimes. Classes that were previously instantiated as Scoped are changed to Singletons, and vice versa. Furthermore, it employs IServiceScopeFactory to resolve services required for runtime activities. This improves the application's infrastructure by ensuring more efficient service lifetimes and optimizing the runtime resource allocation.

---------

Co-authored-by: jeanbaptistedalle <jean-baptiste.dalle@laposte.net>
Co-authored-by: Jean-Baptiste Dalle <jean-baptiste.dalle@stereograph.fr>
Co-authored-by: Vincent Doreau <vincent.doreau@stereograph.fr>
Co-authored-by: zergmk2 <zergmk2@users.noreply.github.com>
Co-authored-by: Mohamed Ali <antivirus.cs@gmail.com>
Co-authored-by: jdevillard <djay93@hotmail.com>
Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
2024-01-02 14:52:53 +01:00
Sipke Schoorstra 28849695d3 Fix conditional formatting in GitHub workflow
A change has been made to correct the formatting in the conditional statement within the GitHub workflow file. This rectification ensures the proper assignment of the VERSION variable when a new release is published, through proper syntax adherence.
2023-12-31 13:05:38 +01:00
Sipke Schoorstra 9c1ce0c82f Update version naming in GitHub Actions
The convention for naming versions in GitHub Actions was modified. Previously, all tags were assigned just a sequential version, even if they were already marked as a release by a tag. Now, if they are tagged and marked as a published release, they use the tag as the version. The change should provide more accurate version information.
2023-12-31 12:59:55 +01:00
Sipke Schoorstra b553ffe0d9 Add Docker build script for Elsa Studio
This commit introduces a Dockerfile for the Elsa Studio application and a corresponding GitHub workflow for building and deploying the Docker image. These make it possible to automatically build and deploy Elsa Studio as a Docker image.
2023-12-27 22:15:57 +01:00
Sipke Schoorstra 3454ca0df5 Add GitHub Actions workflows for Elsa Docker images
This commit introduces two new GitHub Actions workflows: one for building and deploying the Elsa Server + Studio Docker image, and another for the Elsa Server Docker image. Both processes automate the build and push actions to Docker Hub using the latest ubuntu version and buildx for multi-platform support.
2023-12-27 20:31:11 +01:00