From 1d91c51bda30ede173cdafd5529847f68412c100 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Mon, 22 Mar 2021 12:49:34 +0100 Subject: [PATCH 01/50] Copy Projections structure from EventHandlers --- .../Events.Processing/Projections.proto | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 Source/Runtime/Events.Processing/Projections.proto diff --git a/Source/Runtime/Events.Processing/Projections.proto b/Source/Runtime/Events.Processing/Projections.proto new file mode 100644 index 0000000..3c0db72 --- /dev/null +++ b/Source/Runtime/Events.Processing/Projections.proto @@ -0,0 +1,60 @@ +// Copyright (c) Dolittle. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +syntax = "proto3"; + +import "Fundamentals/Artifacts/Artifact.proto"; +import "Fundamentals/Protobuf/Uuid.proto"; +import "Fundamentals/Protobuf/Failure.proto"; +import "Fundamentals/Services/ReverseCallContext.proto"; +import "Fundamentals/Services/Ping.proto"; +import "Runtime/Events.Processing/StreamEvent.proto"; +import "Runtime/Events.Processing/Processors.proto"; + +package dolittle.runtime.events.processing; + +option csharp_namespace = "Dolittle.Runtime.Events.Processing.Contracts"; + +message ProjectionRegistrationRequest { + services.ReverseCallArgumentsContext callContext = 1; + protobuf.Uuid scopeId = 2; // TODO: Should we have this? + protobuf.Uuid projectionId = 3; + repeated artifacts.Artifact types = 4; // TODO: Change this to include key selector +} + +message ProjectionResponse { + services.ReverseCallResponseContext callContext = 1; + ProcessorFailure failure = 2; // If not set/empty - no failure + // TODO: Add projection state response here +} + +message ProjectionClientToRuntimeMessage { + oneof Message { + ProjectionRegistrationRequest registrationRequest = 1; + ProjectionResponse handleResult = 2; + services.Pong pong = 3; + } +} + +message ProjectionRegistrationResponse { + protobuf.Failure failure = 1; +} + +message ProjectionRequest { + services.ReverseCallRequestContext callContext = 1; + StreamEvent event = 2; + RetryProcessingState retryProcessingState = 3; + // TODO: Add projection state here +} + +message ProjectionRuntimeToClientMessage { + oneof Message { + ProjectionRegistrationResponse registrationResponse = 1; + ProjectionRequest handleRequest = 2; + services.Ping ping = 3; + } +} + +service Projections { + rpc Connect(stream ProjectionClientToRuntimeMessage) returns(stream ProjectionRuntimeToClientMessage); +} From 071c7ca145b6bd4c4537933eaa9614c53e078aed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Mon, 22 Mar 2021 13:20:51 +0100 Subject: [PATCH 02/50] Add state of projections (represented as a JSON string). --- Source/Runtime/Events.Processing/Projections.proto | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/Runtime/Events.Processing/Projections.proto b/Source/Runtime/Events.Processing/Projections.proto index 3c0db72..d282d8d 100644 --- a/Source/Runtime/Events.Processing/Projections.proto +++ b/Source/Runtime/Events.Processing/Projections.proto @@ -24,8 +24,8 @@ message ProjectionRegistrationRequest { message ProjectionResponse { services.ReverseCallResponseContext callContext = 1; - ProcessorFailure failure = 2; // If not set/empty - no failure - // TODO: Add projection state response here + string nextState = 2; + ProcessorFailure failure = 3; // If not set/empty - no failure } message ProjectionClientToRuntimeMessage { @@ -42,9 +42,9 @@ message ProjectionRegistrationResponse { message ProjectionRequest { services.ReverseCallRequestContext callContext = 1; - StreamEvent event = 2; - RetryProcessingState retryProcessingState = 3; - // TODO: Add projection state here + string previousState = 2; + StreamEvent event = 3; + RetryProcessingState retryProcessingState = 4; } message ProjectionRuntimeToClientMessage { From f4a35936e5201a41f709e0623afef278d65ea9de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Mon, 22 Mar 2021 13:25:32 +0100 Subject: [PATCH 03/50] Add event key selection specification. --- Source/Runtime/Events.Processing/Projections.proto | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Source/Runtime/Events.Processing/Projections.proto b/Source/Runtime/Events.Processing/Projections.proto index d282d8d..2173e6f 100644 --- a/Source/Runtime/Events.Processing/Projections.proto +++ b/Source/Runtime/Events.Processing/Projections.proto @@ -15,11 +15,23 @@ package dolittle.runtime.events.processing; option csharp_namespace = "Dolittle.Runtime.Events.Processing.Contracts"; +enum ProjectEventKeySelectorType { + EVENT_SOURCE_ID = 0; + PARTITION_ID = 1; + PROPERTY = 2; +} + +message ProjectionEventSpecification { + artifacts.Artifact eventType = 1; + ProjectEventKeySelectorType keySelectorType = 2; + string keySelectorExpression = 3; +} + message ProjectionRegistrationRequest { services.ReverseCallArgumentsContext callContext = 1; protobuf.Uuid scopeId = 2; // TODO: Should we have this? protobuf.Uuid projectionId = 3; - repeated artifacts.Artifact types = 4; // TODO: Change this to include key selector + repeated ProjectionEventSpecification events = 4; } message ProjectionResponse { From b8e39a2ee540f43ca3b0156fdf80c81328edda11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Mon, 22 Mar 2021 13:25:57 +0100 Subject: [PATCH 04/50] Yes we should have support for scoped projections. --- Source/Runtime/Events.Processing/Projections.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Runtime/Events.Processing/Projections.proto b/Source/Runtime/Events.Processing/Projections.proto index 2173e6f..2c2fbc2 100644 --- a/Source/Runtime/Events.Processing/Projections.proto +++ b/Source/Runtime/Events.Processing/Projections.proto @@ -29,7 +29,7 @@ message ProjectionEventSpecification { message ProjectionRegistrationRequest { services.ReverseCallArgumentsContext callContext = 1; - protobuf.Uuid scopeId = 2; // TODO: Should we have this? + protobuf.Uuid scopeId = 2; protobuf.Uuid projectionId = 3; repeated ProjectionEventSpecification events = 4; } From 7e006f7141f73e6c0b457e5677695f04729dcbd5 Mon Sep 17 00:00:00 2001 From: woksin Date: Tue, 23 Mar 2021 09:33:37 +0100 Subject: [PATCH 05/50] Format and add projection prerelease --- .github/workflows/ci.yml | 70 ++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 38 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e91c161..76640b7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,12 +1,12 @@ name: Contracts CI/CD env: - PRERELEASE_BRANCHES: alpha,beta,rc,updategrpc # Comma separated list of prerelease branch names. 'alpha,rc, ...' + PRERELEASE_BRANCHES: alpha,beta,rc,projections # Comma separated list of prerelease branch names. 'alpha,rc, ...' on: push: branches: - - '**' + - "**" pull_request: types: [closed] @@ -21,19 +21,19 @@ jobs: version: ${{ steps.increment-version.outputs.next-version }} steps: - - uses: actions/checkout@v2 - - name: Establish context - id: context - uses: dolittle/establish-context-action@v2 # Replace with ./ if used withing dolittle/establish-context-action - with: - prerelease-branches: ${{ env.PRERELEASE_BRANCHES }} - - name: Increment version - id: increment-version - if: ${{ steps.context.outputs.should-publish == 'true' }} - uses: dolittle/increment-version-action@v2 # Replace with ./ if used withing dolittle/increment-version-action - with: - version: ${{ steps.context.outputs.current-version }} - release-type: ${{ steps.context.outputs.release-type }} + - uses: actions/checkout@v2 + - name: Establish context + id: context + uses: dolittle/establish-context-action@v2 # Replace with ./ if used withing dolittle/establish-context-action + with: + prerelease-branches: ${{ env.PRERELEASE_BRANCHES }} + - name: Increment version + id: increment-version + if: ${{ steps.context.outputs.should-publish == 'true' }} + uses: dolittle/increment-version-action@v2 # Replace with ./ if used withing dolittle/increment-version-action + with: + version: ${{ steps.context.outputs.current-version }} + release-type: ${{ steps.context.outputs.release-type }} dot-net-build: name: .Net Build @@ -44,7 +44,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-dotnet@v1 with: - dotnet-version: '3.1.x' + dotnet-version: "3.1.x" - run: dotnet build -c Release release: @@ -54,21 +54,21 @@ jobs: if: ${{ needs.context.outputs.should-publish == 'true' }} steps: - - uses: actions/checkout@v2 - - name: Prepend to Changelog - uses: dolittle/add-to-changelog-action@v2 - with: - version: ${{ needs.context.outputs.version }} - body: ${{ needs.context.outputs.pr-body }} - pr-url: ${{ needs.context.outputs.pr-url }} - changelog-path: CHANGELOG.md - user-email: build@dolittle.com - user-name: dolittle-build - - name: Create GitHub Release - uses: dolittle/github-release-action@v2 # Replace with ./ if used withing dolittle/github-release-action - with: - version: ${{ needs.context.outputs.version }} - body: ${{ needs.context.outputs.pr-body }} + - uses: actions/checkout@v2 + - name: Prepend to Changelog + uses: dolittle/add-to-changelog-action@v2 + with: + version: ${{ needs.context.outputs.version }} + body: ${{ needs.context.outputs.pr-body }} + pr-url: ${{ needs.context.outputs.pr-url }} + changelog-path: CHANGELOG.md + user-email: build@dolittle.com + user-name: dolittle-build + - name: Create GitHub Release + uses: dolittle/github-release-action@v2 # Replace with ./ if used withing dolittle/github-release-action + with: + version: ${{ needs.context.outputs.version }} + body: ${{ needs.context.outputs.pr-body }} dot-net-release: name: .Net Release @@ -80,18 +80,16 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-dotnet@v1 with: - dotnet-version: '3.1.x' + dotnet-version: "3.1.x" - run: dotnet build - name: Create packages run: dotnet pack --configuration Release -o Artifacts/NuGet /p:PackageVersion=${{ needs.context.outputs.version }} -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg -p:NoDefaultExcludes=true - name: Push NuGet packages run: dotnet nuget push 'Artifacts/NuGet/*.nupkg' --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json - # java-script: # name: JavaScript # runs-on: ubuntu-latest # needs: context - # steps: # - uses: actions/checkout@v2 # - uses: actions/setup-node@v1 @@ -100,11 +98,9 @@ jobs: # - uses: arduino/setup-protoc@master # with: # version: '3.11.2' - # - name: Install dependencies # working-directory: ./Generation # run: yarn - # - name: Build Fundamentals # working-directory: ./Generation/Fundamentals/JavaScript # run: yarn build @@ -117,7 +113,6 @@ jobs: # - name: Build Runtime Web # working-directory: ./Generation/Runtime/JavaScript.Web # run: yarn build - # - name: Publish Fundamentals # if: ${{ success() && needs.context.outputs.should-publish == 'true' }} # working-directory: ./Generation/Fundamentals/JavaScript @@ -134,7 +129,6 @@ jobs: # if: ${{ success() && needs.context.outputs.should-publish == 'true' }} # working-directory: ./Generation/Runtime/JavaScript.Web # run: yarn publish --new-version ${{ needs.context.outputs.version }} --no-git-tag-version - # - name: Create Pull Request # if: ${{ success() && needs.context.outputs.should-publish == 'true' }} # uses: peter-evans/create-pull-request@v2 From b8a640cc50c408c50ea33449ff7c3563974195f1 Mon Sep 17 00:00:00 2001 From: woksin Date: Tue, 23 Mar 2021 09:46:17 +0100 Subject: [PATCH 06/50] Don't add to changelog on prereleases --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 76640b7..e8f41a9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,6 +19,7 @@ jobs: pr-body: ${{ steps.context.outputs.pr-body }} pr-url: ${{ steps.context.outputs.pr-url }} version: ${{ steps.increment-version.outputs.next-version }} + release-type: ${{ steps.context.outputs.release-type }} steps: - uses: actions/checkout@v2 @@ -56,6 +57,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Prepend to Changelog + if: ${{ needs.context.outputs.should-publish == 'true' && needs.context.outputs.release-type != 'prerelease' }} uses: dolittle/add-to-changelog-action@v2 with: version: ${{ needs.context.outputs.version }} From 78302318c116935001c023b7b64ce9bb92808521 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Wed, 24 Mar 2021 10:12:34 +0100 Subject: [PATCH 07/50] Add initial state to registering, letting head know if projection was newly created or already persisted, and handling of delete responses from head. --- .../Events.Processing/Projections.proto | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/Source/Runtime/Events.Processing/Projections.proto b/Source/Runtime/Events.Processing/Projections.proto index 2c2fbc2..6951cb7 100644 --- a/Source/Runtime/Events.Processing/Projections.proto +++ b/Source/Runtime/Events.Processing/Projections.proto @@ -32,11 +32,22 @@ message ProjectionRegistrationRequest { protobuf.Uuid scopeId = 2; protobuf.Uuid projectionId = 3; repeated ProjectionEventSpecification events = 4; + string initialState = 5; +} + +enum ProjectionNextStateType { + REPLACE = 0; + DELETE = 1; +} + +message ProjectionNextState { + ProjectionNextStateType type = 1; + string value = 1; } message ProjectionResponse { services.ReverseCallResponseContext callContext = 1; - string nextState = 2; + ProjectionNextState nextState = 2; ProcessorFailure failure = 3; // If not set/empty - no failure } @@ -52,9 +63,19 @@ message ProjectionRegistrationResponse { protobuf.Failure failure = 1; } +enum ProjectionCurrentStateType { + CREATED_FROM_INITIAL_STATE = 0; + PERSISTED = 1; +} + +message ProjectionCurrentState { + ProjectionCurrentStateType type = 1; + string state = 2; +} + message ProjectionRequest { services.ReverseCallRequestContext callContext = 1; - string previousState = 2; + ProjectionCurrentState currentState = 2; StreamEvent event = 3; RetryProcessingState retryProcessingState = 4; } From 605ff3b79c6d8020f4380bd47a2f478672954ef9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Wed, 24 Mar 2021 10:14:41 +0100 Subject: [PATCH 08/50] Move ProjectionEventKeySelector out to own type (looks nicer) --- Source/Runtime/Events.Processing/Projections.proto | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/Runtime/Events.Processing/Projections.proto b/Source/Runtime/Events.Processing/Projections.proto index 6951cb7..71fe585 100644 --- a/Source/Runtime/Events.Processing/Projections.proto +++ b/Source/Runtime/Events.Processing/Projections.proto @@ -21,10 +21,14 @@ enum ProjectEventKeySelectorType { PROPERTY = 2; } +message ProjectionEventKeySelector { + ProjectEventKeySelectorType type = 1; + optional string expression = 2; +} + message ProjectionEventSpecification { artifacts.Artifact eventType = 1; - ProjectEventKeySelectorType keySelectorType = 2; - string keySelectorExpression = 3; + ProjectionEventKeySelector keySelector = 2; } message ProjectionRegistrationRequest { From 62f11492c62aa318cd72343ce51c729108f88cd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Wed, 24 Mar 2021 10:15:48 +0100 Subject: [PATCH 09/50] rename ProjectionEventSpecification -> ProjectionEventSelector --- Source/Runtime/Events.Processing/Projections.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Runtime/Events.Processing/Projections.proto b/Source/Runtime/Events.Processing/Projections.proto index 71fe585..1ff1e8e 100644 --- a/Source/Runtime/Events.Processing/Projections.proto +++ b/Source/Runtime/Events.Processing/Projections.proto @@ -26,7 +26,7 @@ message ProjectionEventKeySelector { optional string expression = 2; } -message ProjectionEventSpecification { +message ProjectionEventSelector { artifacts.Artifact eventType = 1; ProjectionEventKeySelector keySelector = 2; } @@ -35,7 +35,7 @@ message ProjectionRegistrationRequest { services.ReverseCallArgumentsContext callContext = 1; protobuf.Uuid scopeId = 2; protobuf.Uuid projectionId = 3; - repeated ProjectionEventSpecification events = 4; + repeated ProjectionEventSelector events = 4; string initialState = 5; } From 7a8e341b849c1c647f2e6cb7fe9ea2465ec4cfec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Wed, 24 Mar 2021 10:18:56 +0100 Subject: [PATCH 10/50] Fix mistake --- Source/Runtime/Events.Processing/Projections.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Runtime/Events.Processing/Projections.proto b/Source/Runtime/Events.Processing/Projections.proto index 1ff1e8e..fd71151 100644 --- a/Source/Runtime/Events.Processing/Projections.proto +++ b/Source/Runtime/Events.Processing/Projections.proto @@ -46,7 +46,7 @@ enum ProjectionNextStateType { message ProjectionNextState { ProjectionNextStateType type = 1; - string value = 1; + string value = 2; } message ProjectionResponse { From 097d3146ee58a8f96e05daecad32b4ab5f5d2a3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Wed, 24 Mar 2021 10:22:20 +0100 Subject: [PATCH 11/50] We haven't added support for "optional" in the build pipelines yet - lets leave that for later. We can send empty strings without much overhead for now (and it would be a non-breaking change in the future). --- Source/Runtime/Events.Processing/Projections.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Runtime/Events.Processing/Projections.proto b/Source/Runtime/Events.Processing/Projections.proto index fd71151..6934254 100644 --- a/Source/Runtime/Events.Processing/Projections.proto +++ b/Source/Runtime/Events.Processing/Projections.proto @@ -23,7 +23,7 @@ enum ProjectEventKeySelectorType { message ProjectionEventKeySelector { ProjectEventKeySelectorType type = 1; - optional string expression = 2; + string expression = 2; } message ProjectionEventSelector { From 5236e9d6cc03e029dc475d5976a77e5cfccb33f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Wed, 24 Mar 2021 14:14:34 +0100 Subject: [PATCH 12/50] Update Protobuf package reference, and remove "npx ..." from scripts --- Generation/Fundamentals/CSharp/CSharp.csproj | 2 +- Generation/Fundamentals/JavaScript.Web/package.json | 2 +- Generation/Fundamentals/JavaScript/package.json | 3 ++- Generation/Runtime/CSharp/CSharp.csproj | 2 +- Generation/Runtime/JavaScript.Web/package.json | 2 +- Generation/Runtime/JavaScript/package.json | 2 +- Generation/package.json | 2 +- 7 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Generation/Fundamentals/CSharp/CSharp.csproj b/Generation/Fundamentals/CSharp/CSharp.csproj index b284448..05bd51e 100644 --- a/Generation/Fundamentals/CSharp/CSharp.csproj +++ b/Generation/Fundamentals/CSharp/CSharp.csproj @@ -8,6 +8,6 @@ - + diff --git a/Generation/Fundamentals/JavaScript.Web/package.json b/Generation/Fundamentals/JavaScript.Web/package.json index 81ff5f5..faedec8 100644 --- a/Generation/Fundamentals/JavaScript.Web/package.json +++ b/Generation/Fundamentals/JavaScript.Web/package.json @@ -30,7 +30,7 @@ "types": "index.d.ts", "typings": "index.d.ts", "scripts": { - "build": "npx dolittle_proto_build grpc-web -I../../../Source ../../../Source/Fundamentals", + "build": "dolittle_proto_build grpc-web -I../../../Source ../../../Source/Fundamentals", "prepublish": "yarn build" }, "dependencies": { diff --git a/Generation/Fundamentals/JavaScript/package.json b/Generation/Fundamentals/JavaScript/package.json index e37ea25..7ceb638 100644 --- a/Generation/Fundamentals/JavaScript/package.json +++ b/Generation/Fundamentals/JavaScript/package.json @@ -30,9 +30,10 @@ "types": "index.d.ts", "typings": "index.d.ts", "scripts": { - "build": "npx dolittle_proto_build grpc-node -I../../../Source ../../../Source/Fundamentals", + "build": "dolittle_proto_build grpc-node -I../../../Source ../../../Source/Fundamentals", "prepublish": "yarn build" }, + "dependencies": { "@grpc/grpc-js": "^1.2.0", "@types/google-protobuf": "^3.2.7", diff --git a/Generation/Runtime/CSharp/CSharp.csproj b/Generation/Runtime/CSharp/CSharp.csproj index 665dce3..68bba81 100644 --- a/Generation/Runtime/CSharp/CSharp.csproj +++ b/Generation/Runtime/CSharp/CSharp.csproj @@ -12,7 +12,7 @@ - + diff --git a/Generation/Runtime/JavaScript.Web/package.json b/Generation/Runtime/JavaScript.Web/package.json index 9819a1b..6d568cc 100644 --- a/Generation/Runtime/JavaScript.Web/package.json +++ b/Generation/Runtime/JavaScript.Web/package.json @@ -30,7 +30,7 @@ "types": "index.d.ts", "typings": "index.d.ts", "scripts": { - "build": "npx dolittle_proto_build grpc-web -I../../../Source ../../../Source/Fundamentals ../../../Source/Runtime", + "build": "dolittle_proto_build grpc-web -I../../../Source ../../../Source/Fundamentals ../../../Source/Runtime", "prepublish": "yarn build" }, "dependencies": { diff --git a/Generation/Runtime/JavaScript/package.json b/Generation/Runtime/JavaScript/package.json index b386d18..b0ad4cf 100644 --- a/Generation/Runtime/JavaScript/package.json +++ b/Generation/Runtime/JavaScript/package.json @@ -30,7 +30,7 @@ "types": "index.d.ts", "typings": "index.d.ts", "scripts": { - "build": "npx dolittle_proto_build grpc-node -I../../../Source ../../../Source/Fundamentals ../../../Source/Runtime", + "build": "dolittle_proto_build grpc-node -I../../../Source ../../../Source/Fundamentals ../../../Source/Runtime", "prepublish": "yarn build" }, "dependencies": { diff --git a/Generation/package.json b/Generation/package.json index df5aa37..d0c3e2c 100644 --- a/Generation/package.json +++ b/Generation/package.json @@ -5,7 +5,7 @@ "Runtime/*" ], "devDependencies": { - "@dolittle/protobuf.build": "2.0.1", + "@dolittle/protobuf.build": "2.0.6", "typescript": "^3.8.3" } } \ No newline at end of file From e96693caf3f534b51fa2c79823932f99f69b6a4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Wed, 24 Mar 2021 14:45:55 +0100 Subject: [PATCH 13/50] Re-set package versions to 0.0.0 (to be set while publishing) --- Generation/Fundamentals/JavaScript.Web/package.json | 2 +- Generation/Fundamentals/JavaScript/package.json | 3 +-- Generation/Runtime/JavaScript.Web/package.json | 2 +- Generation/Runtime/JavaScript/package.json | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Generation/Fundamentals/JavaScript.Web/package.json b/Generation/Fundamentals/JavaScript.Web/package.json index faedec8..9cde4d4 100644 --- a/Generation/Fundamentals/JavaScript.Web/package.json +++ b/Generation/Fundamentals/JavaScript.Web/package.json @@ -1,7 +1,7 @@ { "name": "@dolittle/contracts.web", "description": "Grpc services for Dolittle Runtime for grpc-web", - "version": "5.1.20", + "version": "0.0.0", "homepage": "https://dolittle.io", "author": "Dolittle", "license": "MIT", diff --git a/Generation/Fundamentals/JavaScript/package.json b/Generation/Fundamentals/JavaScript/package.json index 7ceb638..d681ae7 100644 --- a/Generation/Fundamentals/JavaScript/package.json +++ b/Generation/Fundamentals/JavaScript/package.json @@ -1,7 +1,7 @@ { "name": "@dolittle/contracts", "description": "Grpc services for Dolittle Fundamentals", - "version": "5.1.20", + "version": "0.0.0", "homepage": "https://dolittle.io", "author": "Dolittle", "license": "MIT", @@ -33,7 +33,6 @@ "build": "dolittle_proto_build grpc-node -I../../../Source ../../../Source/Fundamentals", "prepublish": "yarn build" }, - "dependencies": { "@grpc/grpc-js": "^1.2.0", "@types/google-protobuf": "^3.2.7", diff --git a/Generation/Runtime/JavaScript.Web/package.json b/Generation/Runtime/JavaScript.Web/package.json index 6d568cc..afb0231 100644 --- a/Generation/Runtime/JavaScript.Web/package.json +++ b/Generation/Runtime/JavaScript.Web/package.json @@ -1,7 +1,7 @@ { "name": "@dolittle/runtime.contracts.web", "description": "Grpc services for Dolittle Runtime for grpc-web", - "version": "5.1.20", + "version": "0.0.0", "homepage": "https://dolittle.io", "author": "Dolittle", "license": "MIT", diff --git a/Generation/Runtime/JavaScript/package.json b/Generation/Runtime/JavaScript/package.json index b0ad4cf..ee22bd4 100644 --- a/Generation/Runtime/JavaScript/package.json +++ b/Generation/Runtime/JavaScript/package.json @@ -1,7 +1,7 @@ { "name": "@dolittle/runtime.contracts", "description": "Grpc services for Dolittle Runtime", - "version": "5.1.20", + "version": "0.0.0", "homepage": "https://dolittle.io", "author": "Dolittle", "license": "MIT", From f81cadd36f77bf1fc48b0235d2b750bf38427934 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Wed, 24 Mar 2021 14:47:06 +0100 Subject: [PATCH 14/50] Add back JS build and publishing to GitHub workflow --- .github/workflows/ci.yml | 110 +++++++++++++++++++++------------------ 1 file changed, 59 insertions(+), 51 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8f41a9..b3bba4f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,13 +25,13 @@ jobs: - uses: actions/checkout@v2 - name: Establish context id: context - uses: dolittle/establish-context-action@v2 # Replace with ./ if used withing dolittle/establish-context-action + uses: dolittle/establish-context-action@v2 with: prerelease-branches: ${{ env.PRERELEASE_BRANCHES }} - name: Increment version id: increment-version if: ${{ steps.context.outputs.should-publish == 'true' }} - uses: dolittle/increment-version-action@v2 # Replace with ./ if used withing dolittle/increment-version-action + uses: dolittle/increment-version-action@v2 with: version: ${{ steps.context.outputs.current-version }} release-type: ${{ steps.context.outputs.release-type }} @@ -67,7 +67,7 @@ jobs: user-email: build@dolittle.com user-name: dolittle-build - name: Create GitHub Release - uses: dolittle/github-release-action@v2 # Replace with ./ if used withing dolittle/github-release-action + uses: dolittle/github-release-action@v2 with: version: ${{ needs.context.outputs.version }} body: ${{ needs.context.outputs.pr-body }} @@ -88,51 +88,59 @@ jobs: run: dotnet pack --configuration Release -o Artifacts/NuGet /p:PackageVersion=${{ needs.context.outputs.version }} -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg -p:NoDefaultExcludes=true - name: Push NuGet packages run: dotnet nuget push 'Artifacts/NuGet/*.nupkg' --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json - # java-script: - # name: JavaScript - # runs-on: ubuntu-latest - # needs: context - # steps: - # - uses: actions/checkout@v2 - # - uses: actions/setup-node@v1 - # with: - # node-version: 12.x - # - uses: arduino/setup-protoc@master - # with: - # version: '3.11.2' - # - name: Install dependencies - # working-directory: ./Generation - # run: yarn - # - name: Build Fundamentals - # working-directory: ./Generation/Fundamentals/JavaScript - # run: yarn build - # - name: Build Fundamentals Web - # working-directory: ./Generation/Fundamentals/JavaScript.Web - # run: yarn build - # - name: Build Runtime - # working-directory: ./Generation/Runtime/JavaScript - # run: yarn build - # - name: Build Runtime Web - # working-directory: ./Generation/Runtime/JavaScript.Web - # run: yarn build - # - name: Publish Fundamentals - # if: ${{ success() && needs.context.outputs.should-publish == 'true' }} - # working-directory: ./Generation/Fundamentals/JavaScript - # run: yarn publish --new-version ${{ needs.context.outputs.version }} --no-git-tag-version - # - name: Publish Fundamentals Web - # if: ${{ success() && needs.context.outputs.should-publish == 'true' }} - # working-directory: ./Generation/Fundamentals/JavaScript.Web - # run: yarn publish --new-version ${{ needs.context.outputs.version }} --no-git-tag-version - # - name: Publish Runtime - # if: ${{ success() && needs.context.outputs.should-publish == 'true' }} - # working-directory: ./Generation/Runtime/JavaScript - # run: yarn publish --new-version ${{ needs.context.outputs.version }} --no-git-tag-version - # - name: Publish Runtime Web - # if: ${{ success() && needs.context.outputs.should-publish == 'true' }} - # working-directory: ./Generation/Runtime/JavaScript.Web - # run: yarn publish --new-version ${{ needs.context.outputs.version }} --no-git-tag-version - # - name: Create Pull Request - # if: ${{ success() && needs.context.outputs.should-publish == 'true' }} - # uses: peter-evans/create-pull-request@v2 - # with: - # title: Bump package.json versions to ${{ needs.context.outputs.version }} + + java-script: + name: JavaScript + runs-on: ubuntu-latest + needs: context + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 12.x + registry-url: 'https://registry.npmjs.org' + - uses: arduino/setup-protoc@master + with: + version: '3.11.2' + - name: Install dependencies + working-directory: ./Generation + run: yarn + + + - name: Parse semver string + id: semver_parser + uses: booxmedialtd/ws-action-parse-semver@v1 + with: + input_string: ${{ needs.context.outputs.version }} + + - name: Build Fundamentals + working-directory: ./Generation/Fundamentals/JavaScript + run: yarn build + - name: Update Fundamentals version + working-directory: ./Generation/Fundamentals/JavaScript + run: npm version ${{ needs.context.outputs.version }} + + # - name: Build Fundamentals - Web + # working-directory: ./Generation/Fundamentals/JavaScript.Web + # run: yarn build + + - name: Build Runtime + working-directory: ./Generation/Runtime/JavaScript + run: yarn build + - name: Update Runtime version + working-directory: ./Generation/Runtime/JavaScript + run: npm version ${{ needs.context.outputs.version }} + + # - name: Build Runtime - Web + # working-directory: ./Generation/Runtime/JavaScript.Web + # run: yarn build + + - name: Publish Fundamentals + if: ${{ needs.context.outputs.should-publish == 'true' }} + working-directory: ./Generation/Fundamentals/JavaScript + run: npm publish --tag ${{ needs.context.outputs.release-type == 'prerelease' && ${{ steps.semver_parser.outputs.prerelease }} || 'latest' }} + - name: Publish Runtime + if: ${{ needs.context.outputs.should-publish == 'true' }} + working-directory: ./Generation/Runtime/JavaScript + run: npm publish --tag ${{ needs.context.outputs.release-type == 'prerelease' && ${{ steps.semver_parser.outputs.prerelease }} || 'latest' }} + From 7c01f4d2be3b5aa8e3c3162cab478b644c38dd71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Wed, 24 Mar 2021 14:51:29 +0100 Subject: [PATCH 15/50] A little quick on the trigger there - fix workflow syntax. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b3bba4f..25451b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -138,9 +138,9 @@ jobs: - name: Publish Fundamentals if: ${{ needs.context.outputs.should-publish == 'true' }} working-directory: ./Generation/Fundamentals/JavaScript - run: npm publish --tag ${{ needs.context.outputs.release-type == 'prerelease' && ${{ steps.semver_parser.outputs.prerelease }} || 'latest' }} + run: npm publish --tag ${{ needs.context.outputs.release-type == 'prerelease' && steps.semver_parser.outputs.prerelease || 'latest' }} - name: Publish Runtime if: ${{ needs.context.outputs.should-publish == 'true' }} working-directory: ./Generation/Runtime/JavaScript - run: npm publish --tag ${{ needs.context.outputs.release-type == 'prerelease' && ${{ steps.semver_parser.outputs.prerelease }} || 'latest' }} + run: npm publish --tag ${{ needs.context.outputs.release-type == 'prerelease' && steps.semver_parser.outputs.prerelease || 'latest' }} From de7e9b529ab2766e3fa324cfe25277eee6aaa231 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Wed, 24 Mar 2021 14:54:23 +0100 Subject: [PATCH 16/50] Only parse semver if we get a version --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 25451b6..0c69a3c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -108,8 +108,9 @@ jobs: - name: Parse semver string - id: semver_parser uses: booxmedialtd/ws-action-parse-semver@v1 + if: ${{ needs.context.outputs.should-publish == 'true' }} + id: semver_parser with: input_string: ${{ needs.context.outputs.version }} From 5d478c93359df8c78446b882b19e233bf90d069c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Wed, 24 Mar 2021 17:39:01 +0100 Subject: [PATCH 17/50] Split out JS-build + add publish token --- .github/workflows/ci.yml | 43 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c69a3c..17f0eff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,6 +48,37 @@ jobs: dotnet-version: "3.1.x" - run: dotnet build -c Release + + java-script-build: + name: JavaScript Build + runs-on: ubuntu-latest + needs: context + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 12.x + registry-url: 'https://registry.npmjs.org' + - uses: arduino/setup-protoc@master + with: + version: '3.11.2' + - name: Install dependencies + working-directory: ./Generation + run: yarn + + - name: Build Fundamentals + working-directory: ./Generation/Fundamentals/JavaScript + run: yarn build + # - name: Build Fundamentals - Web + # working-directory: ./Generation/Fundamentals/JavaScript.Web + # run: yarn build + - name: Build Runtime + working-directory: ./Generation/Runtime/JavaScript + run: yarn build + # - name: Build Runtime - Web + # working-directory: ./Generation/Runtime/JavaScript.Web + # run: yarn build + release: name: Release runs-on: ubuntu-latest @@ -89,10 +120,11 @@ jobs: - name: Push NuGet packages run: dotnet nuget push 'Artifacts/NuGet/*.nupkg' --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json - java-script: - name: JavaScript + java-script-release: + name: JavaScript Release runs-on: ubuntu-latest - needs: context + needs: [context, java-script-build] + if: ${{ needs.context.outputs.should-publish == 'true' }} steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v1 @@ -106,7 +138,6 @@ jobs: working-directory: ./Generation run: yarn - - name: Parse semver string uses: booxmedialtd/ws-action-parse-semver@v1 if: ${{ needs.context.outputs.should-publish == 'true' }} @@ -140,8 +171,12 @@ jobs: if: ${{ needs.context.outputs.should-publish == 'true' }} working-directory: ./Generation/Fundamentals/JavaScript run: npm publish --tag ${{ needs.context.outputs.release-type == 'prerelease' && steps.semver_parser.outputs.prerelease || 'latest' }} + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Publish Runtime if: ${{ needs.context.outputs.should-publish == 'true' }} working-directory: ./Generation/Runtime/JavaScript run: npm publish --tag ${{ needs.context.outputs.release-type == 'prerelease' && steps.semver_parser.outputs.prerelease || 'latest' }} + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} From f6124565793dffcaf4396ff3a962139ed8f61f32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Wed, 24 Mar 2021 17:40:39 +0100 Subject: [PATCH 18/50] Simplify publish checks for JS --- .github/workflows/ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 17f0eff..6e8c43f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -140,7 +140,6 @@ jobs: - name: Parse semver string uses: booxmedialtd/ws-action-parse-semver@v1 - if: ${{ needs.context.outputs.should-publish == 'true' }} id: semver_parser with: input_string: ${{ needs.context.outputs.version }} @@ -168,13 +167,11 @@ jobs: # run: yarn build - name: Publish Fundamentals - if: ${{ needs.context.outputs.should-publish == 'true' }} working-directory: ./Generation/Fundamentals/JavaScript run: npm publish --tag ${{ needs.context.outputs.release-type == 'prerelease' && steps.semver_parser.outputs.prerelease || 'latest' }} env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Publish Runtime - if: ${{ needs.context.outputs.should-publish == 'true' }} working-directory: ./Generation/Runtime/JavaScript run: npm publish --tag ${{ needs.context.outputs.release-type == 'prerelease' && steps.semver_parser.outputs.prerelease || 'latest' }} env: From 8eae5e5a829fdc997eeb54011ff707774b644028 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Thu, 25 Mar 2021 16:23:52 +0100 Subject: [PATCH 19/50] Fix little typo --- Source/Runtime/Events.Processing/Projections.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Runtime/Events.Processing/Projections.proto b/Source/Runtime/Events.Processing/Projections.proto index 6934254..b66c83c 100644 --- a/Source/Runtime/Events.Processing/Projections.proto +++ b/Source/Runtime/Events.Processing/Projections.proto @@ -15,14 +15,14 @@ package dolittle.runtime.events.processing; option csharp_namespace = "Dolittle.Runtime.Events.Processing.Contracts"; -enum ProjectEventKeySelectorType { +enum ProjectionEventKeySelectorType { EVENT_SOURCE_ID = 0; PARTITION_ID = 1; PROPERTY = 2; } message ProjectionEventKeySelector { - ProjectEventKeySelectorType type = 1; + ProjectionEventKeySelectorType type = 1; string expression = 2; } From 9e6b037cbd4b02fffc5cd46712d5e0c6499810cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Thu, 25 Mar 2021 16:26:00 +0100 Subject: [PATCH 20/50] Add the "calculated" key to the ProjectionRequest --- Source/Runtime/Events.Processing/Projections.proto | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/Runtime/Events.Processing/Projections.proto b/Source/Runtime/Events.Processing/Projections.proto index b66c83c..3eb47d7 100644 --- a/Source/Runtime/Events.Processing/Projections.proto +++ b/Source/Runtime/Events.Processing/Projections.proto @@ -79,9 +79,10 @@ message ProjectionCurrentState { message ProjectionRequest { services.ReverseCallRequestContext callContext = 1; - ProjectionCurrentState currentState = 2; - StreamEvent event = 3; - RetryProcessingState retryProcessingState = 4; + string key = 2; + ProjectionCurrentState currentState = 3; + StreamEvent event = 4; + RetryProcessingState retryProcessingState = 5; } message ProjectionRuntimeToClientMessage { From 2fc4c00b2161d239c952017f86d1e3667069b0a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Sat, 27 Mar 2021 16:51:13 +0100 Subject: [PATCH 21/50] Move CSharp projects into its own directory --- Contracts.sln | 60 ------------------- Generation/CSharp/Contracts.sln | 48 +++++++++++++++ .../Fundamentals/Fundamentals.csproj} | 0 .../Runtime/Runtime.csproj} | 2 +- 4 files changed, 49 insertions(+), 61 deletions(-) delete mode 100644 Contracts.sln create mode 100644 Generation/CSharp/Contracts.sln rename Generation/{Fundamentals/CSharp/CSharp.csproj => CSharp/Fundamentals/Fundamentals.csproj} (100%) rename Generation/{Runtime/CSharp/CSharp.csproj => CSharp/Runtime/Runtime.csproj} (88%) diff --git a/Contracts.sln b/Contracts.sln deleted file mode 100644 index 5ed97bb..0000000 --- a/Contracts.sln +++ /dev/null @@ -1,60 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26124.0 -MinimumVisualStudioVersion = 15.0.26124.0 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Generation", "Generation", "{2CEE50F8-2C3E-4373-BAF0-AB9C01E52B38}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Fundamentals", "Fundamentals", "{BA94C7CF-FE45-41FA-8282-FBA16DC05D27}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharp", "Generation\Fundamentals\CSharp\CSharp.csproj", "{13765947-7CC0-42FE-8EDD-941FCE85236E}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Runtime", "Runtime", "{C7F3347D-AA62-455D-AEDA-C3E0802773AB}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharp", "Generation\Runtime\CSharp\CSharp.csproj", "{BB5C4965-64A3-49ED-883A-C620E9574892}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {13765947-7CC0-42FE-8EDD-941FCE85236E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {13765947-7CC0-42FE-8EDD-941FCE85236E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {13765947-7CC0-42FE-8EDD-941FCE85236E}.Debug|x64.ActiveCfg = Debug|Any CPU - {13765947-7CC0-42FE-8EDD-941FCE85236E}.Debug|x64.Build.0 = Debug|Any CPU - {13765947-7CC0-42FE-8EDD-941FCE85236E}.Debug|x86.ActiveCfg = Debug|Any CPU - {13765947-7CC0-42FE-8EDD-941FCE85236E}.Debug|x86.Build.0 = Debug|Any CPU - {13765947-7CC0-42FE-8EDD-941FCE85236E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {13765947-7CC0-42FE-8EDD-941FCE85236E}.Release|Any CPU.Build.0 = Release|Any CPU - {13765947-7CC0-42FE-8EDD-941FCE85236E}.Release|x64.ActiveCfg = Release|Any CPU - {13765947-7CC0-42FE-8EDD-941FCE85236E}.Release|x64.Build.0 = Release|Any CPU - {13765947-7CC0-42FE-8EDD-941FCE85236E}.Release|x86.ActiveCfg = Release|Any CPU - {13765947-7CC0-42FE-8EDD-941FCE85236E}.Release|x86.Build.0 = Release|Any CPU - {BB5C4965-64A3-49ED-883A-C620E9574892}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BB5C4965-64A3-49ED-883A-C620E9574892}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BB5C4965-64A3-49ED-883A-C620E9574892}.Debug|x64.ActiveCfg = Debug|Any CPU - {BB5C4965-64A3-49ED-883A-C620E9574892}.Debug|x64.Build.0 = Debug|Any CPU - {BB5C4965-64A3-49ED-883A-C620E9574892}.Debug|x86.ActiveCfg = Debug|Any CPU - {BB5C4965-64A3-49ED-883A-C620E9574892}.Debug|x86.Build.0 = Debug|Any CPU - {BB5C4965-64A3-49ED-883A-C620E9574892}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BB5C4965-64A3-49ED-883A-C620E9574892}.Release|Any CPU.Build.0 = Release|Any CPU - {BB5C4965-64A3-49ED-883A-C620E9574892}.Release|x64.ActiveCfg = Release|Any CPU - {BB5C4965-64A3-49ED-883A-C620E9574892}.Release|x64.Build.0 = Release|Any CPU - {BB5C4965-64A3-49ED-883A-C620E9574892}.Release|x86.ActiveCfg = Release|Any CPU - {BB5C4965-64A3-49ED-883A-C620E9574892}.Release|x86.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {BA94C7CF-FE45-41FA-8282-FBA16DC05D27} = {2CEE50F8-2C3E-4373-BAF0-AB9C01E52B38} - {13765947-7CC0-42FE-8EDD-941FCE85236E} = {BA94C7CF-FE45-41FA-8282-FBA16DC05D27} - {C7F3347D-AA62-455D-AEDA-C3E0802773AB} = {2CEE50F8-2C3E-4373-BAF0-AB9C01E52B38} - {BB5C4965-64A3-49ED-883A-C620E9574892} = {C7F3347D-AA62-455D-AEDA-C3E0802773AB} - EndGlobalSection -EndGlobal diff --git a/Generation/CSharp/Contracts.sln b/Generation/CSharp/Contracts.sln new file mode 100644 index 0000000..36ae56e --- /dev/null +++ b/Generation/CSharp/Contracts.sln @@ -0,0 +1,48 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26124.0 +MinimumVisualStudioVersion = 15.0.26124.0 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Fundamentals", "Fundamentals\Fundamentals.csproj", "{B52A8FFB-5B2E-4BFB-8EE2-474594C66888}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Runtime", "Runtime\Runtime.csproj", "{012C3E8F-7C5A-4765-A35E-1ACE2E9BCFA5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B52A8FFB-5B2E-4BFB-8EE2-474594C66888}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B52A8FFB-5B2E-4BFB-8EE2-474594C66888}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B52A8FFB-5B2E-4BFB-8EE2-474594C66888}.Debug|x64.ActiveCfg = Debug|Any CPU + {B52A8FFB-5B2E-4BFB-8EE2-474594C66888}.Debug|x64.Build.0 = Debug|Any CPU + {B52A8FFB-5B2E-4BFB-8EE2-474594C66888}.Debug|x86.ActiveCfg = Debug|Any CPU + {B52A8FFB-5B2E-4BFB-8EE2-474594C66888}.Debug|x86.Build.0 = Debug|Any CPU + {B52A8FFB-5B2E-4BFB-8EE2-474594C66888}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B52A8FFB-5B2E-4BFB-8EE2-474594C66888}.Release|Any CPU.Build.0 = Release|Any CPU + {B52A8FFB-5B2E-4BFB-8EE2-474594C66888}.Release|x64.ActiveCfg = Release|Any CPU + {B52A8FFB-5B2E-4BFB-8EE2-474594C66888}.Release|x64.Build.0 = Release|Any CPU + {B52A8FFB-5B2E-4BFB-8EE2-474594C66888}.Release|x86.ActiveCfg = Release|Any CPU + {B52A8FFB-5B2E-4BFB-8EE2-474594C66888}.Release|x86.Build.0 = Release|Any CPU + {012C3E8F-7C5A-4765-A35E-1ACE2E9BCFA5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {012C3E8F-7C5A-4765-A35E-1ACE2E9BCFA5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {012C3E8F-7C5A-4765-A35E-1ACE2E9BCFA5}.Debug|x64.ActiveCfg = Debug|Any CPU + {012C3E8F-7C5A-4765-A35E-1ACE2E9BCFA5}.Debug|x64.Build.0 = Debug|Any CPU + {012C3E8F-7C5A-4765-A35E-1ACE2E9BCFA5}.Debug|x86.ActiveCfg = Debug|Any CPU + {012C3E8F-7C5A-4765-A35E-1ACE2E9BCFA5}.Debug|x86.Build.0 = Debug|Any CPU + {012C3E8F-7C5A-4765-A35E-1ACE2E9BCFA5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {012C3E8F-7C5A-4765-A35E-1ACE2E9BCFA5}.Release|Any CPU.Build.0 = Release|Any CPU + {012C3E8F-7C5A-4765-A35E-1ACE2E9BCFA5}.Release|x64.ActiveCfg = Release|Any CPU + {012C3E8F-7C5A-4765-A35E-1ACE2E9BCFA5}.Release|x64.Build.0 = Release|Any CPU + {012C3E8F-7C5A-4765-A35E-1ACE2E9BCFA5}.Release|x86.ActiveCfg = Release|Any CPU + {012C3E8F-7C5A-4765-A35E-1ACE2E9BCFA5}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/Generation/Fundamentals/CSharp/CSharp.csproj b/Generation/CSharp/Fundamentals/Fundamentals.csproj similarity index 100% rename from Generation/Fundamentals/CSharp/CSharp.csproj rename to Generation/CSharp/Fundamentals/Fundamentals.csproj diff --git a/Generation/Runtime/CSharp/CSharp.csproj b/Generation/CSharp/Runtime/Runtime.csproj similarity index 88% rename from Generation/Runtime/CSharp/CSharp.csproj rename to Generation/CSharp/Runtime/Runtime.csproj index 68bba81..c3c9543 100644 --- a/Generation/Runtime/CSharp/CSharp.csproj +++ b/Generation/CSharp/Runtime/Runtime.csproj @@ -7,7 +7,7 @@ - + From 504054f563de5e3618c869955f707847cd46eb35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Sat, 27 Mar 2021 17:01:26 +0100 Subject: [PATCH 22/50] Move JavaScript to its own directory --- .gitignore | 7 ++-- .../Fundamentals/JavaScript.Web/package.json | 41 ------------------- .../Fundamentals/JavaScript.Web/tsconfig.json | 15 ------- .../Fundamentals}/package.json | 2 +- .../Fundamentals}/tsconfig.json | 1 - .../Runtime}/package.json | 2 +- .../Runtime}/tsconfig.json | 0 Generation/{ => JavaScript}/package.json | 6 +-- .../{ => JavaScript}/tsconfig.settings.json | 0 .../Runtime/JavaScript.Web/package.json | 41 ------------------- .../Runtime/JavaScript.Web/tsconfig.json | 15 ------- 11 files changed, 9 insertions(+), 121 deletions(-) delete mode 100644 Generation/Fundamentals/JavaScript.Web/package.json delete mode 100644 Generation/Fundamentals/JavaScript.Web/tsconfig.json rename Generation/{Fundamentals/JavaScript => JavaScript/Fundamentals}/package.json (87%) rename Generation/{Runtime/JavaScript => JavaScript/Fundamentals}/tsconfig.json (97%) rename Generation/{Runtime/JavaScript => JavaScript/Runtime}/package.json (84%) rename Generation/{Fundamentals/JavaScript => JavaScript/Runtime}/tsconfig.json (100%) rename Generation/{ => JavaScript}/package.json (55%) rename Generation/{ => JavaScript}/tsconfig.settings.json (100%) delete mode 100644 Generation/Runtime/JavaScript.Web/package.json delete mode 100644 Generation/Runtime/JavaScript.Web/tsconfig.json diff --git a/.gitignore b/.gitignore index db64439..c4f1d1a 100644 --- a/.gitignore +++ b/.gitignore @@ -355,8 +355,9 @@ package-json.lock *.cs *.ts -Generation/**/*.js -Generation/**/*.ts -Generation/**/*.d.ts +Generation/JavaScript/Fundamentals/** +Generation/JavaScript/Runtime/** +!Generation/JavaScript/**/package.json +!Generation/JavaScript/**/tsconfig.json !Source/**/Artifacts \ No newline at end of file diff --git a/Generation/Fundamentals/JavaScript.Web/package.json b/Generation/Fundamentals/JavaScript.Web/package.json deleted file mode 100644 index 9cde4d4..0000000 --- a/Generation/Fundamentals/JavaScript.Web/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "@dolittle/contracts.web", - "description": "Grpc services for Dolittle Runtime for grpc-web", - "version": "0.0.0", - "homepage": "https://dolittle.io", - "author": "Dolittle", - "license": "MIT", - "repository": { - "type": "git", - "url": "https://github.com/dolittle-runtime/contracts.git" - }, - "bugs": { - "url": "https://github.com/dolittle/home/issues" - }, - "keywords": [ - "dolittle", - "grpc" - ], - "publishConfig": { - "access": "public" - }, - "files": [ - "lib", - "package.json", - "**/*.d.ts", - "**/*.ts", - "**/*.js" - ], - "main": "lib/index.js", - "types": "index.d.ts", - "typings": "index.d.ts", - "scripts": { - "build": "dolittle_proto_build grpc-web -I../../../Source ../../../Source/Fundamentals", - "prepublish": "yarn build" - }, - "dependencies": { - "@types/google-protobuf": "^3.2.7", - "google-protobuf": "^3.11.4", - "grpc-web": "^1.0.7" - } -} diff --git a/Generation/Fundamentals/JavaScript.Web/tsconfig.json b/Generation/Fundamentals/JavaScript.Web/tsconfig.json deleted file mode 100644 index 29b10d1..0000000 --- a/Generation/Fundamentals/JavaScript.Web/tsconfig.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.settings.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "lib", - "baseUrl": "./", - - "paths": { - "@dolittle/runtime.contracts.web": ["index.ts"] - }, - "sourceRoot": "./" - }, - "exclude": ["**/*.d.ts", "node_modules"], - "include": ["**/*.ts", "**/*.js"] - } \ No newline at end of file diff --git a/Generation/Fundamentals/JavaScript/package.json b/Generation/JavaScript/Fundamentals/package.json similarity index 87% rename from Generation/Fundamentals/JavaScript/package.json rename to Generation/JavaScript/Fundamentals/package.json index d681ae7..6b73a45 100644 --- a/Generation/Fundamentals/JavaScript/package.json +++ b/Generation/JavaScript/Fundamentals/package.json @@ -30,7 +30,7 @@ "types": "index.d.ts", "typings": "index.d.ts", "scripts": { - "build": "dolittle_proto_build grpc-node -I../../../Source ../../../Source/Fundamentals", + "build": "dolittle_proto_build grpc-node --skip-empty-files -O. -RFundamentals/: -I../../../Source ../../../Source/Fundamentals", "prepublish": "yarn build" }, "dependencies": { diff --git a/Generation/Runtime/JavaScript/tsconfig.json b/Generation/JavaScript/Fundamentals/tsconfig.json similarity index 97% rename from Generation/Runtime/JavaScript/tsconfig.json rename to Generation/JavaScript/Fundamentals/tsconfig.json index 0a9a7b5..0e556f1 100644 --- a/Generation/Runtime/JavaScript/tsconfig.json +++ b/Generation/JavaScript/Fundamentals/tsconfig.json @@ -4,7 +4,6 @@ "rootDir": ".", "outDir": "lib", "baseUrl": "./", - "paths": { "@dolittle/runtime.contracts": ["index.ts"] }, diff --git a/Generation/Runtime/JavaScript/package.json b/Generation/JavaScript/Runtime/package.json similarity index 84% rename from Generation/Runtime/JavaScript/package.json rename to Generation/JavaScript/Runtime/package.json index ee22bd4..173f860 100644 --- a/Generation/Runtime/JavaScript/package.json +++ b/Generation/JavaScript/Runtime/package.json @@ -30,7 +30,7 @@ "types": "index.d.ts", "typings": "index.d.ts", "scripts": { - "build": "dolittle_proto_build grpc-node -I../../../Source ../../../Source/Fundamentals ../../../Source/Runtime", + "build": "dolittle_proto_build grpc-node --skip-empty-files -O. -RFundamentals/:pkg=@dolittle/contracts/: -RRuntime/: -I../../../Source ../../../Source/Runtime", "prepublish": "yarn build" }, "dependencies": { diff --git a/Generation/Fundamentals/JavaScript/tsconfig.json b/Generation/JavaScript/Runtime/tsconfig.json similarity index 100% rename from Generation/Fundamentals/JavaScript/tsconfig.json rename to Generation/JavaScript/Runtime/tsconfig.json diff --git a/Generation/package.json b/Generation/JavaScript/package.json similarity index 55% rename from Generation/package.json rename to Generation/JavaScript/package.json index d0c3e2c..3453081 100644 --- a/Generation/package.json +++ b/Generation/JavaScript/package.json @@ -1,11 +1,11 @@ { "private": true, "workspaces": [ - "Fundamentals/*", - "Runtime/*" + "Fundamentals", + "Runtime" ], "devDependencies": { - "@dolittle/protobuf.build": "2.0.6", + "@dolittle/protobuf.build": "3.1.2", "typescript": "^3.8.3" } } \ No newline at end of file diff --git a/Generation/tsconfig.settings.json b/Generation/JavaScript/tsconfig.settings.json similarity index 100% rename from Generation/tsconfig.settings.json rename to Generation/JavaScript/tsconfig.settings.json diff --git a/Generation/Runtime/JavaScript.Web/package.json b/Generation/Runtime/JavaScript.Web/package.json deleted file mode 100644 index afb0231..0000000 --- a/Generation/Runtime/JavaScript.Web/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "@dolittle/runtime.contracts.web", - "description": "Grpc services for Dolittle Runtime for grpc-web", - "version": "0.0.0", - "homepage": "https://dolittle.io", - "author": "Dolittle", - "license": "MIT", - "repository": { - "type": "git", - "url": "https://github.com/dolittle-runtime/contracts.git" - }, - "bugs": { - "url": "https://github.com/dolittle/home/issues" - }, - "keywords": [ - "dolittle", - "grpc" - ], - "publishConfig": { - "access": "public" - }, - "files": [ - "lib", - "package.json", - "**/*.d.ts", - "**/*.ts", - "**/*.js" - ], - "main": "lib/index.js", - "types": "index.d.ts", - "typings": "index.d.ts", - "scripts": { - "build": "dolittle_proto_build grpc-web -I../../../Source ../../../Source/Fundamentals ../../../Source/Runtime", - "prepublish": "yarn build" - }, - "dependencies": { - "@types/google-protobuf": "^3.2.7", - "google-protobuf": "^3.11.4", - "grpc-web": "^1.0.7" - } -} diff --git a/Generation/Runtime/JavaScript.Web/tsconfig.json b/Generation/Runtime/JavaScript.Web/tsconfig.json deleted file mode 100644 index 29b10d1..0000000 --- a/Generation/Runtime/JavaScript.Web/tsconfig.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.settings.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "lib", - "baseUrl": "./", - - "paths": { - "@dolittle/runtime.contracts.web": ["index.ts"] - }, - "sourceRoot": "./" - }, - "exclude": ["**/*.d.ts", "node_modules"], - "include": ["**/*.ts", "**/*.js"] - } \ No newline at end of file From bc6fce4c5d91917d35e9fd3b09525bdcb6675dec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Sat, 27 Mar 2021 17:03:33 +0100 Subject: [PATCH 23/50] Fix tsconfig.jsons --- Generation/JavaScript/Fundamentals/tsconfig.json | 5 ++--- Generation/JavaScript/Runtime/tsconfig.json | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Generation/JavaScript/Fundamentals/tsconfig.json b/Generation/JavaScript/Fundamentals/tsconfig.json index 0e556f1..deda1c2 100644 --- a/Generation/JavaScript/Fundamentals/tsconfig.json +++ b/Generation/JavaScript/Fundamentals/tsconfig.json @@ -1,13 +1,12 @@ { - "extends": "../../tsconfig.settings.json", + "extends": "../tsconfig.settings.json", "compilerOptions": { "rootDir": ".", "outDir": "lib", "baseUrl": "./", "paths": { "@dolittle/runtime.contracts": ["index.ts"] - }, - "sourceRoot": "./" + } }, "exclude": ["**/*.d.ts", "node_modules"], "include": ["**/*.ts", "**/*.js"] diff --git a/Generation/JavaScript/Runtime/tsconfig.json b/Generation/JavaScript/Runtime/tsconfig.json index 0a9a7b5..dc5256b 100644 --- a/Generation/JavaScript/Runtime/tsconfig.json +++ b/Generation/JavaScript/Runtime/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.settings.json", + "extends": "../tsconfig.settings.json", "compilerOptions": { "rootDir": ".", "outDir": "lib", @@ -7,8 +7,7 @@ "paths": { "@dolittle/runtime.contracts": ["index.ts"] - }, - "sourceRoot": "./" + } }, "exclude": ["**/*.d.ts", "node_modules"], "include": ["**/*.ts", "**/*.js"] From 67ad29274a7730d3f9331ec3b8a4c7a4fe746421 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Sat, 27 Mar 2021 17:28:46 +0100 Subject: [PATCH 24/50] Use right dependencies --- Generation/JavaScript/Fundamentals/package.json | 6 +++--- Generation/JavaScript/Runtime/package.json | 6 +++--- Generation/JavaScript/package.json | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Generation/JavaScript/Fundamentals/package.json b/Generation/JavaScript/Fundamentals/package.json index 6b73a45..1f451c7 100644 --- a/Generation/JavaScript/Fundamentals/package.json +++ b/Generation/JavaScript/Fundamentals/package.json @@ -34,8 +34,8 @@ "prepublish": "yarn build" }, "dependencies": { - "@grpc/grpc-js": "^1.2.0", - "@types/google-protobuf": "^3.2.7", - "google-protobuf": "^3.11.4" + "@types/google-protobuf": "3.7.4", + "@grpc/grpc-js": "1.2.12", + "google-protobuf": "3.15.6" } } diff --git a/Generation/JavaScript/Runtime/package.json b/Generation/JavaScript/Runtime/package.json index 173f860..d3471e2 100644 --- a/Generation/JavaScript/Runtime/package.json +++ b/Generation/JavaScript/Runtime/package.json @@ -34,8 +34,8 @@ "prepublish": "yarn build" }, "dependencies": { - "@grpc/grpc-js": "^1.2.0", - "@types/google-protobuf": "^3.2.7", - "google-protobuf": "^3.11.4" + "@types/google-protobuf": "3.7.4", + "@grpc/grpc-js": "1.2.12", + "google-protobuf": "3.15.6" } } diff --git a/Generation/JavaScript/package.json b/Generation/JavaScript/package.json index 3453081..05508a8 100644 --- a/Generation/JavaScript/package.json +++ b/Generation/JavaScript/package.json @@ -5,7 +5,7 @@ "Runtime" ], "devDependencies": { - "@dolittle/protobuf.build": "3.1.2", + "@dolittle/protobuf.build": "3.1.3", "typescript": "^3.8.3" } } \ No newline at end of file From 37a52747267e6cb45660f1e07e5e0563dc074b27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Sat, 27 Mar 2021 17:35:00 +0100 Subject: [PATCH 25/50] Fix package.json config --- Generation/JavaScript/Fundamentals/package.json | 10 ---------- Generation/JavaScript/Runtime/package.json | 10 ---------- 2 files changed, 20 deletions(-) diff --git a/Generation/JavaScript/Fundamentals/package.json b/Generation/JavaScript/Fundamentals/package.json index 1f451c7..3e37b8c 100644 --- a/Generation/JavaScript/Fundamentals/package.json +++ b/Generation/JavaScript/Fundamentals/package.json @@ -19,16 +19,6 @@ "publishConfig": { "access": "public" }, - "files": [ - "lib", - "package.json", - "**/*.d.ts", - "**/*.ts", - "**/*.js" - ], - "main": "lib/index.js", - "types": "index.d.ts", - "typings": "index.d.ts", "scripts": { "build": "dolittle_proto_build grpc-node --skip-empty-files -O. -RFundamentals/: -I../../../Source ../../../Source/Fundamentals", "prepublish": "yarn build" diff --git a/Generation/JavaScript/Runtime/package.json b/Generation/JavaScript/Runtime/package.json index d3471e2..17acf4f 100644 --- a/Generation/JavaScript/Runtime/package.json +++ b/Generation/JavaScript/Runtime/package.json @@ -19,16 +19,6 @@ "publishConfig": { "access": "public" }, - "files": [ - "lib", - "package.json", - "**/*.d.ts", - "**/*.ts", - "**/*.js" - ], - "main": "lib/index.js", - "types": "index.d.ts", - "typings": "index.d.ts", "scripts": { "build": "dolittle_proto_build grpc-node --skip-empty-files -O. -RFundamentals/:pkg=@dolittle/contracts/: -RRuntime/: -I../../../Source ../../../Source/Runtime", "prepublish": "yarn build" From a01ba913b2b60943a92ad54ba5a1e9af7ef58054 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Sat, 27 Mar 2021 17:51:56 +0100 Subject: [PATCH 26/50] Update workflow to work with new generated contracts --- .github/workflows/ci.yml | 64 ++++++++++++---------------------------- 1 file changed, 19 insertions(+), 45 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e8c43f..d5ca0ec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,6 @@ jobs: pr-url: ${{ steps.context.outputs.pr-url }} version: ${{ steps.increment-version.outputs.next-version }} release-type: ${{ steps.context.outputs.release-type }} - steps: - uses: actions/checkout@v2 - name: Establish context @@ -40,7 +39,6 @@ jobs: name: .Net Build runs-on: ubuntu-latest needs: context - steps: - uses: actions/checkout@v2 - uses: actions/setup-dotnet@v1 @@ -48,7 +46,6 @@ jobs: dotnet-version: "3.1.x" - run: dotnet build -c Release - java-script-build: name: JavaScript Build runs-on: ubuntu-latest @@ -59,32 +56,21 @@ jobs: with: node-version: 12.x registry-url: 'https://registry.npmjs.org' - - uses: arduino/setup-protoc@master - with: - version: '3.11.2' - name: Install dependencies - working-directory: ./Generation + working-directory: ./Generation/JavaScript run: yarn - - name: Build Fundamentals - working-directory: ./Generation/Fundamentals/JavaScript + working-directory: ./Generation/JavaScript/Fundamentals run: yarn build - # - name: Build Fundamentals - Web - # working-directory: ./Generation/Fundamentals/JavaScript.Web - # run: yarn build - name: Build Runtime - working-directory: ./Generation/Runtime/JavaScript + working-directory: ./Generation/JavaScript/Runtime run: yarn build - # - name: Build Runtime - Web - # working-directory: ./Generation/Runtime/JavaScript.Web - # run: yarn build release: name: Release runs-on: ubuntu-latest needs: [dot-net-build, context] if: ${{ needs.context.outputs.should-publish == 'true' }} - steps: - uses: actions/checkout@v2 - name: Prepend to Changelog @@ -108,7 +94,6 @@ jobs: runs-on: ubuntu-latest needs: [context, dot-net-build] if: ${{ needs.context.outputs.should-publish == 'true' }} - steps: - uses: actions/checkout@v2 - uses: actions/setup-dotnet@v1 @@ -131,49 +116,38 @@ jobs: with: node-version: 12.x registry-url: 'https://registry.npmjs.org' - - uses: arduino/setup-protoc@master - with: - version: '3.11.2' - name: Install dependencies - working-directory: ./Generation + working-directory: ./Generation/JavaScript run: yarn - - - name: Parse semver string - uses: booxmedialtd/ws-action-parse-semver@v1 - id: semver_parser - with: - input_string: ${{ needs.context.outputs.version }} - - name: Build Fundamentals - working-directory: ./Generation/Fundamentals/JavaScript + working-directory: ./Generation/JavaScript/Fundamentals run: yarn build - name: Update Fundamentals version - working-directory: ./Generation/Fundamentals/JavaScript + working-directory: ./Generation/JavaScript/Fundamentals run: npm version ${{ needs.context.outputs.version }} - - # - name: Build Fundamentals - Web - # working-directory: ./Generation/Fundamentals/JavaScript.Web - # run: yarn build - - name: Build Runtime - working-directory: ./Generation/Runtime/JavaScript + working-directory: ./Generation/JavaScript/Runtime run: yarn build + - name: Add Fundamentals as dependency of Runtime + working-directory: ./Generation/JavaScript/Runtime + run: jq '.dependencies["@dolittle/contracts"] = "${{ needs.context.outputs.version }}"' package.json > package.json.tmp && mv package.json.tmp package.json - name: Update Runtime version - working-directory: ./Generation/Runtime/JavaScript + working-directory: ./Generation/JavaScript/Runtime run: npm version ${{ needs.context.outputs.version }} - - # - name: Build Runtime - Web - # working-directory: ./Generation/Runtime/JavaScript.Web - # run: yarn build - + - name: Extract tag from version + uses: actions-ecosystem/action-regex-match@v2 + id: tag_regex + with: + text: ${{ needs.context.outputs.version }} + regex: '^\d+\.\d+.\d+-([^.]+)\.\d+$' - name: Publish Fundamentals working-directory: ./Generation/Fundamentals/JavaScript - run: npm publish --tag ${{ needs.context.outputs.release-type == 'prerelease' && steps.semver_parser.outputs.prerelease || 'latest' }} + run: npm publish --tag ${{ needs.context.outputs.release-type == 'prerelease' && steps.tag_regex.outputs.group1 || 'latest' }} env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Publish Runtime working-directory: ./Generation/Runtime/JavaScript - run: npm publish --tag ${{ needs.context.outputs.release-type == 'prerelease' && steps.semver_parser.outputs.prerelease || 'latest' }} + run: npm publish --tag ${{ needs.context.outputs.release-type == 'prerelease' && steps.tag_regex.outputs.group1 || 'latest' }} env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} From 9e14cd72cf5d00d0f0dc5b62ee7ac73b65404af2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Sat, 27 Mar 2021 17:55:07 +0100 Subject: [PATCH 27/50] Fix moved CSharp directories --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d5ca0ec..2ae9b36 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,6 +45,7 @@ jobs: with: dotnet-version: "3.1.x" - run: dotnet build -c Release + working-directory: ./Generation/CSharp java-script-build: name: JavaScript Build @@ -100,9 +101,12 @@ jobs: with: dotnet-version: "3.1.x" - run: dotnet build + working-directory: ./Generation/CSharp - name: Create packages + working-directory: ./Generation/CSharp run: dotnet pack --configuration Release -o Artifacts/NuGet /p:PackageVersion=${{ needs.context.outputs.version }} -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg -p:NoDefaultExcludes=true - name: Push NuGet packages + working-directory: ./Generation/CSharp run: dotnet nuget push 'Artifacts/NuGet/*.nupkg' --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json java-script-release: From 1439989b74823208736d20c774f8e34cb72ff50f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Sat, 27 Mar 2021 17:57:43 +0100 Subject: [PATCH 28/50] Try node version 14 for fs/promises --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2ae9b36..98e8e4a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,7 +55,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v1 with: - node-version: 12.x + node-version: 14.x registry-url: 'https://registry.npmjs.org' - name: Install dependencies working-directory: ./Generation/JavaScript @@ -118,7 +118,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v1 with: - node-version: 12.x + node-version: 14.x registry-url: 'https://registry.npmjs.org' - name: Install dependencies working-directory: ./Generation/JavaScript From b17c6defe37fe1206e686608f239b666ceb4201a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Sat, 27 Mar 2021 23:06:45 +0100 Subject: [PATCH 29/50] Add go_package to protofiles --- Source/Fundamentals/Artifacts/Artifact.proto | 1 + Source/Fundamentals/Execution/ExecutionContext.proto | 1 + Source/Fundamentals/Protobuf/Failure.proto | 1 + Source/Fundamentals/Protobuf/Uuid.proto | 1 + Source/Fundamentals/Security/Claim.proto | 1 + Source/Fundamentals/Services/CallContext.proto | 1 + Source/Fundamentals/Services/Ping.proto | 1 + Source/Fundamentals/Services/ReverseCallContext.proto | 1 + Source/Fundamentals/Versioning/Version.proto | 1 + Source/Runtime/EventHorizon/Consumer.proto | 1 + Source/Runtime/EventHorizon/Subscriptions.proto | 1 + Source/Runtime/Events.Processing/EventHandlers.proto | 1 + Source/Runtime/Events.Processing/Filters.proto | 1 + Source/Runtime/Events.Processing/PartitionedFilters.proto | 1 + Source/Runtime/Events.Processing/Processors.proto | 1 + Source/Runtime/Events.Processing/Projections.proto | 1 + Source/Runtime/Events.Processing/PublicFilters.proto | 1 + Source/Runtime/Events.Processing/StreamEvent.proto | 1 + Source/Runtime/Events/Aggregate.proto | 1 + Source/Runtime/Events/Committed.proto | 1 + Source/Runtime/Events/EventStore.proto | 1 + Source/Runtime/Events/Uncommitted.proto | 1 + 22 files changed, 22 insertions(+) diff --git a/Source/Fundamentals/Artifacts/Artifact.proto b/Source/Fundamentals/Artifacts/Artifact.proto index b5f1231..937ed7d 100644 --- a/Source/Fundamentals/Artifacts/Artifact.proto +++ b/Source/Fundamentals/Artifacts/Artifact.proto @@ -8,6 +8,7 @@ import "Fundamentals/Protobuf/Uuid.proto"; package dolittle.artifacts; option csharp_namespace = "Dolittle.Artifacts.Contracts"; +option go_package = "go.dolittle.io/contracts/artifacts"; message Artifact { protobuf.Uuid id = 1; diff --git a/Source/Fundamentals/Execution/ExecutionContext.proto b/Source/Fundamentals/Execution/ExecutionContext.proto index 8d9855f..000aa91 100644 --- a/Source/Fundamentals/Execution/ExecutionContext.proto +++ b/Source/Fundamentals/Execution/ExecutionContext.proto @@ -10,6 +10,7 @@ import "Fundamentals/Versioning/Version.proto"; package dolittle.execution; option csharp_namespace = "Dolittle.Execution.Contracts"; +option go_package = "go.dolittle.io/contracts/execution"; message ExecutionContext { protobuf.Uuid microserviceId = 1; diff --git a/Source/Fundamentals/Protobuf/Failure.proto b/Source/Fundamentals/Protobuf/Failure.proto index 472eec2..c6939ca 100644 --- a/Source/Fundamentals/Protobuf/Failure.proto +++ b/Source/Fundamentals/Protobuf/Failure.proto @@ -8,6 +8,7 @@ import "Fundamentals/Protobuf/Uuid.proto"; package dolittle.protobuf; option csharp_namespace = "Dolittle.Protobuf.Contracts"; +option go_package = "go.dolittle.io/contracts/protobuf"; message Failure { Uuid id = 1; diff --git a/Source/Fundamentals/Protobuf/Uuid.proto b/Source/Fundamentals/Protobuf/Uuid.proto index 38146b1..7af073b 100644 --- a/Source/Fundamentals/Protobuf/Uuid.proto +++ b/Source/Fundamentals/Protobuf/Uuid.proto @@ -6,6 +6,7 @@ syntax = "proto3"; package dolittle.protobuf; option csharp_namespace = "Dolittle.Protobuf.Contracts"; +option go_package = "go.dolittle.io/contracts/protobuf"; message Uuid { bytes value = 1; diff --git a/Source/Fundamentals/Security/Claim.proto b/Source/Fundamentals/Security/Claim.proto index b43f4d7..2bb9178 100644 --- a/Source/Fundamentals/Security/Claim.proto +++ b/Source/Fundamentals/Security/Claim.proto @@ -6,6 +6,7 @@ syntax = "proto3"; package dolittle.security; option csharp_namespace = "Dolittle.Security.Contracts"; +option go_package = "go.dolittle.io/contracts/security"; message Claim { string key = 1; diff --git a/Source/Fundamentals/Services/CallContext.proto b/Source/Fundamentals/Services/CallContext.proto index 57dce8a..67e5646 100644 --- a/Source/Fundamentals/Services/CallContext.proto +++ b/Source/Fundamentals/Services/CallContext.proto @@ -9,6 +9,7 @@ import "Fundamentals/Protobuf/Uuid.proto"; package dolittle.services; option csharp_namespace = "Dolittle.Services.Contracts"; +option go_package = "go.dolittle.io/contracts/services"; message CallRequestContext { execution.ExecutionContext executionContext = 1; diff --git a/Source/Fundamentals/Services/Ping.proto b/Source/Fundamentals/Services/Ping.proto index 8842d57..bce6ad5 100644 --- a/Source/Fundamentals/Services/Ping.proto +++ b/Source/Fundamentals/Services/Ping.proto @@ -6,6 +6,7 @@ syntax = "proto3"; package dolittle.services; option csharp_namespace = "Dolittle.Services.Contracts"; +option go_package = "go.dolittle.io/contracts/services"; message Ping { diff --git a/Source/Fundamentals/Services/ReverseCallContext.proto b/Source/Fundamentals/Services/ReverseCallContext.proto index 2ba0294..ad8d760 100644 --- a/Source/Fundamentals/Services/ReverseCallContext.proto +++ b/Source/Fundamentals/Services/ReverseCallContext.proto @@ -10,6 +10,7 @@ import "google/protobuf/duration.proto"; package dolittle.services; option csharp_namespace = "Dolittle.Services.Contracts"; +option go_package = "go.dolittle.io/contracts/services"; message ReverseCallArgumentsContext { execution.ExecutionContext executionContext = 1; diff --git a/Source/Fundamentals/Versioning/Version.proto b/Source/Fundamentals/Versioning/Version.proto index e33a728..aaa088b 100644 --- a/Source/Fundamentals/Versioning/Version.proto +++ b/Source/Fundamentals/Versioning/Version.proto @@ -6,6 +6,7 @@ syntax = "proto3"; package dolittle.versioning; option csharp_namespace = "Dolittle.Versioning.Contracts"; +option go_package = "go.dolittle.io/contracts/versioning"; message Version { int32 major = 1; diff --git a/Source/Runtime/EventHorizon/Consumer.proto b/Source/Runtime/EventHorizon/Consumer.proto index 151bad4..d86a96d 100644 --- a/Source/Runtime/EventHorizon/Consumer.proto +++ b/Source/Runtime/EventHorizon/Consumer.proto @@ -13,6 +13,7 @@ import "Runtime/Events/Committed.proto"; package dolittle.runtime.eventhorizon; option csharp_namespace = "Dolittle.Runtime.EventHorizon.Contracts"; +option go_package = "go.dolittle.io/contracts/runtime/eventhorizon"; message EventHorizonEvent { uint64 streamSequenceNumber = 1; diff --git a/Source/Runtime/EventHorizon/Subscriptions.proto b/Source/Runtime/EventHorizon/Subscriptions.proto index f59e645..d6c1afc 100644 --- a/Source/Runtime/EventHorizon/Subscriptions.proto +++ b/Source/Runtime/EventHorizon/Subscriptions.proto @@ -10,6 +10,7 @@ import "Fundamentals/Protobuf/Failure.proto"; package dolittle.runtime.eventhorizon; option csharp_namespace = "Dolittle.Runtime.EventHorizon.Contracts"; +option go_package = "go.dolittle.io/contracts/runtime/eventhorizon"; message SubscriptionResponse { protobuf.Failure failure = 1; diff --git a/Source/Runtime/Events.Processing/EventHandlers.proto b/Source/Runtime/Events.Processing/EventHandlers.proto index 7aa4bce..11a4f7f 100644 --- a/Source/Runtime/Events.Processing/EventHandlers.proto +++ b/Source/Runtime/Events.Processing/EventHandlers.proto @@ -14,6 +14,7 @@ import "Runtime/Events.Processing/Processors.proto"; package dolittle.runtime.events.processing; option csharp_namespace = "Dolittle.Runtime.Events.Processing.Contracts"; +option go_package = "go.dolittle.io/contracts/runtime/events/processing"; message EventHandlerRegistrationRequest { services.ReverseCallArgumentsContext callContext = 1; diff --git a/Source/Runtime/Events.Processing/Filters.proto b/Source/Runtime/Events.Processing/Filters.proto index 89f3afe..39c6ca9 100644 --- a/Source/Runtime/Events.Processing/Filters.proto +++ b/Source/Runtime/Events.Processing/Filters.proto @@ -15,6 +15,7 @@ import "Runtime/Events.Processing/PublicFilters.proto"; package dolittle.runtime.events.processing; option csharp_namespace = "Dolittle.Runtime.Events.Processing.Contracts"; +option go_package = "go.dolittle.io/contracts/runtime/events/processing"; message FilterRegistrationResponse { protobuf.Failure failure = 1; diff --git a/Source/Runtime/Events.Processing/PartitionedFilters.proto b/Source/Runtime/Events.Processing/PartitionedFilters.proto index 0163b31..3474bfc 100644 --- a/Source/Runtime/Events.Processing/PartitionedFilters.proto +++ b/Source/Runtime/Events.Processing/PartitionedFilters.proto @@ -11,6 +11,7 @@ import "Runtime/Events.Processing/Processors.proto"; package dolittle.runtime.events.processing; option csharp_namespace = "Dolittle.Runtime.Events.Processing.Contracts"; +option go_package = "go.dolittle.io/contracts/runtime/events/processing"; message PartitionedFilterRegistrationRequest { services.ReverseCallArgumentsContext callContext = 1; diff --git a/Source/Runtime/Events.Processing/Processors.proto b/Source/Runtime/Events.Processing/Processors.proto index 560cb5d..399356d 100644 --- a/Source/Runtime/Events.Processing/Processors.proto +++ b/Source/Runtime/Events.Processing/Processors.proto @@ -13,6 +13,7 @@ import "google/protobuf/duration.proto"; package dolittle.runtime.events.processing; option csharp_namespace = "Dolittle.Runtime.Events.Processing.Contracts"; +option go_package = "go.dolittle.io/contracts/runtime/events/processing"; message ProcessorFailure { string reason = 1; diff --git a/Source/Runtime/Events.Processing/Projections.proto b/Source/Runtime/Events.Processing/Projections.proto index 3eb47d7..454d692 100644 --- a/Source/Runtime/Events.Processing/Projections.proto +++ b/Source/Runtime/Events.Processing/Projections.proto @@ -14,6 +14,7 @@ import "Runtime/Events.Processing/Processors.proto"; package dolittle.runtime.events.processing; option csharp_namespace = "Dolittle.Runtime.Events.Processing.Contracts"; +option go_package = "go.dolittle.io/contracts/runtime/events/processing"; enum ProjectionEventKeySelectorType { EVENT_SOURCE_ID = 0; diff --git a/Source/Runtime/Events.Processing/PublicFilters.proto b/Source/Runtime/Events.Processing/PublicFilters.proto index d844bd9..16b6912 100644 --- a/Source/Runtime/Events.Processing/PublicFilters.proto +++ b/Source/Runtime/Events.Processing/PublicFilters.proto @@ -11,6 +11,7 @@ import "Runtime/Events.Processing/PartitionedFilters.proto"; package dolittle.runtime.events.processing; option csharp_namespace = "Dolittle.Runtime.Events.Processing.Contracts"; +option go_package = "go.dolittle.io/contracts/runtime/events/processing"; message PublicFilterRegistrationRequest { services.ReverseCallArgumentsContext callContext = 1; diff --git a/Source/Runtime/Events.Processing/StreamEvent.proto b/Source/Runtime/Events.Processing/StreamEvent.proto index 19bf3e1..0ef1fb5 100644 --- a/Source/Runtime/Events.Processing/StreamEvent.proto +++ b/Source/Runtime/Events.Processing/StreamEvent.proto @@ -9,6 +9,7 @@ import "Runtime/Events/Committed.proto"; package dolittle.runtime.events.processing; option csharp_namespace = "Dolittle.Runtime.Events.Processing.Contracts"; +option go_package = "go.dolittle.io/contracts/runtime/events/processing"; message StreamEvent { runtime.events.CommittedEvent event = 1; diff --git a/Source/Runtime/Events/Aggregate.proto b/Source/Runtime/Events/Aggregate.proto index 0f90dc1..51a68dd 100644 --- a/Source/Runtime/Events/Aggregate.proto +++ b/Source/Runtime/Events/Aggregate.proto @@ -8,6 +8,7 @@ import "Fundamentals/Protobuf/Uuid.proto"; package dolittle.runtime.events; option csharp_namespace = "Dolittle.Runtime.Events.Contracts"; +option go_package = "go.dolittle.io/contracts/runtime/events"; message Aggregate { protobuf.Uuid eventSourceId = 1; diff --git a/Source/Runtime/Events/Committed.proto b/Source/Runtime/Events/Committed.proto index 44ad071..9ba3bfb 100644 --- a/Source/Runtime/Events/Committed.proto +++ b/Source/Runtime/Events/Committed.proto @@ -11,6 +11,7 @@ import "google/protobuf/timestamp.proto"; package dolittle.runtime.events; option csharp_namespace = "Dolittle.Runtime.Events.Contracts"; +option go_package = "go.dolittle.io/contracts/runtime/events"; message CommittedEvent { uint64 eventLogSequenceNumber = 1; diff --git a/Source/Runtime/Events/EventStore.proto b/Source/Runtime/Events/EventStore.proto index 4097558..34a5195 100644 --- a/Source/Runtime/Events/EventStore.proto +++ b/Source/Runtime/Events/EventStore.proto @@ -12,6 +12,7 @@ import "Runtime/Events/Uncommitted.proto"; package dolittle.runtime.events; option csharp_namespace = "Dolittle.Runtime.Events.Contracts"; +option go_package = "go.dolittle.io/contracts/runtime/events"; message CommitEventsRequest { services.CallRequestContext callContext = 1; diff --git a/Source/Runtime/Events/Uncommitted.proto b/Source/Runtime/Events/Uncommitted.proto index 7584c05..e446232 100644 --- a/Source/Runtime/Events/Uncommitted.proto +++ b/Source/Runtime/Events/Uncommitted.proto @@ -9,6 +9,7 @@ import "Fundamentals/Protobuf/Uuid.proto"; package dolittle.runtime.events; option csharp_namespace = "Dolittle.Runtime.Events.Contracts"; +option go_package = "go.dolittle.io/contracts/runtime/events"; message UncommittedEvent { artifacts.Artifact artifact = 1; From 97140f12a392a0b8d3cd8943e60096bde06e15f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Sat, 27 Mar 2021 23:26:37 +0100 Subject: [PATCH 30/50] Add a Go build job (just to see if we have sed) --- .github/workflows/ci.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 98e8e4a..f909352 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,6 +67,17 @@ jobs: working-directory: ./Generation/JavaScript/Runtime run: yarn build + golang-build: + name: Go Build + runs-on: ubuntu-latest + needs: context + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: '1.16.2' + - run: which sed + release: name: Release runs-on: ubuntu-latest From db5d80e26a5e9fe1f5a681fe4a080c5add54a410 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Sat, 27 Mar 2021 23:48:08 +0100 Subject: [PATCH 31/50] Add go generate.sh script --- .github/workflows/ci.yml | 4 +++- .gitignore | 5 ++++- Generation/Go/generate.sh | 47 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 2 deletions(-) create mode 100755 Generation/Go/generate.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f909352..662dfae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,7 +76,9 @@ jobs: - uses: actions/setup-go@v2 with: go-version: '1.16.2' - - run: which sed + - name: Generate code + working-directory: ./Generation/Go + run: ./generate.sh release: name: Release diff --git a/.gitignore b/.gitignore index c4f1d1a..778f5ee 100644 --- a/.gitignore +++ b/.gitignore @@ -355,9 +355,12 @@ package-json.lock *.cs *.ts +!Source/**/Artifacts + Generation/JavaScript/Fundamentals/** Generation/JavaScript/Runtime/** !Generation/JavaScript/**/package.json !Generation/JavaScript/**/tsconfig.json -!Source/**/Artifacts \ No newline at end of file +Generation/Go/* +!Generation/Go/generate.sh diff --git a/Generation/Go/generate.sh b/Generation/Go/generate.sh new file mode 100755 index 0000000..577eb22 --- /dev/null +++ b/Generation/Go/generate.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +VERSION_PATTERN='^([0-9]+)\.[0-9]+\.[0-9]+(-[^\.]+\.[0-9]+)?$' +if [[ ! "$1" =~ $VERSION_PATTERN ]]; then + echo "Error: Could not parse $1 as a semantic version." + exit 1 +fi +MAJOR_VERSION="${BASH_REMATCH[1]}" + +clean_directory () { + if [[ -e "$1" ]]; then + rm -r "$1" + fi + mkdir -p "$1" +} + +echo "Adding major version $MAJOR_VERSION in package paths..." +clean_directory "./versioned" +SOURCE_DIRECTORY='../../Source' +PACKAGE_PATTERN='^(option go_package = "go.dolittle.io\/contracts)(\/[^"]*";)$' +find "$SOURCE_DIRECTORY" -name '*.proto' | while read PROTOFILE; do + if ! egrep -q "$PACKAGE_PATTERN" "$PROTOFILE"; then + echo "Error: go_package was not found in $PROTOFILE. Will stop to not publish wrong package version." + exit 1 + fi + OUTFILE="./versioned/$(realpath --relative-to="$SOURCE_DIRECTORY" "$PROTOFILE")" + mkdir -p $(dirname "$OUTFILE") + sed -r "s/$PACKAGE_PATTERN/\1\/v$MAJOR_VERSION\2/g" "./$PROTOFILE" > "$OUTFILE" + echo "Added major version for $PROTOFILE" +done + +echo "Generating Go code..." +clean_directory "./generated" +find ./versioned -name '*.proto' | while read PROTOFILE; do + protoc --proto_path=./versioned \ + --go_out=./generated --go_opt=module="go.dolittle.io/contracts/v$MAJOR_VERSION" \ + --go-grpc_out=./generated --go-grpc_opt=module="go.dolittle.io/contracts/v$MAJOR_VERSION" \ + "$PROTOFILE" + echo "Generated code Go for $PROTOFILE" +done + +echo "Initializing Go module and resolving dependencies..." +cd ./generated +go mod init "go.dolittle.io/contracts/v$MAJOR_VERSION" +go mod tidy +go build -v ./... +cd .. From 2f7b939c18c5a175cac09a091adfcef703fabe63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Sat, 27 Mar 2021 23:55:18 +0100 Subject: [PATCH 32/50] Allow generation when not publishing --- Generation/Go/generate.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Generation/Go/generate.sh b/Generation/Go/generate.sh index 577eb22..2ca7117 100755 --- a/Generation/Go/generate.sh +++ b/Generation/Go/generate.sh @@ -1,11 +1,15 @@ #!/bin/bash VERSION_PATTERN='^([0-9]+)\.[0-9]+\.[0-9]+(-[^\.]+\.[0-9]+)?$' -if [[ ! "$1" =~ $VERSION_PATTERN ]]; then +if [[ -z "$1" ]]; then + echo "Warning: version not provided - using v0 as major version. This code must not be published!" + MAJOR_VERSION="0" +elif [[ ! "$1" =~ $VERSION_PATTERN ]]; then echo "Error: Could not parse $1 as a semantic version." exit 1 +else + MAJOR_VERSION="${BASH_REMATCH[1]}" fi -MAJOR_VERSION="${BASH_REMATCH[1]}" clean_directory () { if [[ -e "$1" ]]; then From 3d106af69f0c7831002442e71861145aa9804fb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Sat, 27 Mar 2021 23:58:11 +0100 Subject: [PATCH 33/50] Bail out on failure --- Generation/Go/generate.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/Generation/Go/generate.sh b/Generation/Go/generate.sh index 2ca7117..1d5f2fe 100755 --- a/Generation/Go/generate.sh +++ b/Generation/Go/generate.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -e VERSION_PATTERN='^([0-9]+)\.[0-9]+\.[0-9]+(-[^\.]+\.[0-9]+)?$' if [[ -z "$1" ]]; then From 788a9992fcb2fa37128dadc8c5f6212ccbce4023 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Sun, 28 Mar 2021 00:00:44 +0100 Subject: [PATCH 34/50] Install protoc --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 662dfae..40e4286 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,6 +76,9 @@ jobs: - uses: actions/setup-go@v2 with: go-version: '1.16.2' + - uses: arduino/setup-protoc@v1 + with: + version: '3.15.6' - name: Generate code working-directory: ./Generation/Go run: ./generate.sh From 8258a5be7d77db134386bdab300cde6e51b6d7c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Sun, 28 Mar 2021 00:02:01 +0100 Subject: [PATCH 35/50] Install protoc plugins --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 40e4286..c8a2a88 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,6 +79,7 @@ jobs: - uses: arduino/setup-protoc@v1 with: version: '3.15.6' + - run: go get google.golang.org/protobuf/cmd/protoc-gen-go google.golang.org/grpc/cmd/protoc-gen-go-grpc - name: Generate code working-directory: ./Generation/Go run: ./generate.sh From 8eb9a1437536b29abbea143f72ad51a49e3ce66a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Sun, 28 Mar 2021 00:12:12 +0100 Subject: [PATCH 36/50] Test checking out other repository in workflow --- .github/workflows/ci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c8a2a88..18832b8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,6 +83,14 @@ jobs: - name: Generate code working-directory: ./Generation/Go run: ./generate.sh + - uses: actions/checkout@v2 + with: + repository: dolittle/Go.Contracts + path: ./Generation/Go/output + - working-directory: ./Generation/Go/output + run: ls -l + - working-directory: ./Generation/Go/output + run: git log release: name: Release From b6b4ec19583a530f3c78ea4392b494d1637a0c81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Sun, 28 Mar 2021 00:28:05 +0100 Subject: [PATCH 37/50] Add Go release job --- .github/workflows/ci.yml | 47 ++++++++++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 18832b8..037f432 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -82,15 +82,7 @@ jobs: - run: go get google.golang.org/protobuf/cmd/protoc-gen-go google.golang.org/grpc/cmd/protoc-gen-go-grpc - name: Generate code working-directory: ./Generation/Go - run: ./generate.sh - - uses: actions/checkout@v2 - with: - repository: dolittle/Go.Contracts - path: ./Generation/Go/output - - working-directory: ./Generation/Go/output - run: ls -l - - working-directory: ./Generation/Go/output - run: git log + run: ./generate.sh ${{ needs.context.outputs.version }} release: name: Release @@ -180,3 +172,40 @@ jobs: env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + golang-release: + name: Go Release + runs-on: ubuntu-latest + needs: [context, golang-build] + if: ${{ needs.context.outputs.should-publish == 'true' }} + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: '1.16.2' + - uses: arduino/setup-protoc@v1 + with: + version: '3.15.6' + - run: go get google.golang.org/protobuf/cmd/protoc-gen-go google.golang.org/grpc/cmd/protoc-gen-go-grpc + - name: Generate code + working-directory: ./Generation/Go + run: ./generate.sh ${{ needs.context.outputs.version }} + - uses: actions/checkout@v2 + with: + repository: dolittle/Go.Contracts + path: ./Generation/Go/output + - name: Cleanout old released code + working-directory: ./Generation/Go/output + run: rm * && git checkout -- README.md LICENSE + - name: Copy new generated code + working-directory: ./Generation/Go/ + run: cp -r generated/* output + - name: Commit new generated code and tag as release + working-directory: ./Generation/Go/output + run: | + git config user.name "Contracts Release GitHub Actions" + git config user.email "contracts-release@dolittle.com" + git add . + git commit -m "Generated code for ${{ needs.context.outputs.version }}" + git tag "v${{ needs.context.outputs.version }}" + git push + git push --tags From 5765813bf7575a2ea114343359948163655eb85a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Sun, 28 Mar 2021 00:38:34 +0100 Subject: [PATCH 38/50] Add GitHub token for Go.Contracts --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 037f432..55ad89a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -192,6 +192,7 @@ jobs: - uses: actions/checkout@v2 with: repository: dolittle/Go.Contracts + token: ${{ secrets.BUILD_PAT }} path: ./Generation/Go/output - name: Cleanout old released code working-directory: ./Generation/Go/output From 1cd937041a095e8f3cf2fe4c607ebb48f2a1e741 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Sun, 28 Mar 2021 00:40:15 +0100 Subject: [PATCH 39/50] Change workflow to only release code if all builds succeeded --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 55ad89a..3a6acb2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,7 +87,7 @@ jobs: release: name: Release runs-on: ubuntu-latest - needs: [dot-net-build, context] + needs: [context, dot-net-build, java-script-build, golang-build] if: ${{ needs.context.outputs.should-publish == 'true' }} steps: - uses: actions/checkout@v2 @@ -110,7 +110,7 @@ jobs: dot-net-release: name: .Net Release runs-on: ubuntu-latest - needs: [context, dot-net-build] + needs: [context, release] if: ${{ needs.context.outputs.should-publish == 'true' }} steps: - uses: actions/checkout@v2 @@ -129,7 +129,7 @@ jobs: java-script-release: name: JavaScript Release runs-on: ubuntu-latest - needs: [context, java-script-build] + needs: [context, release] if: ${{ needs.context.outputs.should-publish == 'true' }} steps: - uses: actions/checkout@v2 @@ -175,7 +175,7 @@ jobs: golang-release: name: Go Release runs-on: ubuntu-latest - needs: [context, golang-build] + needs: [context, release] if: ${{ needs.context.outputs.should-publish == 'true' }} steps: - uses: actions/checkout@v2 From 67a641cd48673de9fda3599d24fbe6846de3d6b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Sun, 28 Mar 2021 00:46:27 +0100 Subject: [PATCH 40/50] Fix JS release --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3a6acb2..f8c1243 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -162,12 +162,12 @@ jobs: text: ${{ needs.context.outputs.version }} regex: '^\d+\.\d+.\d+-([^.]+)\.\d+$' - name: Publish Fundamentals - working-directory: ./Generation/Fundamentals/JavaScript + working-directory: ./Generation/JavaScript/Fundamentals run: npm publish --tag ${{ needs.context.outputs.release-type == 'prerelease' && steps.tag_regex.outputs.group1 || 'latest' }} env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Publish Runtime - working-directory: ./Generation/Runtime/JavaScript + working-directory: ./Generation/JavaScript/Runtime run: npm publish --tag ${{ needs.context.outputs.release-type == 'prerelease' && steps.tag_regex.outputs.group1 || 'latest' }} env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} From ef4174f0f51fd942f8ff7e84f3fb9f7eb3e5ed49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Sun, 28 Mar 2021 00:50:56 +0100 Subject: [PATCH 41/50] Delete directories when cleaning out Go code --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f8c1243..726a190 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -196,7 +196,7 @@ jobs: path: ./Generation/Go/output - name: Cleanout old released code working-directory: ./Generation/Go/output - run: rm * && git checkout -- README.md LICENSE + run: rm -r * && git checkout -- README.md LICENSE - name: Copy new generated code working-directory: ./Generation/Go/ run: cp -r generated/* output From 66d97e8585be8303b9b9f1eda79c3a14fe4df436 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Sun, 28 Mar 2021 00:58:53 +0100 Subject: [PATCH 42/50] Allow empty commits when releasing Go --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 726a190..29174cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -206,7 +206,7 @@ jobs: git config user.name "Contracts Release GitHub Actions" git config user.email "contracts-release@dolittle.com" git add . - git commit -m "Generated code for ${{ needs.context.outputs.version }}" + git commit --allow-empty -m "Generated code for ${{ needs.context.outputs.version }}" git tag "v${{ needs.context.outputs.version }}" git push git push --tags From f33cf53796bc107f1c3568a777ad9edd2c666106 Mon Sep 17 00:00:00 2001 From: woksin Date: Mon, 29 Mar 2021 11:15:49 +0200 Subject: [PATCH 43/50] First iteration for getting projections --- Source/Runtime/Projections/Projections.proto | 43 ++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 Source/Runtime/Projections/Projections.proto diff --git a/Source/Runtime/Projections/Projections.proto b/Source/Runtime/Projections/Projections.proto new file mode 100644 index 0000000..9e5b4c8 --- /dev/null +++ b/Source/Runtime/Projections/Projections.proto @@ -0,0 +1,43 @@ +// Copyright (c) Dolittle. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +syntax = "proto3"; + +import "Fundamentals/Protobuf/Failure.proto"; +import "Fundamentals/Services/CallContext.proto"; +import "Runtime/Events.Processing/Projections.proto"; + +package dolittle.runtime.projections; + +option csharp_namespace = "Dolittle.Runtime.Projections.Contracts"; +option go_package = "go.dolittle.io/contracts/runtime/projections"; + +message GetOneRequest { + services.CallRequestContext callContext = 1; + protobuf.Uuid scopeId = 2; + protobuf.Uuid projectionId = 3; + string key = 4; +} + +message GetAllRequest { + services.CallRequestContext callContext = 1; + protobuf.Uuid scopeId = 2; + protobuf.Uuid projectionId = 3; +} + +message GetOneResponse { + protobuf.Failure failure = 1; // not set if not failed + events.processing.ProjectionCurrentState state = 2; +} + +message GetAllResponse { + protobuf.Failure failure = 1; // not set if not failed + repeated events.processing.ProjectionCurrentState states = 2; +} + + +// Represents the Projections service +service Projections { + rpc Get(GetOneRequest) returns(GetOneResponse); + rpc All(GetAllRequest) returns(GetAllResponse); +} From db48e828e7d9dea12c0e2a939d553c7dd079072c Mon Sep 17 00:00:00 2001 From: woksin Date: Mon, 29 Mar 2021 11:20:11 +0200 Subject: [PATCH 44/50] Add missing import --- Source/Runtime/Projections/Projections.proto | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Runtime/Projections/Projections.proto b/Source/Runtime/Projections/Projections.proto index 9e5b4c8..ec9297b 100644 --- a/Source/Runtime/Projections/Projections.proto +++ b/Source/Runtime/Projections/Projections.proto @@ -4,6 +4,7 @@ syntax = "proto3"; import "Fundamentals/Protobuf/Failure.proto"; +import "Fundamentals/Protobuf/Uuid.proto"; import "Fundamentals/Services/CallContext.proto"; import "Runtime/Events.Processing/Projections.proto"; From f910726cc0cb4f618f2349956c1e19c60e6c7c13 Mon Sep 17 00:00:00 2001 From: woksin Date: Mon, 29 Mar 2021 11:35:04 +0200 Subject: [PATCH 45/50] GetOne GetAll --- Source/Runtime/Projections/Projections.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Runtime/Projections/Projections.proto b/Source/Runtime/Projections/Projections.proto index ec9297b..8e04a11 100644 --- a/Source/Runtime/Projections/Projections.proto +++ b/Source/Runtime/Projections/Projections.proto @@ -39,6 +39,6 @@ message GetAllResponse { // Represents the Projections service service Projections { - rpc Get(GetOneRequest) returns(GetOneResponse); - rpc All(GetAllRequest) returns(GetAllResponse); + rpc GetOne(GetOneRequest) returns(GetOneResponse); + rpc GetAll(GetAllRequest) returns(GetAllResponse); } From d74dea11d8d8744688d8b2dac4c479b257fae710 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Wed, 7 Apr 2021 19:24:54 +0200 Subject: [PATCH 46/50] Move projection Key from Request -> CurrentState So that the same structure can be reused in the Store. --- Source/Runtime/Events.Processing/Projections.proto | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/Runtime/Events.Processing/Projections.proto b/Source/Runtime/Events.Processing/Projections.proto index 454d692..3b92df9 100644 --- a/Source/Runtime/Events.Processing/Projections.proto +++ b/Source/Runtime/Events.Processing/Projections.proto @@ -75,15 +75,15 @@ enum ProjectionCurrentStateType { message ProjectionCurrentState { ProjectionCurrentStateType type = 1; - string state = 2; + string key = 2; + string state = 3; } message ProjectionRequest { services.ReverseCallRequestContext callContext = 1; - string key = 2; - ProjectionCurrentState currentState = 3; - StreamEvent event = 4; - RetryProcessingState retryProcessingState = 5; + ProjectionCurrentState currentState = 2; + StreamEvent event = 3; + RetryProcessingState retryProcessingState = 4; } message ProjectionRuntimeToClientMessage { From 4b5132bcc3a7867cd5959ab43507a72f3a554ad1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Wed, 7 Apr 2021 19:25:20 +0200 Subject: [PATCH 47/50] It has become somewhat of a convention for the failure to go last. --- Source/Runtime/Projections/Projections.proto | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Runtime/Projections/Projections.proto b/Source/Runtime/Projections/Projections.proto index 8e04a11..16926d1 100644 --- a/Source/Runtime/Projections/Projections.proto +++ b/Source/Runtime/Projections/Projections.proto @@ -27,13 +27,13 @@ message GetAllRequest { } message GetOneResponse { - protobuf.Failure failure = 1; // not set if not failed - events.processing.ProjectionCurrentState state = 2; + events.processing.ProjectionCurrentState state = 1; + protobuf.Failure failure = 2; // not set if not failed } message GetAllResponse { - protobuf.Failure failure = 1; // not set if not failed - repeated events.processing.ProjectionCurrentState states = 2; + repeated events.processing.ProjectionCurrentState states = 1; + protobuf.Failure failure = 2; // not set if not failed } From 8800f36ca60d5c7d761882c54d9999c39595f5c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Wed, 7 Apr 2021 19:35:03 +0200 Subject: [PATCH 48/50] Move the CurrentState over to Projections + rename some files --- .../Events.Processing/Projections.proto | 14 ++----------- Source/Runtime/Projections/State.proto | 20 +++++++++++++++++++ .../{Projections.proto => Store.proto} | 6 +++--- 3 files changed, 25 insertions(+), 15 deletions(-) create mode 100644 Source/Runtime/Projections/State.proto rename Source/Runtime/Projections/{Projections.proto => Store.proto} (86%) diff --git a/Source/Runtime/Events.Processing/Projections.proto b/Source/Runtime/Events.Processing/Projections.proto index 3b92df9..359943a 100644 --- a/Source/Runtime/Events.Processing/Projections.proto +++ b/Source/Runtime/Events.Processing/Projections.proto @@ -10,6 +10,7 @@ import "Fundamentals/Services/ReverseCallContext.proto"; import "Fundamentals/Services/Ping.proto"; import "Runtime/Events.Processing/StreamEvent.proto"; import "Runtime/Events.Processing/Processors.proto"; +import "Runtime/Projections/State.proto"; package dolittle.runtime.events.processing; @@ -68,20 +69,9 @@ message ProjectionRegistrationResponse { protobuf.Failure failure = 1; } -enum ProjectionCurrentStateType { - CREATED_FROM_INITIAL_STATE = 0; - PERSISTED = 1; -} - -message ProjectionCurrentState { - ProjectionCurrentStateType type = 1; - string key = 2; - string state = 3; -} - message ProjectionRequest { services.ReverseCallRequestContext callContext = 1; - ProjectionCurrentState currentState = 2; + projections.ProjectionCurrentState currentState = 2; StreamEvent event = 3; RetryProcessingState retryProcessingState = 4; } diff --git a/Source/Runtime/Projections/State.proto b/Source/Runtime/Projections/State.proto new file mode 100644 index 0000000..58ddb1c --- /dev/null +++ b/Source/Runtime/Projections/State.proto @@ -0,0 +1,20 @@ +// Copyright (c) Dolittle. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +syntax = "proto3"; + +package dolittle.runtime.projections; + +option csharp_namespace = "Dolittle.Runtime.Projections.Contracts"; +option go_package = "go.dolittle.io/contracts/runtime/projections"; + +enum ProjectionCurrentStateType { + CREATED_FROM_INITIAL_STATE = 0; + PERSISTED = 1; +} + +message ProjectionCurrentState { + ProjectionCurrentStateType type = 1; + string key = 2; + string state = 3; +} \ No newline at end of file diff --git a/Source/Runtime/Projections/Projections.proto b/Source/Runtime/Projections/Store.proto similarity index 86% rename from Source/Runtime/Projections/Projections.proto rename to Source/Runtime/Projections/Store.proto index 16926d1..c59b929 100644 --- a/Source/Runtime/Projections/Projections.proto +++ b/Source/Runtime/Projections/Store.proto @@ -6,7 +6,7 @@ syntax = "proto3"; import "Fundamentals/Protobuf/Failure.proto"; import "Fundamentals/Protobuf/Uuid.proto"; import "Fundamentals/Services/CallContext.proto"; -import "Runtime/Events.Processing/Projections.proto"; +import "Runtime/Projections/State.proto"; package dolittle.runtime.projections; @@ -27,12 +27,12 @@ message GetAllRequest { } message GetOneResponse { - events.processing.ProjectionCurrentState state = 1; + ProjectionCurrentState state = 1; protobuf.Failure failure = 2; // not set if not failed } message GetAllResponse { - repeated events.processing.ProjectionCurrentState states = 1; + repeated ProjectionCurrentState states = 1; protobuf.Failure failure = 2; // not set if not failed } From 2b5b27b074aacf5b95ffbb077088b1b51eee5ac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Wed, 7 Apr 2021 19:37:20 +0200 Subject: [PATCH 49/50] One missing newline forcing me to fix everywhere --- Source/Fundamentals/Execution/ExecutionContext.proto | 2 +- Source/Fundamentals/Protobuf/Failure.proto | 2 +- Source/Fundamentals/Protobuf/Uuid.proto | 2 +- Source/Fundamentals/Security/Claim.proto | 2 +- Source/Fundamentals/Services/CallContext.proto | 2 +- Source/Fundamentals/Services/Ping.proto | 4 +--- Source/Fundamentals/Services/ReverseCallContext.proto | 2 +- Source/Fundamentals/Versioning/Version.proto | 2 +- Source/Runtime/EventHorizon/Consumer.proto | 3 ++- Source/Runtime/EventHorizon/Subscriptions.proto | 2 +- Source/Runtime/Events.Processing/Filters.proto | 2 +- Source/Runtime/Events/Aggregate.proto | 2 +- Source/Runtime/Projections/State.proto | 2 +- 13 files changed, 14 insertions(+), 15 deletions(-) diff --git a/Source/Fundamentals/Execution/ExecutionContext.proto b/Source/Fundamentals/Execution/ExecutionContext.proto index 000aa91..47233f0 100644 --- a/Source/Fundamentals/Execution/ExecutionContext.proto +++ b/Source/Fundamentals/Execution/ExecutionContext.proto @@ -19,4 +19,4 @@ message ExecutionContext { protobuf.Uuid correlationId = 4; repeated security.Claim claims = 5; string environment = 6; -} \ No newline at end of file +} diff --git a/Source/Fundamentals/Protobuf/Failure.proto b/Source/Fundamentals/Protobuf/Failure.proto index c6939ca..7ece312 100644 --- a/Source/Fundamentals/Protobuf/Failure.proto +++ b/Source/Fundamentals/Protobuf/Failure.proto @@ -13,4 +13,4 @@ option go_package = "go.dolittle.io/contracts/protobuf"; message Failure { Uuid id = 1; string reason = 2; -} \ No newline at end of file +} diff --git a/Source/Fundamentals/Protobuf/Uuid.proto b/Source/Fundamentals/Protobuf/Uuid.proto index 7af073b..c622326 100644 --- a/Source/Fundamentals/Protobuf/Uuid.proto +++ b/Source/Fundamentals/Protobuf/Uuid.proto @@ -10,4 +10,4 @@ option go_package = "go.dolittle.io/contracts/protobuf"; message Uuid { bytes value = 1; -} \ No newline at end of file +} diff --git a/Source/Fundamentals/Security/Claim.proto b/Source/Fundamentals/Security/Claim.proto index 2bb9178..659dbcb 100644 --- a/Source/Fundamentals/Security/Claim.proto +++ b/Source/Fundamentals/Security/Claim.proto @@ -12,4 +12,4 @@ message Claim { string key = 1; string value = 2; string valueType = 3; -} \ No newline at end of file +} diff --git a/Source/Fundamentals/Services/CallContext.proto b/Source/Fundamentals/Services/CallContext.proto index 67e5646..6adb17d 100644 --- a/Source/Fundamentals/Services/CallContext.proto +++ b/Source/Fundamentals/Services/CallContext.proto @@ -14,4 +14,4 @@ option go_package = "go.dolittle.io/contracts/services"; message CallRequestContext { execution.ExecutionContext executionContext = 1; protobuf.Uuid headId = 2; -} \ No newline at end of file +} diff --git a/Source/Fundamentals/Services/Ping.proto b/Source/Fundamentals/Services/Ping.proto index bce6ad5..5350864 100644 --- a/Source/Fundamentals/Services/Ping.proto +++ b/Source/Fundamentals/Services/Ping.proto @@ -9,9 +9,7 @@ option csharp_namespace = "Dolittle.Services.Contracts"; option go_package = "go.dolittle.io/contracts/services"; message Ping { - } message Pong { - -} \ No newline at end of file +} diff --git a/Source/Fundamentals/Services/ReverseCallContext.proto b/Source/Fundamentals/Services/ReverseCallContext.proto index ad8d760..6ce944b 100644 --- a/Source/Fundamentals/Services/ReverseCallContext.proto +++ b/Source/Fundamentals/Services/ReverseCallContext.proto @@ -25,4 +25,4 @@ message ReverseCallRequestContext { message ReverseCallResponseContext { protobuf.Uuid callId = 1; -} \ No newline at end of file +} diff --git a/Source/Fundamentals/Versioning/Version.proto b/Source/Fundamentals/Versioning/Version.proto index aaa088b..aab50fc 100644 --- a/Source/Fundamentals/Versioning/Version.proto +++ b/Source/Fundamentals/Versioning/Version.proto @@ -14,4 +14,4 @@ message Version { int32 patch = 3; int32 build = 4; string preReleaseString = 5; -} \ No newline at end of file +} diff --git a/Source/Runtime/EventHorizon/Consumer.proto b/Source/Runtime/EventHorizon/Consumer.proto index d86a96d..b0f37ae 100644 --- a/Source/Runtime/EventHorizon/Consumer.proto +++ b/Source/Runtime/EventHorizon/Consumer.proto @@ -52,6 +52,7 @@ message EventHorizonProducerToConsumerMessage { services.Ping ping = 3; } } + service Consumer { rpc Subscribe(stream EventHorizonConsumerToProducerMessage) returns(stream EventHorizonProducerToConsumerMessage); -} \ No newline at end of file +} diff --git a/Source/Runtime/EventHorizon/Subscriptions.proto b/Source/Runtime/EventHorizon/Subscriptions.proto index d6c1afc..a63c9ea 100644 --- a/Source/Runtime/EventHorizon/Subscriptions.proto +++ b/Source/Runtime/EventHorizon/Subscriptions.proto @@ -28,4 +28,4 @@ message Subscription { service Subscriptions { rpc Subscribe(Subscription) returns(SubscriptionResponse); -} \ No newline at end of file +} diff --git a/Source/Runtime/Events.Processing/Filters.proto b/Source/Runtime/Events.Processing/Filters.proto index 39c6ca9..568b084 100644 --- a/Source/Runtime/Events.Processing/Filters.proto +++ b/Source/Runtime/Events.Processing/Filters.proto @@ -60,4 +60,4 @@ service Filters { rpc Connect(stream FilterClientToRuntimeMessage) returns(stream FilterRuntimeToClientMessage); rpc ConnectPartitioned(stream PartitionedFilterClientToRuntimeMessage) returns (stream FilterRuntimeToClientMessage); rpc ConnectPublic(stream PublicFilterClientToRuntimeMessage) returns (stream FilterRuntimeToClientMessage); -} \ No newline at end of file +} diff --git a/Source/Runtime/Events/Aggregate.proto b/Source/Runtime/Events/Aggregate.proto index 51a68dd..017b020 100644 --- a/Source/Runtime/Events/Aggregate.proto +++ b/Source/Runtime/Events/Aggregate.proto @@ -13,4 +13,4 @@ option go_package = "go.dolittle.io/contracts/runtime/events"; message Aggregate { protobuf.Uuid eventSourceId = 1; protobuf.Uuid aggregateRootId = 2; -} \ No newline at end of file +} diff --git a/Source/Runtime/Projections/State.proto b/Source/Runtime/Projections/State.proto index 58ddb1c..1b8ca73 100644 --- a/Source/Runtime/Projections/State.proto +++ b/Source/Runtime/Projections/State.proto @@ -17,4 +17,4 @@ message ProjectionCurrentState { ProjectionCurrentStateType type = 1; string key = 2; string state = 3; -} \ No newline at end of file +} From f6295b538c717a164095364036014328430e1167 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20H=C3=B8genes?= <1014990+jakhog@users.noreply.github.com> Date: Thu, 8 Apr 2021 13:18:57 +0200 Subject: [PATCH 50/50] Changed enums to oneofs --- .../Events.Processing/Projections.proto | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/Source/Runtime/Events.Processing/Projections.proto b/Source/Runtime/Events.Processing/Projections.proto index 359943a..f69d1c1 100644 --- a/Source/Runtime/Events.Processing/Projections.proto +++ b/Source/Runtime/Events.Processing/Projections.proto @@ -17,20 +17,24 @@ package dolittle.runtime.events.processing; option csharp_namespace = "Dolittle.Runtime.Events.Processing.Contracts"; option go_package = "go.dolittle.io/contracts/runtime/events/processing"; -enum ProjectionEventKeySelectorType { - EVENT_SOURCE_ID = 0; - PARTITION_ID = 1; - PROPERTY = 2; + +message EventSourceIdKeySelector { +} + +message PartitionIdKeySelector { } -message ProjectionEventKeySelector { - ProjectionEventKeySelectorType type = 1; - string expression = 2; +message EventPropertyKeySelector { + string propertyName = 1; } message ProjectionEventSelector { artifacts.Artifact eventType = 1; - ProjectionEventKeySelector keySelector = 2; + oneof Selector { + EventSourceIdKeySelector eventSourceKeySelector = 2; + PartitionIdKeySelector partitionKeySelector = 3; + EventPropertyKeySelector eventPropertyKeySelector = 4; + } } message ProjectionRegistrationRequest { @@ -41,20 +45,20 @@ message ProjectionRegistrationRequest { string initialState = 5; } -enum ProjectionNextStateType { - REPLACE = 0; - DELETE = 1; +message ProjectionReplaceResponse { + string state = 1; } -message ProjectionNextState { - ProjectionNextStateType type = 1; - string value = 2; +message ProjectionDeleteResponse { } message ProjectionResponse { services.ReverseCallResponseContext callContext = 1; - ProjectionNextState nextState = 2; - ProcessorFailure failure = 3; // If not set/empty - no failure + oneof Response { + ProjectionReplaceResponse replace = 2; + ProjectionDeleteResponse delete = 3; + } + ProcessorFailure failure = 4; // If not set/empty - no failure } message ProjectionClientToRuntimeMessage {