Skip to content

Commit ffe6353

Browse files
committed
Merge branch 'develop'
2 parents 59ed0cb + 719b583 commit ffe6353

File tree

39 files changed

+406
-167
lines changed

39 files changed

+406
-167
lines changed

CODE_OF_CONDUCT.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
## Our Standards
8+
9+
Examples of behavior that contributes to creating a positive environment include:
10+
11+
* Using welcoming and inclusive language
12+
* Being respectful of differing viewpoints and experiences
13+
* Gracefully accepting constructive criticism
14+
* Focusing on what is best for the community
15+
* Showing empathy towards other community members
16+
17+
Examples of unacceptable behavior by participants include:
18+
19+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
20+
* Trolling, insulting/derogatory comments, and personal or political attacks
21+
* Public or private harassment
22+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
23+
* Other conduct which could reasonably be considered inappropriate in a professional setting
24+
25+
## Our Responsibilities
26+
27+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28+
29+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
## Scope
32+
33+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34+
35+
## Enforcement
36+
37+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38+
39+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40+
41+
## Attribution
42+
43+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44+
45+
[homepage]: http://contributor-covenant.org
46+
[version]: http://contributor-covenant.org/version/1/4/

CONTRIBUTING.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
## How to contribute
2+
3+
EventFlow still needs a lot of love and if you want to help out there are
4+
several areas that you could help out with.
5+
6+
* **Features:** If you have a great idea for EventFlow, create a pull request.
7+
It might be a finished idea or just some basic concepts showing the feature
8+
outline
9+
* **Pull request feedback:** Typically there are several pull requests marked
10+
with the `in progress` and feedback is always welcome. Please note that the
11+
quality of the code here might not be "production ready", especially if
12+
the pull request is marked with the `prof of concept` label
13+
* **Documentation:** Good documentation is very important for any library and
14+
is also very hard to do properly, so if spot a spelling error, think up
15+
a good idea for a guide or just have some comments, then please create
16+
either a pull request or an issue
17+
* **Information sharing:** Working with CQRS+ES and DDD is hard, so if you come
18+
across articles that might be relevant for EventFlow, or even better, can
19+
point to specfic EventFlow functionality that might be done better, then
20+
please create an issue or ask in the Gitter chat
21+
* **Expand the shipping example:** If you have ideas on how to expand the
22+
shipping example found in the code base, the please create a pull request
23+
or create an issue
24+
* Give a good understanding of how to use EventFlow
25+
* Give a better understanding of how API changes in EventFlow affect
26+
existing applications
27+
* Provide a platform for DDD discussions

Documentation/EventStore.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ support for alternatives.
1616
In-memory
1717
---------
1818

19+
.. IMPORTANT::
20+
21+
In-memory event store shouldn't be used for production environments, only for tests.
22+
23+
1924
Using the in-memory event store is easy as its enabled by default, no need
2025
to do anything.
2126

@@ -72,6 +77,11 @@ application install or update, e.g., when the web site is installed.
7277
Files
7378
-----
7479

80+
.. IMPORTANT::
81+
82+
Files event shouldn't be used for production environments, only for tests.
83+
84+
7585
The file based event store is useful if you have a set of events that represents
7686
a certain scenario and would like to create a test that verifies that the domain
7787
handles it correctly.

README.md

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -315,33 +315,6 @@ share it by creating an issue with the link.
315315
- [The Unit of Work and Transactions In Domain Driven Design](http://blog.sapiensworks.com/post/2015/09/02/DDD-and-UoW/)
316316
by Mike Mogosanu
317317

318-
## How to contribute
319-
320-
EventFlow still needs a lot of love and if you want to help out there are
321-
several areas that you could help out with.
322-
323-
* **Features:** If you have a great idea for EventFlow, create a pull request.
324-
It might be a finished idea or just some basic concepts showing the feature
325-
outline
326-
* **Pull request feedback:** Typically there are several pull requests marked
327-
with the `in progress` and feedback is always welcome. Please note that the
328-
quality of the code here might not be "production ready", especially if
329-
the pull request is marked with the `prof of concept` label
330-
* **Documentation:** Good documentation is very important for any library and
331-
is also very hard to do properly, so if spot a spelling error, think up
332-
a good idea for a guide or just have some comments, then please create
333-
either a pull request or an issue
334-
* **Information sharing:** Working with CQRS+ES and DDD is hard, so if you come
335-
across articles that might be relevant for EventFlow, or even better, can
336-
point to specfic EventFlow functionality that might be done better, then
337-
please create an issue or ask in the Gitter chat
338-
* **Expand the shipping example:** If you have ideas on how to expand the
339-
shipping example found in the code base, the please create a pull request
340-
or create an issue
341-
* Give a good understanding of how to use EventFlow
342-
* Give a better understanding of how API changes in EventFlow affect
343-
existing applications
344-
* Provide a platform for DDD discussions
345318

346319
### Integration tests
347320
EventFlow has several tests that verify that its able to use the systems it
@@ -366,6 +339,14 @@ category.
366339

367340
## Thanks
368341

342+
<table border="0" cellpadding="0" cellspacing="0">
343+
<tr>
344+
<td width="25%">
345+
<a href="https://www.jetbrains.com/"><img src="./Resources/jetbrains-128x128.png" /></a>
346+
</td>
347+
</tr>
348+
</table>
349+
369350
* [Contributors](https://github.com/eventflow/EventFlow/graphs/contributors)
370351
* [JetBrains](https://www.jetbrains.com/resharper/): OSS licenses
371352
* [olholm](https://github.com/olholm): Current logo

RELEASE_NOTES.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1-
### New in 0.48 (not released yet)
1+
### New in 0.49 (not released yet)
2+
3+
* Breaking: Upgraded `EventStore.Client` dependency to version 4.0
4+
* Breaking: Changed target framework for `EventFlow.EventStores.EventStore` to
5+
.NET 4.6.2 as required by `EventStore.Client` NuGet dependency
6+
* Fix: `EventFlow.Hangfire` now depends on `Hangfire.Core` instead of
7+
`Hangfire`
8+
* New: Added an overload to `IDomainEventPublisher.PublishAsync` that isn't
9+
generic and doesn't require an aggregate ID
10+
* New: Added `IReadModelPopulator.DeleteAsync` that allows deletion of single
11+
read models
12+
* Obsolete: `IDomainEventPublisher.PublishAsync<,>` (generic) in favor of the
13+
new less restrictive non-generic overload
14+
15+
### New in 0.48.2937 (released 2017-07-11)
216

317
* Breaking: Moved non-async methods on `IReadModelPopulator` to extension
418
methods
@@ -11,7 +25,7 @@
1125
* New: Now possible to configure retry delay for MSSQL error `40501` (server
1226
too busy) using `IMsSqlConfiguration.SetServerBusyRetryDelay(RetryDelay)`
1327
* New: Now possible to configure the retry count of transient exceptions for
14-
MSSQL and SQLite using the `ISqlConfiguration.SetTransientRetryCount(int)`
28+
MSSQL and SQLite using the `ISqlConfiguration.SetTransientRetryCount(int)`
1529
* Fixed: Added MSSQL error codes `10928`, `10929`, `18401` and `40540` as well
1630
as a few native `Win32Exception` exceptions to the list treated as transient
1731
errors, i.e., EventFlow will automatically retry if the server returns one

Resources/jetbrains-128x128.png

6.3 KB
Loading

Source/EventFlow.Elasticsearch.Tests/ElasticsearchRunner.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,24 @@ public ElasticsearchInstance(
7070

7171
public async Task<string> GetStatusAsync()
7272
{
73-
var clusterHealth = await HttpHelper.GetAsAsync<ClusterHealth>(new Uri(Uri, "_cluster/health"));
74-
return clusterHealth.Status;
73+
try
74+
{
75+
var clusterHealth = await HttpHelper.GetAsAsync<ClusterHealth>(new Uri(Uri, "_cluster/health")).ConfigureAwait(false);
76+
return clusterHealth.Status;
77+
}
78+
catch (Exception e)
79+
{
80+
LogHelper.Log.Warning(e, "Exception while checking Elasticsearch health");
81+
return string.Empty;
82+
}
7583
}
7684

7785
public Task WaitForGreenStateAsync()
7886
{
7987
return WaitHelper.WaitAsync(TimeSpan.FromMinutes(1), async () =>
8088
{
8189
var status = await GetStatusAsync().ConfigureAwait(false);
82-
return status == "green";
90+
return string.Equals(status, "green", StringComparison.OrdinalIgnoreCase);
8391
});
8492
}
8593

Source/EventFlow.Elasticsearch.Tests/IntegrationTests/ElasticsearchReadModelStoreTests.cs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323

2424
using System;
2525
using System.Net;
26-
using System.Threading;
27-
using System.Threading.Tasks;
2826
using EventFlow.Configuration;
2927
using EventFlow.Elasticsearch.Extensions;
3028
using EventFlow.Elasticsearch.ReadStores;
@@ -45,6 +43,8 @@ namespace EventFlow.Elasticsearch.Tests.IntegrationTests
4543
[Category(Categories.Integration)]
4644
public class ElasticsearchReadModelStoreTests : TestSuiteForReadModelStore
4745
{
46+
protected override Type ReadModelType { get; } = typeof(ElasticsearchThingyReadModel);
47+
4848
private IElasticClient _elasticClient;
4949
private ElasticsearchRunner.ElasticsearchInstance _elasticsearchInstance;
5050
private string _indexName;
@@ -122,16 +122,6 @@ protected override IRootResolver CreateRootResolver(IEventFlowOptions eventFlowO
122122
}
123123
}
124124

125-
protected override Task PurgeTestAggregateReadModelAsync()
126-
{
127-
return ReadModelPopulator.PurgeAsync<ElasticsearchThingyReadModel>(CancellationToken.None);
128-
}
129-
130-
protected override Task PopulateTestAggregateReadModelAsync()
131-
{
132-
return ReadModelPopulator.PopulateAsync<ElasticsearchThingyReadModel>(CancellationToken.None);
133-
}
134-
135125
[TearDown]
136126
public void TearDown()
137127
{

Source/EventFlow.Elasticsearch/EventFlow.Elasticsearch.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
</ItemGroup>
2626
<ItemGroup>
2727
<PackageReference Include="NEST" Version="5.3.1" />
28+
<PackageReference Include="newtonsoft.json" Version="10.0.3" />
2829
</ItemGroup>
2930
<ItemGroup>
3031
<ProjectReference Include="..\EventFlow\EventFlow.csproj" />

Source/EventFlow.Elasticsearch/ReadStores/ElasticsearchReadModelStore.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,22 @@ public async Task<ReadModelEnvelope<TReadModel>> GetAsync(
7979
return ReadModelEnvelope<TReadModel>.With(id, getResponse.Source, getResponse.Version);
8080
}
8181

82+
public async Task DeleteAsync(
83+
string id,
84+
CancellationToken cancellationToken)
85+
{
86+
var readModelDescription = _readModelDescriptionProvider.GetReadModelDescription<TReadModel>();
87+
88+
await _elasticClient.DeleteAsync(
89+
new DocumentPath<TReadModel>(id),
90+
d => d
91+
.Index(readModelDescription.IndexName.Value)
92+
.RequestConfiguration(c => c
93+
.AllowedStatusCodes((int) HttpStatusCode.NotFound)),
94+
cancellationToken)
95+
.ConfigureAwait(false);
96+
}
97+
8298
public async Task DeleteAllAsync(
8399
CancellationToken cancellationToken)
84100
{

0 commit comments

Comments
 (0)