Commit graph

10 commits

Author SHA1 Message Date
Sipke Schoorstra 69aacd654b
Regenerate V3.1 EF Core migrations with custom runtime schema support (#5155)
* Reset EF Core migrations to 3.0

* Add V3_1 migration altering Status column and SerializableWorkflowInstanceIds

This commit adds a new migration file (V3_1) which alters the 'Status' column in the 'AlterationJobs' and 'AlterationPlans' tables to be of type string instead of int. It also renames the 'SerializedWorkflowInstanceIds' to 'SerializedWorkflowInstanceFilter' in the same tables. This update applies across multiple databases (MySQL, SQL Server, SQLite, PostgreSQL).

* Remove migration command from efcore-3.1.sh script

The Entity Framework Core 3.1 migration command line has been removed from the efcore-3.1.sh script. This modification ensures that migration handling relies solely on the 'ef-migration-runtime-schema' function.
2024-03-29 21:15:23 +01:00
Sipke Schoorstra 83dd776233 Add new docker-compose files, new activities and services
Create new docker-compose files for non-data dog and data dog services. New services include Postgres, cockroachdb, rabbitmq, redis, and elsa-server. Along with the services, a new bash script for migration and various new activities and endpoints are also added for the Elsa server. This set of changes broadens the operational environment of Elsa.
2024-03-24 20:28:19 +01:00
Sipke Schoorstra 20d936d3c2
Alterations with Queries (#5032)
* Remove Elsa.Alteration Handlers and implement workflow alteration activities

The Elsa.Alterations.Handlers, Services, and Endpoints have been removed and replaced with Elsa.Alterations.Activities for various steps in executing an alteration plan. These activities include submitting an alteration plan, generating alteration jobs, and dispatching alteration jobs. New models for ActivityFilter, AlterationWorkflowInstanceFilter, and alteration activity summaries are also introduced for better management of alteration plans.

* Add 'PrintMessage' custom activity and update naming rules

A new 'PrintMessage' activity has been added to the custom activities of the ConsoleApp, which simply writes a 'Hello world!' message. On top of this, the naming rules in the code styling settings have been expanded, introducing separate rules for instance and static private fields.

* Remove V3_1 database migration files

The V3_1 database migration files were deleted across all database providers, including MySql, SQL Server, SQLite and PostgreSQL. This is indicative of a rollback or significant revision to the data migration strategy.

* Update product version and modify tables in Elsa DB context

Updated "Elsa" DbSet product version from "7.0.11" to "7.0.14". Additionally, added new properties as well as modified existing ones in tables like "Elsa.KeyValues.Entities.SerializedKeyValuePair" to improve data structure. Also properly ignored certain entities in the Alterations DbContext.

* Add V3_1 migration for Elsa

This commit introduces the V3_1 migration for the Elsa module. Changes involve the introduction of new tables and alteration of existing tables. Specifically, a new 'KeyValuePairs' table was added and several columns on various tables were renamed or altered.

* Remove multiple Elsa.EfCore V3_1 migration files

The commit removes several migration files related to the V3_1 migration in multiple Elsa.EntityFrameworkCore modules including SqlServer, PostgreSQL, and SQLite. These files encompass changes in table structures and alterations.

* Update default value for ArgumentDefinition Type

The default value for the `Type` property in the `ArgumentDefinition` class was updated to `typeof(object)`. The `Type` property of `inputDefinition` in the `WorkflowBuilder` class was also modified to be set as `typeof(T)`. These modifications enable more flexible type handling.

* Refactor SafeSerializer and serialization services

The SafeSerializer service and related serialization services have been comprehensively refactored. This includes the removal of internal notifications, the incorporation of [RequiresUnreferencedCode] attributes, and changes in method signatures. Methods have been simplified to return ValueTasks directly from the JsonSerializer, and the notification sender dependency was removed.

* Add JSON serialization for alterations

Implemented a JSON serializer and a custom converter for the IAlteration interface in the Elsa.Alterations.Core.Serialization namespace. Also, introduced a new IJsonSerializer interface and an implementation for standard JSON serialization in Elsa.Common. These serialization changes enhance modularity and extensibility of JSON operations, and improve handling of IAlteration objects.

* Add "IsSystem" field to Workflow Definitions and Instances

This update introduces a new boolean field "IsSystem" to the Workflow Definition and Workflow Instance models. This field is designed to identify system workflows which aren't meant to be modified by users. Management and Runtime module code, API endpoints, database migrations, and related classes have been updated to include this new field. The MongoDB indices and Dapper migrations have been updated as well, and serialization/deserialization processes for these types have been modified to handle this new attribute.

* Remove outdated database migrations

Deleted database migration files from the MySql, SqlServer, and PostgreSql projects.

* Add V3_1 migration for Elsa.EntityFrameworkCore.Sqlite

This commit introduces the V3_1 migration for the Elsa.EntityFrameworkCore.Sqlite module. It includes changes in Alterations, Runtime, Management, and Identity contexts. These changes involve table alterations, addition of new columns, and creation of new tables. Each context alteration encapsulates relevant changes for specific functionalities of the module.

* Add `IsSystem` property to workflow classes

The `IsSystem` property has been added to several sections of the codebase related to workflows, such as `WorkflowStateMapper.cs`, `ListWorkflowDefinitionsRequest.cs`, `WorkflowDefinitionStore.cs`, and `ListWorkflowInstancesRequest.cs`. This property flag allows us to include or filter system workflows in our queries and results.

* Add 'UsedImplicitly' attribute to Alteration Handlers and Types

The 'UsedImplicitly' attribute from JetBrains.Annotations has been added to all Alteration Handlers and Alteration Types in the Elsa.Alterations module. This change specifies that these classes are being used implicitly and helps tools like ReSharper prevent false unused code detection.

* Update migration script for efcore-3.1

The migration script efcore-3.1.sh has been updated. Module "Alterations" and provider "Sqlite" are added back into the lists while unused elements are removed for cleanup. The script now covers all necessary modules and providers, improving its overall effectiveness.

* Remove PrintMessage class from Elsa.Server.Web bundle

This commit deletes the PrintMessage.cs file that was previously part of the Elsa.Server.Web bundle.

* Refactor MassTransit service configuration

This commit reduces line code length by merging splitted long lines into one, improves maintainability of code. It also updates the Service configuration and removes unused namespaces across files, which help to simplify the codebase. Changes have also been made to switch the MassTransit broker from RabbitMq to memory and adjust the endpoint name formatter configuration.

* Remove extra whitespace in Program.cs

Removed a trailing whitespace on the line declaring the useSqlServer constant in the Program.cs file. No functionality changes were made, simply a minor formatting correction to maintain clean and consistent code.

* Remove AlterationJsonConverter and update other files

The AlterationJsonConverter class has been removed, simplifying the serialization process. The AlterationSerializer.cs file was updated with additional attribute tags, giving more information about serialization expectations. Lastly, the AlterationSerializationOptionConfigurator.cs was simplified by removing unnecessary overrides and the Elsa.Alterations.Core.csproj file was tidied up by removing unused services folder reference.

* Refactor code for improved readability and maintainability

The diff shows changes across multiple files in multiple modules. Primarily, these changes revolve around formatting edits such as removing unnecessary spaces or line breaks and adjusting alignments. A significant change was also made to the MySQL server version in the `DbContextOptionsBuilder.cs` file. These adjustments help improve the readability and maintainability of the code, making it easier to understand and modify in future iterations.

* Remove unnecessary notification files and refactor code

Several files pertaining to workflow serialization notifications were deemed unnecessary and removed. The Endpoint class in the `Elsa.Workflows.Api` module has been refactored for efficient usage of the `IWorkflowDefinitionStore` store, and similarly the `HttpFeature.cs` and `DesignTimeDbContextFactoryBase.cs` files have been slightly refactored for better readability and optimization.

* Refactor HttpFeature class on variable types order

The variable types order within the HttpFeature class in the Elsa Http module has been reorganized for cleaner code. No functional changes have been made - only the order of the types has been rearranged. This refactoring contributes to better readability and code maintenance.

* Add 'issue/*' branch to GitHub workflow triggers

This update includes 'issue/*' branches in the trigger configuration of GitHub workflows. Now, these branches will trigger specified GitHub actions, facilitating more effective issue tracking and resolution.

* Change version option in WorkflowDefinitionManager

The version option in the WorkflowDefinitionManager has been updated. Previously it was set to "LatestAndPublished", but this has been changed to "LatestOrPublished", adjusting the way the manager handles workflow versions.

* Update GitHub Actions to remove duplicate branch pattern

Removed the duplicated 'issue/*' entry from the branch trigger list in packages.yml to prevent redundancy in GitHub Actions workflow triggers. This ensures workflows are triggered correctly and efficiently for branch patterns intended for CI processes.

* Refactor job generation in GenerateAlterationJobs

Refactored the GenerateAlterationJobs activity to enhance code readability and maintainability. Broke down the ExecuteAsync method into smaller, purpose-specific private methods and added the missing `Elsa.Alterations.Core.Models` namespace.

* Refactor consumer concatenation logic in MassTransitFeature

Removed the commented-out code that filtered temporary queues, simplifying the concatenation of consumer types with workflow message consumers.

* Refactor whitespace and improve readability

Removed extraneous whitespaces and reformatted the `IsEmpty` property for better code readability. This enhances the code structure without affecting functionality.

* Refactor MassTransitFeature configuration

Moved transport configuration logic into the dedicated `ConfigureInMemoryTransport` method and removed unused usings to simplify the `MassTransitFeature` class setup. This streamlines setting up MassTransit in-memory transport and improves code maintainability.

---------

Co-authored-by: Raymond den Haan <raymond.den.haan@nexxbiz.io>
Co-authored-by: Marius Vasile Vușcan <marius.vuscan@nexxbiz.io>
2024-03-13 20:34:46 +01:00
Sipke Schoorstra 13304cdb64
Add Properties field to ActivityExecutionRecord and Regenerate V3_1 migrations (#5039) 2024-03-08 08:54:08 +01:00
Raymond den Haan 8a9e00d92d Set fixed version for MySql 2024-02-14 11:07:12 +01:00
Raymond den Haan f208c446b4 Added migrations 2024-02-14 09:23:52 +01:00
Sipke Schoorstra 0bc46d3f74 Remove migration files for Management module
Deleted all migration files related to the Management module across MySql, SqlServer, Sqlite and PostgreSql data providers. These files included data compression algorithm and data format column additions in the WorkflowInstances table.
2024-02-04 01:24:03 +01:00
Sipke Schoorstra 383eeab751 Add data compression and format fields to WorkflowInstances
This commit introduces two new fields to the WorkflowInstances table: "DataCompressionAlgorithm" and "DataFormat". These changes allow storing additional contextual information about the payloads of workflow instances and enhance future handling and processing of this data.
2024-02-04 00:06:41 +01:00
Sipke Schoorstra 22f72080f3 Add V3_1 migrations for various Elsa DB contexts
This commit includes the creation of migration files for MySql, SqlServer, Sqlite, and PostgreSql contexts in the Elsa project. The files for version V3_1 were automatically generated and are to be implemented with the necessary changes in the Up and Down methods as per the requirements.
2024-02-03 22:39:47 +01:00
Sipke Schoorstra 0bfebccadb Add compression feature for workflow state data
This update adds a compression feature for workflow state data to reduce storage needs. A compression strategy resolver, None and GZip strategies have been implemented. Migration scripts were also updated, and a superfluous file(s) were removed.
2024-02-03 22:24:46 +01:00