forked from danielgerlag/workflow-core
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Reference field as idempotency key
- Loading branch information
Sergii Kram
committed
Jun 18, 2023
1 parent
12be887
commit 2c90865
Showing
21 changed files
with
771 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# For most projects, this workflow file will not need changing; you simply need | ||
# to commit it to your repository. | ||
# | ||
# You may wish to alter this file to override the set of languages analyzed, | ||
# or to provide custom queries or build logic. | ||
# | ||
# ******** NOTE ******** | ||
# We have attempted to detect the languages in your repository. Please check | ||
# the `language` matrix defined below to confirm you have the correct set of | ||
# supported CodeQL languages. | ||
# | ||
name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: [ idempotent-workflow-start ] | ||
pull_request: | ||
# The branches below must be a subset of the branches above | ||
branches: [ idempotent-workflow-start ] | ||
schedule: | ||
- cron: '44 16 * * 1' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ 'csharp' ] | ||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] | ||
# Learn more: | ||
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v1 | ||
with: | ||
languages: ${{ matrix.language }} | ||
# If you wish to specify custom queries, you can do so here or in a config file. | ||
# By default, queries listed here will override any specified in a config file. | ||
# Prefix the list here with "+" to use these queries and those in the config file. | ||
# queries: ./path/to/local/query, your-org/your-repo/queries@main | ||
|
||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java). | ||
# If this step fails, then you should remove it and run the build manually (see below) | ||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v1 | ||
|
||
# ℹ️ Command-line programs to run using the OS shell. | ||
# 📚 https://git.io/JvXDl | ||
|
||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines | ||
# and modify them (or add more) to build your code if your project | ||
# uses a compiled language | ||
|
||
#- run: | | ||
# make bootstrap | ||
# make release | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Publish Nuget | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: | | ||
3.1.x | ||
6.0.x | ||
- name: Setup NuGet | ||
uses: NuGet/setup-nuget@v1.0.5 | ||
- name: Restore dependencies | ||
run: dotnet restore | ||
- name: Build | ||
run: dotnet build --configuration Release --no-restore | ||
- name: Integration Tests | ||
run: dotnet test test/WorkflowCore.IntegrationTests --configuration Release --no-build --verbosity normal | ||
- name: PostgreSQL Tests | ||
run: dotnet test test/WorkflowCore.Tests.PostgreSQL --configuration Release --no-build --verbosity normal | ||
- name: Pack | ||
run: dotnet pack src/providers/WorkflowCore.Persistence.EntityFramework --configuration Release --no-build | ||
- name: Pack | ||
run: dotnet pack src/providers/WorkflowCore.Persistence.PostgreSQL --configuration Release --no-build | ||
- name: Publish | ||
run: nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<PackageProjectUrl>https://github.com/danielgerlag/workflow-core</PackageProjectUrl> | ||
<PackageLicenseUrl>https://github.com/danielgerlag/workflow-core/blob/master/LICENSE.md</PackageLicenseUrl> | ||
<PackageProjectUrl>https://github.com/SergiiKram/workflow-core</PackageProjectUrl> | ||
<PackageLicenseUrl>https://github.com/SergiiKram/workflow-core/blob/idempotent-workflow-start/LICENSE.md</PackageLicenseUrl> | ||
<RepositoryType>git</RepositoryType> | ||
<RepositoryUrl>https://github.com/danielgerlag/workflow-core.git</RepositoryUrl> | ||
<RepositoryUrl>https://github.com/SergiiKram/workflow-core</RepositoryUrl> | ||
<Version>3.9.0</Version> | ||
<AssemblyVersion>3.9.0.0</AssemblyVersion> | ||
<FileVersion>3.9.0.0</FileVersion> | ||
<PackageIconUrl>https://github.com/danielgerlag/workflow-core/raw/master/src/logo.png</PackageIconUrl> | ||
<PackageIconUrl>https://github.com/SergiiKram/workflow-core/raw/idempotent-workflow-start/src/logo.png</PackageIconUrl> | ||
<PackageVersion>3.9.0</PackageVersion> | ||
</PropertyGroup> | ||
</Project> |
23 changes: 23 additions & 0 deletions
23
src/providers/WorkflowCore.Persistence.EntityFramework/Exceptions/WorkflowExistsException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using System; | ||
using System.Runtime.Serialization; | ||
|
||
namespace WorkflowCore.Persistence.EntityFramework.Exceptions | ||
{ | ||
public class WorkflowExistsException : Exception | ||
{ | ||
public WorkflowExistsException() | ||
: base("Workflow with provided correlation id already exists.") | ||
{ | ||
} | ||
|
||
protected WorkflowExistsException(SerializationInfo info, StreamingContext context) | ||
: base(info, context) | ||
{ | ||
} | ||
|
||
public WorkflowExistsException(Exception innerException) | ||
: base("Workflow with provided correlation id already exists.", innerException) | ||
{ | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...iders/WorkflowCore.Persistence.EntityFramework/Interfaces/IExtendedPersistenceProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using WorkflowCore.Interface; | ||
using WorkflowCore.Models; | ||
|
||
namespace WorkflowCore.Persistence.EntityFramework.Interfaces | ||
{ | ||
public interface IExtendedPersistenceProvider: IPersistenceProvider | ||
{ | ||
Task<WorkflowInstance> GetWorkflowInstanceByReference(string reference, CancellationToken cancellationToken = default); | ||
} | ||
} |
Oops, something went wrong.