Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release Codename 'Aragorn' #77

Merged
merged 55 commits into from
Nov 5, 2021
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
1167787
Add method for building with all event handlers
woksin Sep 7, 2021
41f6480
Add prerelease branches
woksin Sep 7, 2021
2967980
Merge pull request #68 from dolittle/default-register-all
woksin Sep 7, 2021
0fff941
Add sample for registering event handlers from app
woksin Sep 15, 2021
63dfc8b
Rude way of getting all referenced assemblies
woksin Sep 15, 2021
c761105
Get all assemblies (#69)
woksin Sep 15, 2021
1409779
Add prerelease branch
woksin Oct 25, 2021
e491f6d
Add more appropriate SDK package information.
jakhog Oct 25, 2021
1546c81
Build the DLLs with an assembly version.
jakhog Oct 25, 2021
42ed4a1
Test the new create-release-notes-action
jakhog Oct 25, 2021
3cb6832
Only run release notes on release
jakhog Oct 25, 2021
c9579c0
Use the new version when releasing
jakhog Oct 25, 2021
f767581
Default to just the CHANGELOG as release notes.
jakhog Oct 25, 2021
6a02d8d
Merge pull request #78 from dolittle/release-versions-and-nuget-notes
jakhog Oct 25, 2021
68dcff6
Add release notes to packages
jakhog Oct 26, 2021
d382ac0
Merge pull request #79 from dolittle/test-release-notes
jakhog Oct 26, 2021
5442132
Does it work with single quotes maybe
jakhog Oct 26, 2021
f52833e
Merge pull request #80 from dolittle/fix-release-notes
jakhog Oct 26, 2021
8c4f907
Use msbuild output format
jakhog Oct 26, 2021
a775870
Merge pull request #81 from dolittle/fix-release-notes-formatting
jakhog Oct 26, 2021
e6073a4
Register event types
woksin Oct 28, 2021
b47a6b6
Implement registration of aggregate roots
woksin Oct 28, 2021
8223f35
Register event types and aggregate roots with their classes as name b…
woksin Oct 28, 2021
4335938
Fix a not so cool problem with ArtifactExtensions
woksin Oct 28, 2021
bc386a3
Postpone fetching off aggregate events so that we don't need blocking…
jakhog Oct 29, 2021
e8a4b91
Remove failing specs, they don't add that much value
jakhog Oct 29, 2021
e626652
Merge pull request #82 from dolittle/register-artifacts
woksin Oct 29, 2021
95e39a6
Merge branch '9.2.0-register-all' of github.com:dolittle/DotNET.SDK i…
woksin Oct 30, 2021
4957cc4
Merge branch '11.0.0-aragorn' into 9.2.0-register-all
woksin Oct 30, 2021
aaf30b2
Add methods to ClientBuilder for scanning all assemblies and register…
woksin Oct 30, 2021
49f7618
Merge pull request #83 from dolittle/register-all
woksin Nov 2, 2021
d08cc01
Merge branch '11.0.0-aragorn' of github.com:dolittle/DotNET.SDK into …
woksin Nov 2, 2021
644e4a5
Introduce IAggregateRoots that can get an instance of an aggregate root
woksin Nov 2, 2021
91a3f0d
Clean AggregateRootOperations
woksin Nov 2, 2021
eaa6065
Use supply IAggregateRoot dependency
woksin Nov 2, 2021
60c07d9
Merge pull request #84 from dolittle/fix-aggregate-async
woksin Nov 2, 2021
86ca986
Fix project reference slashes
jakhog Nov 4, 2021
35e2c0a
Upgrade to released contracts
jakhog Nov 4, 2021
eee73d3
Merge pull request #85 from dolittle/small-fixes
jakhog Nov 4, 2021
52f40f3
Register AggregateRoot in Aggregate Sample
jakhog Nov 4, 2021
6faca52
Use explicit registration of eventhandler in getting started tutorial.
jakhog Nov 4, 2021
36688b1
Fix small things
jakhog Nov 4, 2021
109f132
Make aggregate roots and event types builders work the same way.
jakhog Nov 4, 2021
f06c1c4
Move assembly loading magic to it's own project.
jakhog Nov 4, 2021
1109d67
Merge pull request #86 from dolittle/moar-fixes
jakhog Nov 4, 2021
97c0388
Fix handling of missing EventType aliases
jakhog Nov 4, 2021
5a29d01
Move creation of AggregateRoots
jakhog Nov 4, 2021
20affc5
Add specialized exception for when Runtime is not available.
jakhog Nov 4, 2021
40043fb
Change loglevel to Information for event processor registrations.
jakhog Nov 4, 2021
1f8d793
Merge pull request #87 from dolittle/fix-bug-and-nice-logs
jakhog Nov 4, 2021
2c46987
Update Getting Started and Aggregates tutorial.
jakhog Nov 4, 2021
2a29166
Update Projections sample
jakhog Nov 5, 2021
bb9d0d4
Update Embeddings tutorial
jakhog Nov 5, 2021
2396642
Fix indent in Projections tutorial
jakhog Nov 5, 2021
6b494ae
Merge pull request #88 from dolittle/update-tutorials
jakhog Nov 5, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .github/workflows/dotnet-library.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: .NET Library CI/CD

env:
PRERELEASE_BRANCHES: eventsource # Comma separated list of prerelease branch names. 'alpha,rc, ...'
PRERELEASE_BRANCHES: aragorn # Comma separated list of prerelease branch names. 'alpha,rc, ...'
CASCADES: "" # Comma separated list of cascading repos. 'dolittle/DotNet.SDK,...'
NUGET_OUTPUT: Artifacts/NuGet
COVERAGE_FOLDER: Coverage
Expand Down Expand Up @@ -55,9 +55,18 @@ jobs:
version: ${{ steps.context.outputs.current-version }}
release-type: ${{ steps.context.outputs.release-type }}

- name: Create release notes
id: create-release-notes
if: ${{ steps.context.outputs.should-publish == 'true' }}
uses: dolittle/create-release-notes-action@v1
with:
body: ${{ steps.context.outputs.pr-body }}
version: ${{ steps.increment-version.outputs.next-version }}
changelog-url: https://github.com/dolittle/DotNET.SDK/blob/master/CHANGELOG.md
output-format: msbuild
- name: Create packages
if: ${{ steps.context.outputs.should-publish == 'true' }}
run: dotnet pack --no-build --configuration Release -o ${{ env.NUGET_OUTPUT }} -p:PackageVersion=${{ steps.increment-version.outputs.next-version }} -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
run: dotnet pack --configuration Release -o ${{ env.NUGET_OUTPUT }} -p:Version=${{ steps.increment-version.outputs.next-version }} -p:PackageVersion=${{ steps.increment-version.outputs.next-version }} -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg -p:PackageReleaseNotes="${{ steps.create-release-notes.outputs.plaintext }}"

- name: Prepend to Changelog
if: ${{ steps.context.outputs.should-publish == 'true' && steps.context.outputs.release-type != 'prerelease' }}
Expand Down
19 changes: 19 additions & 0 deletions Source/Aggregates/AggregateRootAlias.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright (c) Dolittle. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using Dolittle.SDK.Concepts;

namespace Dolittle.SDK.Aggregates
{
/// <summary>
/// Represents the alias of an event type.
/// </summary>
public class AggregateRootAlias : ConceptAs<string>
{
/// <summary>
/// Implicitly convert from a <see cref="string"/> to an <see cref="AggregateRootAlias"/>.
/// </summary>
/// <param name="alias">AggregateRootAlias as <see cref="string"/>.</param>
public static implicit operator AggregateRootAlias(string alias) => new AggregateRootAlias { Value = alias };
}
}
11 changes: 8 additions & 3 deletions Source/Aggregates/AggregateRootAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using Dolittle.SDK.Artifacts;
using Dolittle.SDK.Events;

namespace Dolittle.SDK.Aggregates
Expand All @@ -16,11 +17,15 @@ public class AggregateRootAttribute : Attribute
/// Initializes a new instance of the <see cref="AggregateRootAttribute"/> class.
/// </summary>
/// <param name="id">The unique identifier.</param>
public AggregateRootAttribute(string id) => Id = id;
/// <param name="alias">The alias for the aggregate root.</param>
public AggregateRootAttribute(string id, string alias = default)
{
Type = new AggregateRootType(id, Generation.First, alias);
}

/// <summary>
/// Gets the <see cref="AggregateRootId" />.
/// Gets the <see cref="AggregateRootType"/>.
/// </summary>
public AggregateRootId Id { get; }
public AggregateRootType Type { get; }
}
}
2 changes: 1 addition & 1 deletion Source/Aggregates/AggregateRootExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static AggregateRootId GetAggregateRootId(this AggregateRoot aggregateRoo
var aggregateRootType = aggregateRoot.GetType();
var aggregateRootAttribute = aggregateRootType.GetCustomAttribute<AggregateRootAttribute>();
if (aggregateRootAttribute == null) throw new MissingAggregateRootAttribute(aggregateRootType);
return aggregateRootAttribute.Id;
return aggregateRootAttribute.Type.Id;
}

static Dictionary<Type, MethodInfo> GetHandleMethodsFor(Type aggregateRootType)
Expand Down
22 changes: 22 additions & 0 deletions Source/Aggregates/AggregateRootIdCannotBeNull.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (c) Dolittle. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using Dolittle.SDK.Events;

namespace Dolittle.SDK.Aggregates
{
/// <summary>
/// Exception that gets thrown when trying to construct an <see cref="AggregateRootType"/> without an <see cref="AggregateRootId"/>.
/// </summary>
public class AggregateRootIdCannotBeNull : Exception
{
/// <summary>
/// Initializes a new instance of the <see cref="AggregateRootIdCannotBeNull"/> class.
/// </summary>
public AggregateRootIdCannotBeNull()
: base($"The {nameof(AggregateRootId)} of an {nameof(AggregateRootType)} cannot be null")
{
}
}
}
79 changes: 79 additions & 0 deletions Source/Aggregates/AggregateRootType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
// Copyright (c) Dolittle. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using Dolittle.SDK.Artifacts;
jakhog marked this conversation as resolved.
Show resolved Hide resolved
using Dolittle.SDK.Events;

namespace Dolittle.SDK.Aggregates
{
/// <summary>
/// Represents the type of an event.
/// </summary>
public class AggregateRootType : Artifact<AggregateRootId>
jakhog marked this conversation as resolved.
Show resolved Hide resolved
{
/// <summary>
/// Initializes a new instance of the <see cref="AggregateRootType"/> class.
/// </summary>
/// <param name="id">The <see cref="EventTypeId">unique identifier</see> of the <see cref="AggregateRootType"/>.</param>
public AggregateRootType(AggregateRootId id)
: this(id, alias: null)
{
}

/// <summary>
/// Initializes a new instance of the <see cref="AggregateRootType"/> class.
/// </summary>
/// <param name="id">The <see cref="EventTypeId">unique identifier</see> of the <see cref="AggregateRootType"/>.</param>
/// <param name="alias"><see cref="AggregateRootAlias">Alias</see> of the <see cref="AggregateRootType"/>.</param>
public AggregateRootType(AggregateRootId id, AggregateRootAlias alias)
: base(id)
{
ThrowIfAggregateRootTypeIdIsNull(id);
Alias = alias;
}

/// <summary>
/// Initializes a new instance of the <see cref="AggregateRootType"/> class.
/// </summary>
/// <param name="id">The <see cref="EventTypeId">unique identifier</see> of the <see cref="AggregateRootType"/>.</param>
/// <param name="generation"><see cref="Generation">Generation</see> of the <see cref="AggregateRootType"/>.</param>
public AggregateRootType(AggregateRootId id, Generation generation)
: this(id, generation, null)
{
}

/// <summary>
/// Initializes a new instance of the <see cref="AggregateRootType"/> class.
/// </summary>
/// <param name="id">The <see cref="EventTypeId">unique identifier</see> of the <see cref="AggregateRootType"/>.</param>
/// <param name="generation"><see cref="Generation">Generation</see> of the <see cref="AggregateRootType"/>.</param>
/// <param name="alias"><see cref="AggregateRootAlias">Alias</see> of the <see cref="AggregateRootType"/>.</param>
public AggregateRootType(AggregateRootId id, Generation generation, AggregateRootAlias alias)
: base(id, generation)
{
ThrowIfAggregateRootTypeIdIsNull(id);
ThrowIfGenerationIsNull(generation);
Alias = alias;
}

/// <summary>
/// Gets the alias for the Event Type.
/// </summary>
public AggregateRootAlias Alias { get; }

/// <summary>
/// Gets a value indicating whether the Event Type has an alias or not.
/// </summary>
public bool HasAlias => Alias?.Value != default;

static void ThrowIfAggregateRootTypeIdIsNull(AggregateRootId id)
{
if (id == null) throw new AggregateRootIdCannotBeNull();
}

static void ThrowIfGenerationIsNull(Generation generation)
{
if (generation == null) throw new AggregateRootTypeGenerationCannotBeNull();
}
}
}
22 changes: 22 additions & 0 deletions Source/Aggregates/AggregateRootTypeAssociatedWithType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (c) Dolittle. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;

namespace Dolittle.SDK.Aggregates
{
/// <summary>
/// Exception that gets thrown when a <see cref="Type" /> does not have an <see cref="AggregateRootType"/> association.
/// </summary>
public class AggregateRootTypeAssociatedWithType : Exception
{
/// <summary>
/// Initializes a new instance of the <see cref="AggregateRootTypeAssociatedWithType"/> class.
/// </summary>
/// <param name="type">The <see cref="Type" /> that has a missing association.</param>
public AggregateRootTypeAssociatedWithType(Type type)
: base($"{type} is not associated with an EventType")
{
}
}
}
22 changes: 22 additions & 0 deletions Source/Aggregates/AggregateRootTypeGenerationCannotBeNull.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (c) Dolittle. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using Dolittle.SDK.Artifacts;

namespace Dolittle.SDK.Aggregates
{
/// <summary>
/// Exception that gets thrown when trying to construct an <see cref="AggregateRootType"/> with a <see cref="Generation"/> that is null.
/// </summary>
public class AggregateRootTypeGenerationCannotBeNull : Exception
{
/// <summary>
/// Initializes a new instance of the <see cref="AggregateRootTypeGenerationCannotBeNull"/> class.
/// </summary>
public AggregateRootTypeGenerationCannotBeNull()
: base($"The {nameof(Generation)} of an {nameof(AggregateRootType)} cannot be null")
{
}
}
}
41 changes: 41 additions & 0 deletions Source/Aggregates/AggregateRootTypes.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright (c) Dolittle. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
jakhog marked this conversation as resolved.
Show resolved Hide resolved
using Dolittle.SDK.Artifacts;
using Dolittle.SDK.Events;
using Microsoft.Extensions.Logging;

namespace Dolittle.SDK.Aggregates
{
/// <summary>
/// Represents an implementation of <see cref="IAggregateRootTypes" />.
/// </summary>
public class AggregateRootTypes : Artifacts<AggregateRootType, AggregateRootId>, IAggregateRootTypes
{
/// <summary>
/// Initializes a new instance of the <see cref="AggregateRootTypes"/> class.
/// </summary>
/// <param name="logger">The <see cref="ILogger" />.</param>
public AggregateRootTypes(ILogger logger)
: base(logger)
{
}

/// <inheritdoc/>
protected override Exception CreateNoArtifactAssociatedWithType(Type type)
=> new AggregateRootTypeAssociatedWithType(type);

/// <inheritdoc/>
protected override Exception CreateNoTypeAssociatedWithArtifact(AggregateRootType artifact)
=> new NoTypeAssociatedWithAggregateRootType(artifact);

/// <inheritdoc/>
protected override Exception CreateCannotAssociateMultipleArtifactsWithType(Type type, AggregateRootType artifact, AggregateRootType existing)
=> new CannotAssociateMultipleAggregateRootTypesWithType(type, artifact, existing);

/// <inheritdoc/>
protected override Exception CreateCannotAssociateMultipleTypesWithArtifact(AggregateRootType artifact, Type type, Type existing)
=> new CannotAssociateMultipleTypesWithAggregateRootType(artifact, type, existing);
}
}
1 change: 1 addition & 0 deletions Source/Aggregates/Aggregates.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

<PropertyGroup>
<AssemblyName>Dolittle.SDK.Aggregates</AssemblyName>
<RootNamespace>Dolittle.SDK.Aggregates</RootNamespace>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading