Skip to content

Commit

Permalink
Merge pull request #483 from Aaronontheweb/master
Browse files Browse the repository at this point in the history
Akka v0.7 live release
  • Loading branch information
Aaronontheweb committed Oct 20, 2014
2 parents b5c0f9a + e925cb8 commit af2b5de
Show file tree
Hide file tree
Showing 358 changed files with 39,088 additions and 3,256 deletions.
130 changes: 130 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# Contributing to Akka.NET
Akka.NET is a large project and contributions are more than welcome, so thank you for wanting to contribute to Akka.NET!

---

### Checklist before creating a Pull Request
Submit only relevant commits. We don't mind many commits in a pull request, but they must be relevant as explained below.

- __Use a feature branch__ The pull request should be created from a feature branch, and not from _dev_. See below for why.
- __No merge-commits__
If you have commits that looks like this _"Merge branch 'my-branch' into dev"_ or _"Merge branch 'dev' of github .com/akkadotnet/akka.net into dev"_ you're probaly using merge instead of [rebase](https://help.github.com/articles/about-git-rebase) locally. See below on _Handling updates from upstream_.
- __Squash commits__ Often we create temporary commits like _"Started implementing feature x"_ and then _"Did a bit more on feature x"_. Squash these commits together using [interactive rebase](https://help.github.com/articles/about-git-rebase). Also see [Squashing commits with rebase](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html).
- __Descriptive commit messages__ If a commit's message isn't descriptive, change it using [interactive rebase](https://help.github.com/articles/about-git-rebase). Refer to issues using `#issue`. Example of a bad message ~~"Small cleanup"~~. Example of good message: _"Removed Security.Claims header from FSM, which broke Mono build per #62"_. Don't be afraid to write long messages, if needed. Try to explain _why_ you've done the changes. The Erlang repo has some info on [writing good commit messages](https://github.com/erlang/otp/wiki/Writing-good-commit-messages).
- __No one-commit-to-rule-them-all__ Large commits that changes too many things at the same time are very hard to review. Split large commits into smaller. See this [StackOverflow question](http://stackoverflow.com/questions/6217156/break-a-previous-commit-into-multiple-commits) for informatin on how to do this.
- __Tests__ Add relevant tests and make sure all existing ones still passes. Tests can be run using the command
- __No Warnings__ Make sure your code do not produce any build warnings.

After reviewing a Pull request, we might ask you to fix some commits. After you've done that you need to force push to update your branch in your local fork.

---

### Getting started
Make sure you have a [GitHub](https://github.com/) account.

- Fork, clone, add upstream to the Akka.NET repository. See [Fork a repo](https://help.github.com/articles/fork-a-repo) for more detailed instructions or follow the instructions below.

- Fork by clicking _Fork_ on https://github.com/akkadotnet/akka.net
- Clone your fork locally.
```
git clone https://github.com/YOUR-USERNAME/akka.net
```
- Add an upstream remote.
```
git remote add upstream https://github.com/akkadotnet/akka.net
```
You now have two remotes: _upstream_ points to https://github.com/akkadotnet/akka.net, and _origin_ points to your fork on GitHub.

- Make changes. See below.

Unsure where to start? Issues marked with [_up for grabs_](https://github.com/akkadotnet/akka.net/labels/up%20for%20grabs) are things we want help with.

See also: [Contributing to Open Source on GitHub](https://guides.github.com/activities/contributing-to-open-source/)

New to Git? See https://help.github.com/articles/what-are-other-good-resources-for-learning-git-and-github

### Making changes
__Never__ work directly on _dev_ or _master_ and you should never send a pull request from master - always from a feature branch created by you.

- Pick an [issue](https://github.com/akkadotnet/akka.net/issues). If no issue exists (search first) create one.
- Get any changes from _upstream_.
```
git checkout dev
git fetch upstream
git merge --ff-only upstream/dev
git push origin dev #(optional) this makes sure dev in your own fork on GitHub is up to date
```

See https://help.github.com/articles/fetching-a-remote for more info

- Create a new feature branch. It's important that you do your work on your own branch and that it's created off of _dev_. Tip: Give it a descriptive name and include the issue number, e.g. `implement-testkits-eventfilter-323` or `295-implement-tailchopping-router`, so that others can see what is being worked on.
```
git checkout -b my-new-branch-123
```
- Work on your feature. Commit.
- Rebase often, see below.
- Make sure you adhere to _Checklist before creating a Pull Request_ described above.
- Push the branch to your fork on GitHub
```
git push origin my-new-branch-123
```
- Send a Pull Request, see https://help.github.com/articles/using-pull-requests to the _dev_ branch.

See also: [Understanding the GitHub Flow](https://guides.github.com/introduction/flow/) (we're using `dev` as our master branch)

### Handling updates from upstream

While you're working away in your branch it's quite possible that your upstream _dev_ may be updated. If this happens you should:

- [Stash](http://git-scm.com/book/en/Git-Tools-Stashing) any un-committed changes you need to
```
git stash
```
- Update your local _dev_ by fetching from _upstream_
```
git checkout dev
git fetch upstream
git merge --ff-only upstream/dev
```
- Rebase your feature branch on _dev_. See [Git Branching - Rebasing](http://git-scm.com/book/en/Git-Branching-Rebasing) for more info on rebasing
```
git checkout my-new-branch-123
git rebase dev
git push origin dev #(optional) this makes sure dev in your own fork on GitHub is up to date
```
This ensures that your history is "clean" i.e. you have one branch off from _dev_ followed by your changes in a straight line. Failing to do this ends up with several "messy" merges in your history, which we don't want. This is the reason why you should always work in a branch and you should never be working in, or sending pull requests from _dev_.

If you're working on a long running feature then you may want to do this quite often, rather than run the risk of potential merge issues further down the line.

### Making changes to a Pull request
If you realize you've missed something after submitting a Pull request, just commit to your local branch and push the branch just like you did the first time. This commit wil automatically be included in the Pull request.
If we ask you to change already published commits using interactive reabse (like squashing or splitting commits or rewriting commit messages) you need to force push using `-f`:
```
git push -f origin my-new-branch-123
```

### All my commits are on dev. How do I get them to a new branch? ###
If all commits are on _dev_ you need to move them to a new feature branch.

You can rebase your local _dev_ on _upstream/dev_ (to remove any merge commits), rename it, and recreate _dev_
```
git checkout dev
git rebase upstream/dev
git branch -m my-new-branch-123
git branch dev upstream/dev
```
Or you can create a new branch off of _dev_ and then cherry pick the commits
```
git checkout -b my-new-branch-123 upstream/dev
git cherry-pick rev #rev is the revisions you want to pick
git cherry-pick rev #repeat until you have picked all commits
git branch -m dev old-dev #rename dev
git branch dev upstream/dev #create a new dev
```

## Code guidelines

See [Contributor Guidelines](http://akkadotnet.github.io/wiki/Contributor%20guidelines) on the wiki.

---
Props to [NancyFX](https://github.com/NancyFx/Nancy) from which we've "borrowed" some of this text.
99 changes: 98 additions & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,100 @@
#### 0.7.0 Oct 16 2014
Major new changes and additions in this release, including some breaking changes...

__Akka.Cluster__ Support (pre-release) - Akka.Cluster is now available on NuGet as a pre-release package (has a `-pre` suffix) and is available for testing. After installing the the Akka.Cluster module you can add take advantage of clustering via configuration, like so:

akka {
actor {
provider = "Akka.Cluster.ClusterActorRefProvider, Akka.Cluster"
}
remote {
log-remote-lifecycle-events = DEBUG
helios.tcp {
hostname = "127.0.0.1"
port = 0
}
}
cluster {
seed-nodes = [
"akka.tcp://[email protected]:2551",
"akka.tcp://[email protected]:2552"]
auto-down-unreachable-after = 10s
}
}


And then use cluster-enabled routing on individual, named routers:

/myAppRouter {
router = consistent-hashing-pool
nr-of-instances = 100
cluster {
enabled = on
max-nr-of-instances-per-node = 3
allow-local-routees = off
use-role = backend
}
}

For more information on how clustering works, please see https://github.com/akkadotnet/akka.net/pull/400

__Breaking Changes: Improved Stashing__ - The old `WithUnboundedStash` and `WithBoundedStash` interfaces have been slightly changed and the `CurrentStash` property has been renamed to `Stash`. Any old stashing code can be replaced with the following in order to continue working:

public IStash CurrentStash { get { return Stash; } set { Stash=value; } }

The `Stash` field is now automatically populated with an appropriate stash during the actor creation process and there is no need to set this field at all yourself.

__Breaking Changes: Renamed Logger Namespaces__ - The namespaces, DLL names, and NuGet packages for all logger add-ons have been changed to `Akka.Loggers.Xyz`. Please install the latest NuGet package (and uninstall the old ones) and update your Akka HOCON configurations accordingly.

__Serilog Support__ - Akka.NET now has an official [Serilog](http://serilog.net/) logger that you can install via the `Akka.Logger.Serilog` package. You can register the serilog logger via your HOCON configuration like this:

loggers=["Akka.Logger.Serilog.SerilogLogger, Akka.Logger.Serilog"]

__New Feature: Priority Mailbox__ - The `PriorityMailbox` allows you to define the priority of messages handled by your actors, and this is done by creating your own subclass of either the `UnboundedPriorityMailbox` or `BoundedPriorityMailbox` class and implementing the `PriorityGenerator` method like so:

public class ReplayMailbox : UnboundedPriorityMailbox
{
protected override int PriorityGenerator(object message)
{
if (message is HttpResponseMessage) return 1;
if (!(message is LoggedHttpRequest)) return 2;
return 3;
}
}

The smaller the return value from the `PriorityGenerator`, the higher the priority of the message. You can then configure your actors to use this mailbox via configuration, using a fully-qualified name:


replay-mailbox {
mailbox-type: "TrafficSimulator.PlaybackApp.Actors.ReplayMailbox,TrafficSimulator.PlaybackApp"
}

And from this point onward, any actor can be configured to use this mailbox via `Props`:

Context.ActorOf(Props.Create<ReplayActor>()
.WithRouter(new RoundRobinPool(3))
.WithMailbox("replay-mailbox"));

__New Feature: Test Your Akka.NET Apps Using Akka.TestKit__ - We've refactored the testing framework used for testing Akka.NET's internals into a test-framework-agnostic NuGet package you can use for unit and integration testing your own Akka.NET apps. Right now we're scarce on documentation so you'll want to take a look at the tests inside the Akka.NET source for reference.

Right now we have Akka.TestKit adapters for both MSTest and XUnit, which you can install to your own project via the following:

MSTest:

install-package Akka.TestKit.VsTest

XUnit:

install-package Akka.TestKit.Xunit

#### 0.6.5
* Logging to Standard Out is now done in color. To disable it set `StandardOutLogger.UseColors = false;`.
Colors can be customized: `StandardOutLogger.DebugColor = ConsoleColor.Green;`.
If you need to print to stdout use `Akka.Util.StandardOutWriter.Write()` instead of `Console.WriteLine`, otherwise your messages might get printed in the wrong color.

#### 0.6.4 Sep 9 2014
* Introduced `TailChoppingRouter`
* All `ActorSystem` extensions now take an `ExtendedActorSystem` as a dependency - all thirdy party actor system extensions will need to update accordingly.
Expand Down Expand Up @@ -27,4 +124,4 @@
* Added ReceiveBuilder support

#### 0.2.1-beta Mars 22 2014
* Nuget package
* Nuget package
8 changes: 6 additions & 2 deletions build.cmd
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
@echo off

pushd %~dp0

src\.nuget\NuGet.exe update -self

src\.nuget\NuGet.exe install FAKE -OutputDirectory src\packages -ExcludeVersion -Version 2.10.24
src\.nuget\NuGet.exe install FAKE -OutputDirectory src\packages -ExcludeVersion -Version 3.4.1

src\.nuget\NuGet.exe install xunit.runners -OutputDirectory src\packages\FAKE -ExcludeVersion -Version 1.9.2

if not exist src\packages\SourceLink.Fake\tools\SourceLink.fsx (
src\.nuget\nuget.exe install SourceLink.Fake -OutputDirectory src\packages -ExcludeVersion
)
cls
rem cls

set encoding=utf-8
src\packages\FAKE\tools\FAKE.exe build.fsx %*

popd


Loading

0 comments on commit af2b5de

Please sign in to comment.